NullValue Problem in typed dataset

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
 
J

Jon Skeet [C# MVP]

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top