开发者

Inserting data line by line from datagridview

I am stuck at one point.

I am able to read data from csv file and display it on data gird view. Now, I want to insert those data (which is display in datagridview) into database.Also, at time of insert data with same primary key should get update.

I tried different way like stored procedure, loop but its not working.

I couldn't able to understand how should I read data line by line fro开发者_StackOverflow中文版m datagridview and insert into database.


Step #1, parse CSV into DataTable.

Step #2, set DataGridView.DataSource to the DataTable or a BindingSource attached to the DataTable.

Step #3, use a TableAdapter to write DataTable into database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜