Click here to Skip to main content
11,575,126 members (71,155 online)

Comments by Foyzul Karim (Top 4 by date)

Foyzul Karim at 5-Oct-11 0:37am View
   
Deleted
Reason for my vote of 4
nice and not lengthy
Foyzul Karim at 29-Oct-10 1:17am View
   
Deleted
Reason for my vote of 4
nice tip. helpful for my project.
Foyzul Karim at 29-Oct-10 1:16am View
   
Deleted
DataTable dataTable=new DataTable();
dataTable.Columns.Add("col1");
dataTable.Columns.Add("col2");
for (int i = 0; i < 100000; i++)
{
dataTable.Rows.Add("value" + i, "name" + i);
}

DateTime d1 = DateTime.Now;
foreach (DataRow row in dataTable.Rows)
{
string value1 = row["col1"].ToString();
string value2 = row["col2"].ToString();
string value = value1 + value2;
}
TimeSpan sp1 = DateTime.Now - d1;
Console.WriteLine(sp1.Milliseconds); //output 109 milliseconds

DateTime d2 = DateTime.Now;
DataColumn column1 = dataTable.Columns["col1"];
DataColumn column2 = dataTable.Columns["col2"];
foreach (DataRow row in dataTable.Rows)
{
string value1 = row[column1].ToString();
string value2 = row[column2].ToString();
string value = value1 + value2;
}
TimeSpan sp2 = DateTime.Now - d2;
Console.WriteLine(sp2.Milliseconds); //32 milliseconds
Foyzul Karim at 7-Jun-10 8:03am View
   
I am sorry for my ignorance. But could you please elaborate why it is not possible?
Thanks.

Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid