0

Hi.
I m having trouble with a small method I wrote. Would be nice f someone can help me.

this is my method:-

public IQueryable getCustomerOrderList(DateTime dt)
    {
        var customerList = from p in dc.CustomerOrders
                           where p.OrderDate == dt && p.OrderStatus == true
                           select new {p.aspnet_Membership.aspnet_User.UserName,p.OrderNo,p.OrderDate,p.Note,p.DeliveryStatus,p.DeliveryTime };
        return customerList;
    }

And this is the error i am having:-

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by all star
0

Can you post the code that is calling that particular function? My hunch is that your datetime argument is invalid.

0

Can you post the code that is calling that particular function? My hunch is that your datetime argument is invalid.

Actually I am passing the parameter from the Object Data Source's selecting event and trying to bind the result in a grid.

This is from where I am passing the parameter:-

protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {

        e.InputParameters["dt"] = DateTime.Now;
    }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.