• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

How do I properly code the sizeof DbType.Date?

I use Enterprise Library to access the data store (SQL Server).

It is necessary to give the size of the data type in this method. How do I code it properly?

db.AddOutParameter(command, "@CreationDate", DbType.Date, sizeof(DbType.Date));

Compile error:  System.Data.DbType.Date is a 'field' but is used like a 'type'.

What should I do?
  • 2
1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you don't put any size at all:
db.AddOutParameter(command, "@CreationDate", DbType.Date);
chuang4630Author Commented:
I have tried, the error still exists:

No overload for method 'AddOutParameter' takes 3 parameters
chuang4630Author Commented:
Just to close it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now