You would like to get all the values from a dgv`s row?
Lets say you want to get data from 5th row (dgv has 3 columns):
string = column1 = dgv[0,6].Value.ToString();
string = column2 = dgv[1,6].Value.ToString();
string = column3 = dgv[2,6].Value.ToString();
If the column has a default type of string, no need to parse to stirng on the end.
Same goes for columns of type int, boolean, dateTime....
If the column is type of int you simple do:
int column1 = dgv[0,6].Value;//no need to convert
Mitja
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
There is a typo in your first code block. Don't put '=' between string and the variable names :)
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
ups, sorry, and thx for reminding me. I has to be this way:
string column1 = dgv[0,6].Value.ToString();
string column2 = dgv[1,6].Value.ToString();
string column3 = dgv[2,6].Value.ToString();
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474