Thursday, June 28, 2012 3:18 PM
I am new in programming , I want save the value of rows and columns of a table into a .txt file .
actually I want read all rows from first to end and save this values into variables(arrays and .....) I don't know how can do it ,
there is a way that I can specify the values of cells of the table
as a result I want to know:
how can get the value of cells of the table and save them to arrays or another suitable variables ?
thanks so much in advance !
Thursday, June 28, 2012 8:45 PM
i solve it with this:
- Marked As Answer by Mr.Reza Thursday, June 28, 2012 8:45 PM
Thursday, June 28, 2012 8:47 PMstr = new string;
int count = 0;
for (int row = 0; row < dataGridView1.RowCount-1; row++)
for (int col = 0; col < dataGridView1.Rows[row].Cells.Count; col++)
str[count++] = dataGridView1.Rows[row].Cells[col].Value.ToString();
- Marked As Answer by Mr.Reza Thursday, June 28, 2012 8:48 PM