I have a table in my SQL Server DB that contains a DateTime type field set up as the Primary Key. I have the following code that performs a search:
There is definately a record that contains the date and time mentioned above, but my sql cannot find it. Do i need to convert something or change the sql query structure?Code:string SQL = "SELECT * FROM [MyEventLog] Where [theDate] = '13/03/2004 08:22:37'; SqlCommand sqlComm = new SqlCommand(SQL,sqlConn); SqlDataReader sqlReader = sqlComm.ExecuteReader(); while(sqlReader.Read()) { richNote.Text = sqlReader["theNote"].ToString(); }
anyone?
thanks




Reply With Quote