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
Loading
Bryian TanPosted Dec 22, 2012, 2:50 PM
http://csharp-station.com/Tutorial/AdoDotNet/Lesson03
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.insertcommand.aspx