NullValue Problem in typed dataset

  • Thread starter Thread starter satyakpvd
  • Start date Start date
S

satyakpvd

hi

i am trying to pass null value for datetime field to typed dataset it
is not accepting

it is showing error as below

'Billing.FreightBillCollection.GetByDriverID(long, int,
System.DateTime, System.DateTime, System.DateTime, System.DateTime)'
has some invalid arguments
 
i am trying to pass null value for datetime field to typed dataset it
is not accepting

it is showing error as below

'Billing.FreightBillCollection.GetByDriverID(long, int,
System.DateTime, System.DateTime, System.DateTime, System.DateTime)'
has some invalid arguments

No, it wouldn't. DateTime is a value type, and doesn't have a null
value.

Are you using C# 2? If so, you could use a nullable type.

See http://pobox.com/~skeet/csharp/csharp2/nullable.html
 
Did you generate this typed data set by hand, or did you get it from a
database? If you got it from a database, then is the field nullable? If it
isn't, then I believe the data set designer would have generated a
Nullable<DateTime> for the parameters that can accept null.

As it is now, you have DateTime parameters, and you can not pass null,
as DateTimes are structures, and can not have null assigned to them.
 
Back
Top