Sunday, April 8, 2012

Different ways of using Data set in Asp.net

Title: Example on Data set in asp.net

Description:As in previous article we just have learnt the basic and theoretical concept of data set .Now i would like to explain the different ways data set usages .Data set is Independent component with in Ado.net.It can be build in three ways
1.manual approach
Dataset ds=New Dataset();
DataTable dt=New DataTable("Orders");
dt.Columns.Add("orderno",type(int);
ds.Tables.Add(dt);
2.Using Data Adapter
SqlDataAdapter da=New SqlDataAdaper("select *from Orders",con);
Dataset ds=New Dataset();
da.fill(ds,"orders");
fill method will perform 3 ways.It will establish connection,send select statement to data base and will close the connections
3.using XML storage
Dataset ds=New Dataset();
da.ReadXML("/Orders.xml");

No comments:

Bel