Send data from DataSet to DataGridView and vice versa...

Gopesh9
Posted by Gopesh9 under ASP.NET category on | Points: 40 | Views : 1625
Suppose I have a DataGridView named datagrid1.

Now I want to bind the values of DataSet to the DataGridView then i have to use....
datagrid1.DataSource = ds.Tables[0];// where ds is the object of dataSet
datagrid1.DataBind();


Again I want to bind the values of DataGridviewto the DataSet then i have to use....
DataSet ds= ((DataTable)datagrid1.dataSource).DataSet

Comments or Responses

Posted by: Srilu.Nayini577 on: 8/17/2012 Level:Starter | Status: [Member] | Points: 10
I used the above code in most of the cases.

Thank you,

Login to post response