Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what's the Difference between DataView and DataTable?

Answer Posted / ahmed yassin

DataView Object provides a window into a DataTable that can
be sorted and filtered using the Sort,RowFilter, and
RowStateFilter properties.It also contains the AllowDelete,
AllowEdit,AllowEdit, and AllowNew properties to constrain
user input as needed.

DataTable can have many DataView objects assigned to it,
allowing the data tobe viewed in many diffirent ways
without requiring the data to be reread from the database.

Example:::

DataTable customer = GetDataTable() //ur datable method
// add new datarow by adding the values
customer.Rows.Add("73OOFUFU","Mohamed","Ilyas",2533.00m);
customer.Rows.Add("3636366H","Idriis","Yassin",25545.00m);
//Sort and display
DataView view = new DataView(customer);
view.sort = "LastName ASC, FirstName ASC, Salary DESC";
GridView gv = new GridView();
gv.EnableViewState = false;
form1.Controls.Add(gv);
// assing ur gridview to dataview
gv.DataSource = veiw;
gv.DataBind();
*********************************
Sorry if there is some misspelt.

Is This Answer Correct ?    48 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a generic method?

902


What is overloading with example?

870


What is ControlBox Propertie

965


Is array immutable in c#?

842


What are Indexers in C#?

1002


What is the use of system.environment class in c#.net?

926


Explain when should you call the garbage collector in .net?

872


How to create events for a control? What is custom events? How to create it?

948


Why do we use lambda expression in c#?

902


What do you mean by sealed classes and static classes?

937


Compare and contrast between the System.Array.CopyTo() and Clone()?

933


Describe the process of “exception handling implementation” in c#?

926


What is the difference between a private assembly and a shared assembly?

970


What is a delegate how is it type safe?

824


Does c# support const methods, properties, or events?

924