Hi
I am trying to count the rows from a table at the same time I want to update the new column I m trying the following code but not getting results please help me....
string str1 = "SELECT Extrausage FROM perclientreport WHERE Bill>0";
cmd = new OleDbCommand(str1, con);
con.Open();
cmd.ExecuteNonQuery();
for (int i = 0; i < (dt.Rows.Count); i++)
{
double ext = Convert.ToDouble(dt.Rows[i]);
double bill = (ext * 1024);
bill = (bill / 100);
string str2 = "UPDATE perclientreport SET Bill=" + bill;
cmd = new OleDbCommand(str2, con);
con.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
}