hello!
i can't save to database, CALENDERED_DATE datatype is DateTime in SQL Server
i keep on seeing this error: "Incorrect Syntax near '#'."
comm.CommandText = "SELECT * FROM tblData WHERE RACK_NO = '"+ cboRackNo.Text +"' AND CALENDERED_DATE = #"+ Convert.ToDateTime(dtpCalenderedDate.Text).ToShortDateString() +"# AND SHIFT = '"+ cboShift.Text +"' AND ROLL_NO = "+ txtRollNo.Text +" AND POSITION = '"+ cboPosition.Text +"'";
even i remove the "Convert function"
this is the debug result:
? comm.CommandText
"SELECT * FROM tblData WHERE RACK_NO = 'PW947' AND CALENDERED_DATE = #6/27/2007# AND SHIFT = 'Swing' AND ROLL_NO = 1 AND POSITION = 'T'"
in reading the result i dont see any error.
any idea how to solve?
tnx in advance.




Reply With Quote