Hello
i hope I'm in the right forum I'm trying to get a float value out the datbase and caculate that column and then show the answer in a textbox. But what is happing is i get an exception i understand that its the wrong format i have tryed everything i can think of.
SqlConnection con = new SqlConnection("Data Source=warwick-PC; Initial Catalog=Taxi; Integrated Security=True; Trusted_Connection=yes");
con.Open();
string sqlCmd;
sqlCmd = "SELECT * FROM taxi_comm WHERE Month = '" + cmbStartMonth.SelectedValue+ "'";
SqlCommand creatCommand = new SqlCommand(sqlCmd, con);
SqlDataReader dr = creatCommand.ExecuteReader();
double totalOwed = 0.00;
foreach (DataGridViewRow row in gvDisplay.Rows)
{
double owed = double.Parse(row.Cells[10].ToString());// throws an exception
totalOwed += owed;
txtTotalGST.Text = totalOwed.ToString();
}
con.Close();Thanks You for any help