How To Send data from datagridview to database..??

Posted by Rock_Monu under ASP.NET on 8/16/2012 | Points: 10 | Views : 1808 | Status : [Member] | Replies : 3
How To Send data from datagridview to database at insert button in windows form in asp.net...?plz give me appropriate answer..?




Responses

Posted by: Gopesh9 on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down
DataSet ds= ((DataTable)datagrid1.dataSource).DataSet

Now just write
da.Update(ds);
where da is the object of DataAdapter.

G. S.
.Net Developer

Rock_Monu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rock_Monu on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down
i can't undestand sir plz give me brief idea sir.
thanx

Rock_Monu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopesh9 on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down
Suppose you have a datagridview whose name is datagrid1. Now you are copying all the values of that datagrid in the dataset. Since datagrid1 has only one table so we are inserting that values as a DataTable in the Dataset. Now we have a DataAdapter da, this DataAdapter will update the table in the database using DataSet.

G. S.
.Net Developer

Rock_Monu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response