I am trying to run a query based on the date at which the user visits the page that will populate a datagrid. The datagrid populates through an SqlDataSource preconfigured with the code found in the code window.
Database : SQL2005 latest release
Web page : VB.NET ==> ASPX (pro 2008 edition)
The query uses parameters : @DateReturn and @UID
Parameter Sources : Controls on the webform (Hidden Value fields)
The @DateReturn parameter of the sqlDataSource is mapped to a hidden control on the page that is set at the PageLoad event to the Date.Now value. I also tried formatting the date with the "#" , and also tried using Date.Today.
@UID gets its value from another hidden value set at the at the PageLoad event as well.
In debugging, both values are correctly there and accessible by code.
When the sqlDataSource.Databind gets fired, I get an arithmatic error caused by an overflow in the @DateReturn field.
The field to compare the date IS a datetime datatype.
SqlDataSource Select Statement :
SELECT * FROM tblStock
WHERE fldDateReturn > @DateReturn
fldUserID = @UID
me.dateVal.value = date.now
me.uidVal.value = userid ' retrieved trough another sub