Link to home
Start Free TrialLog in
Avatar of partulu
partulu

asked on

Date as a Parameter for SQL Server query using ASP.NET

I want to insert some data along with the date into SQL Server 2000 using ASP.NET. I have used "DateTime.Now" to get the current local system time using C sharp and then inserted that value in SQL Server.

Now my task is to select some idNumers from the SQL Server . The query looks somewhat like

  select idNumber from  users where UserID=? and Date>=?

I select the parameters "UserID" and "Date" depending on the session userId and date from local system using "DatTime.Now". I used DataSet for this task.

I am getting no rows selected even though there are rows which can satisfy the above query.

How can I add Date as a paramter. Shall I have to do any explicit casting for this.

Plz help me to solve this problem
ASKER CERTIFIED SOLUTION
Avatar of nan1217
nan1217

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial