1
Answer

Error in sql query

narasiman rao

narasiman rao

11y
1.6k
1
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)