I'm searching for information about to send all Info of the datagridview to a log file
mine datagridview code is as follow:
dataGridView1.Rows.Add(listBox1.Items[m].ToString(), count,+ ts.Days+"d"+ts.Hours+"h"+ts.Minutes+"M"+ts.Seconds+"sec", count * a * a, DateTime.Now.ToString());
this datagridview is updated every second and it need to add in the log file.
Loading
Arnold PetronaPosted Jul 30, 2008, 2:11 PM
Instead to Create the text file i had to do Append
Arnold PetronaPosted Jul 30, 2008, 1:25 PM
Here is my code:
for (m = 0; m < listBox1.Items.Count; m++)
{
if (m == 0)
{
dataGridView1.Rows.Clear();
}
for (count = 1; count <= n; count++)
{
// int b = 0;
// TimeSpan ts = new TimeSpan(0, 0, 0, a);
// int days = ts.Days;
// int hours = ts.Hours;
// int mins = ts.Minutes;
// int sec = ts.Seconds;
FileStream f = new FileStream("output.txt", FileMode.Create);
StreamWriter s = new StreamWriter(f);
dataGridView1.Rows.Add(listBox1.Items[m].ToString(),
count,+ ts.Days+"d"+ts.Hours+"h"+ts.Minutes+"M"+ts.Seconds+"sec", count * a * a, DateTime.Now.ToString());
s.Write(listBox1.Items[m].ToString());
s.Write(",");
s.Write(count);
s.Write(",");
s.Write(ts.Days + "Days " + ts.Hours + "Hrs " + ts.Minutes + "Min " + ts.Seconds + "Sec");
s.Write(",");
s.Write(count * a*a);
s.Write(",");
s.Write(DateTime.Now.ToString());
s.Close();
f.Close();
a++;
}
}
This Code is in mine timer_Tick Method