I have an app that saves a sql data set to a csv file. I read the data, loop each row saving into a string and then I save the string into a text file. The problem is there is a over 25k rows and it takes a long time to process. Is there a faster way to do this?
SqlDataAdapter sSQL2 = new SqlDataAdapter("SelUsersEmails", Conn);
DataSet RS2 = new DataSet();
sSQL2.Fill(RS2, "SelUsersEmails");
s = "UserID,SignUpDate,Email,PayPalEmail,Firstname,Lastname" + Environment.NewLine;
foreach (DataRow u in RS2.Tables["SelUsersEmails"].Rows)
{//loop each
s += u["UserID"].ToString() + "," + u["SignUpDate"].ToString() + "," +["Email"].ToString() + "," + u["NetworkEmail"].ToString() + "," + ["Firstname"].ToString() + "," + u["Lastname"].ToString();
s += Environment.NewLine;
}