Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
How to compare two number ...
ancy chacko
9y
621
1
Reply
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();
}
}
}
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
ASP.net Return html response
How to get 2 values from word "abc,xyz' i.e.abc & xyz