cmd = new OleDbCommand("select sum(Net_Total) FROM Factory_Pay where Factory_Name='" + comboBox1.Text + "'", con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
if (dr.HasRows)
{
double dd = Convert.ToDouble(dr[0].ToString());
label1.Text = "Grand Total : " + dd.ToString("0,0.00", CultureInfo.CreateSpecificCulture("Hi-In"));
}
else
{
MessageBox.Show("No Record found", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
dr.Close();
i m using this code to calculate total amount but i got some error msg because factory name column available in table but Net_Total column contain null value....
error msg is : "Input string was not in correct formate ";
so any one help me..