Using Datatable/DataView/Dataset/... as datasource:
//Suppose we are using DataTable as Datasource
DataTable dt = GridView1.DataSource as DataTable;
foreach (DataRow dr in dt.Rows)
{
//do something
}
Using SqlDataSource control as a datasource:
//SqlDataSource1 is a SqlDataSource control
DataView view = (DataView)SqlDataSource1.Select(dsaArgs);
DataTable dt = view.ToTable();
foreach (DataRow dr in dt.Rows)
{
//do something
}
Thursday, October 23, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment