Solved

How do I properly code the sizeof DbType.Date?

Posted on 2006-07-03
3
478 Views
Last Modified: 2008-01-09
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?
0
Comment
Question by:chuang4630
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17034919
you don't put any size at all:
db.AddOutParameter(command, "@CreationDate", DbType.Date);
0
 
LVL 1

Author Comment

by:chuang4630
ID: 17034948
I have tried, the error still exists:

No overload for method 'AddOutParameter' takes 3 parameters
0
 
LVL 1

Author Comment

by:chuang4630
ID: 17109496
Just to close it.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question