I have a form with dataGridView to display content of table Attendance
TagID SessionID ScanningTime
---------------------------------------
4820427 Test1 14/08/2013 18:12
I would like to add a record manually to the table to look like this....
TagID SessionID ScanningTime
---------------------------------------
4820000 Test1 14/08/2013 18:12
0000001 Test2 15/08/2012 17:00
...and save changes to SQL Server database after button has been clicked.
I have tried creating UPDATE query:
command.Text = "UPDATE Attendance
SET TagID= @tagNo, SessionID= @sessionNo, ScanningTime= @scantime";
But I'm not sure how to assign values from DGV to parameters.
What is the correct way to save changes from dataGridView to SQL Server database?
Please note that I do not use DataSet or TableAdapter when working with DGV.
initiative / effort- MethodMan