Hi Everybody,
I have a table with the fields Logid(primery key), Name, Address,EnteranceTime,LeaveTime
I want to access the records where the 'leavetime is null' and 'difference of Enterance time and the current time is less than the time duration I specify'. I am trying to pass current time and the time duration as function parameters. Problem is I can't pass the parameters right way. The error is parameters mismatch.
SELECT Logid, Name, Address, Company, EnteranceTime, LeaveTime, CardId
FROM EnteranceLog
WHERE (LeaveTime IS NULL) AND (EnteranceTime - ? = ?)
In c# I am calling the query this way
TimeSpan timespan = getduration();
this.enteranceLogMissingPersonsTableAdapter.Fill(this.enteranceLogDataSet.EnteranceLogMissingPersons, DateTime.Now.ToString (), timespan.ToString () );
please guide me how can I overcome this error