How to compare two number ...
Hi
Error :
Specified cast is not valid.
protected void Button2_Click(object sender, EventArgs e)
{
MySqlDataAdapter da = new MySqlDataAdapter("select * from leaveform ", cn);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
da.Fill(ds);
foreach (DataRow dr in ds.Tables[0].Rows)
{
//Convert.ToInt32
Double col1Value = (Double)dr["Leavebal"];
Double col1Value2 = (Double)dr["Number"];
// Label3.Text = col1Value.ToString();
//Label1.Text = col1Value2.ToString();
if (col1Value <= col1Value2 )
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(' ... ')", true);
}
else
{
string str3 = "insert into leaveform values('" + dplsttype.SelectedItem.Text + "','" + TextBox1.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + txtfrom.Text + "', '" + dpleavefrom.SelectedItem.Text + "','" + txtto.Text + "','" + dpleaveto.SelectedItem.Text + "','" + Label1.Text + "','" + txtremark.Text + "')";
MySqlCommand Cmd = new MySqlCommand(str3, cn);
Cmd.ExecuteNonQuery();
}
}
}
VulpesPosted Jan 31, 2015, 2:11 PM
ancy chackoPosted Jan 31, 2015, 7:07 AM
Khargesh RajputPosted Jan 31, 2015, 6:58 AM
leaveform table structure