4
Answers

Insert lines of data from datagridview into sql database

Photo of Marvin kakuru

Marvin kakuru

13y
1.8k
1
hi there,
I hope you are all alright,

I need help on how to insert various columns and rows of data from my datagridview1 into a table in an sql database.

kindly show me if you know how and show me an example of code that can do what i am trying to do.
thanks again.
 

Answers (4)

0
Photo of Marvin kakuru
NA 224 113.4k 13y
hi Jitendra, kindly show me an example of code that can insert the datagridview values, i am just learn c sharp and i have no programming education.thanks
0
Photo of Jiteendra Sampathirao
NA 6.9k 1.5m 13y

Hi,
Then insert values using insert query.......
0
Photo of Marvin kakuru
NA 224 113.4k 13y
thanks Sam, unfortunately in not an experienced developer. however i am not using this datagridview to view data from an sql table but i am using it as a shopping cart where insert values from different textboxes till i have above 20 lines of Products, measure, cost, purpose.

now it these lines that i want to insert into the database table. 
0
Photo of Sam Hobbs
NA 28.7k 1.3m 13y
Note that that is not the way that experienced developers would do it. Experienced developers would bind the table to the DataGridView so the data is retrieved from and stored to the table. If you want to do it that way or the way you are asking, then just look at the articles in this web site.