Click here to Skip to main content
15,903,175 members

Comments by anjali02199 (Top 3 by date)

anjali02199 17-Jul-13 1:53am View    
error is: Incorrect syntax near')'.
Line 29: cmd.ExecuteNonQuery();

and my code is:
public void Add_scheduled(object sender, EventArgs e)
{
String sql;
sql = "insert into dbo.b_schedule";
sql = sql + "(sdate,scost,sremark,ano)";
sql = sql + "values(Convert(date,'" + adddate.Text + "',103),";
sql = sql + Convert.ToDouble(Mcost.Text) + ",";
sql = sql + "'" + Mremark.Text + "',";
sql = sql + uano.Text + ")";
c.executeqry(sql);
adddate.Text = string.Empty;
Mcost.Text = string.Empty;
Mremark.Text = string.Empty;
uano.Text = string.Empty;

Response.Redirect("BQS.aspx");
}



1.where uano is the serial no. and called as foreign key

anjali02199 17-Jul-13 1:30am View    
can u please make the correction and write it over here.
anjali02199 17-Jul-13 1:29am View    
Incorrect syntax near ')'.
Line 29: cmd.ExecuteNonQuery():(the error is being generated for add_scheduled )