开发者

Inserting data line by line from datagridview

开发者 https://www.devze.com 2023-02-17 22:36 出处:网络
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 inser

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

精彩评论

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