Getting the rows cell to line up with parameters in a stored procedure
I am using a datagridview on a win app designed in c#2010 express. In the _row leave event of my datagrid I would like to use the TableAdapter.us开发者_JAVA技巧p_insert() that I created. But how does one match up the data in the cells of the datagridview row to the parameters in the stored procedure.
This is what if found so far!
Int i;
i = datagridview1.SelectedCells[0].RowIndex;
...
....
// Eventually
string id = dataGridView1.Rows[i].cell[0].Value.ToString();
@para1 = id;
Etc..
What do you think?
It seems that I solved my problem
Int i;
i = datagridview1.SelectedCells[0].RowIndex;
... ....
Eventually assign the the specific column/row to the declared value:
string id = dataGridView1.Rows[i].cell[0].Value.ToString();
@para1 = id;
Etc..
is that answer I needed
精彩评论