SqlConnection conn = new SqlConnection("Server=ILLUMINATI;" +
"Database=DB;Integrated Security= true");
SqlCommand comm = new SqlCommand(
"Insert into FileUpload ('FilePath','TypeId','UploadedBy','UploadedDate')
values (" + savePath + "," + typeid + "," + NAME + "," + DateTime.Now+ ")", conn);
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
It’s giving an error saying:
{“Incorrect syntax near ‘C’.”}
Can anybody tell me the error please.
You have to put single
''quotes around the value strings not around the column namestry this
assuming
typeIDis string, if not dont put''around it