Dear All
The project that i'm doing is readind data form txt file and then put these data in an array and display them in datagridview. this part has been done. But the second part is when I excuate the programe of course the data will be displaied in the datagridview then when I write data in the new and last row in the datagrid view I would like when I click on a save button for example this new row will be written in an array so, I can then add it in the file(txt file)
thank u again
knid regards
nasser
--------------------------------------------------------------------------------
Dear nasser
I'm a new member here but i red ur question , and i have the answer and a comment on your think.
First :
The Comment
* why u want to save data in an array u already saved it in the file except if u wanna to use the array again.
Second : The answer
This is the method u can follow :
Code
StreamWriter sw = File.CreateText(String Path+Name);
for (int i ; i<dataGridView.Rows.Count-1 ; i++)//looping on all rows
{
sw.WriteLine ( dataGridView.Rows[i].Cell["First Column name "].value.ToString()+ "," + dataGridView.Rows[i].Cell["Second Column name "].value.ToString() + ....and so on);
}
sw.close();
if this is the answer for ur question tell me or if it wasn't also tell me
yasser khoder