narasiman rao

narasiman rao

  • NA
  • 519
  • 766.2k

Error in sql query

Dec 22 2012 8:29 AM
Database Design as follows
 
FieldName Data Type
Name varchar
DOB Date time
Mobile Varchar
Email Varchar
Wedding day datetime
Activate Varchar
 

Code as follows for inserting the record.
 
con.Open();
sql command cmd = new sql command(" '" + txt_name.Text + "','" + txt_mobile.Text + "','" + txt_Email.Text + "','" + FromDate.SelectedDateValue + "','" + Todate.SelectedDateValue + "' where Activate<>'D')");
cmd.ExecuteNonQuery();
con.Close();
 

when i run i have error in query.
 
query as follows
 
sql command cmd = new sql command(" '" + txt_name.Text + "','" + txt_mobile.Text + "','" + txt_Email.Text + "','" + FromDate.SelectedDateValue + "','" + Todate.SelectedDateValue + "' where Activate<>'D')");
 
please help me.to get the solution for writing the correct for my above query






Answers (1)