TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ancy chacko
NA
71
18.4k
How to compare two number ...
Jan 31 2015 6:38 AM
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();
}
}
}
Reply
Answers (
3
)
ASP.net Return html response
How To Filter Data In The Datagridvie Using Linq