Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Null

Posted on 2006-07-17
4
Medium Priority
?
243 Views
Last Modified: 2010-04-16
How can i pass the Null value from the c# code to the StroredProcedure?.
0
Comment
Question by:Rahamathulla_J
2 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17120615
DbNull.Value;
0
 
LVL 10

Accepted Solution

by:
SystemExpert earned 375 total points
ID: 17121243
Hi,

if (hshSearchCriteria[UserID] != null)
{
      string UserID = hshSearchCriteria[UserID].ToString();
      dbCommandWrapper.AddInParameter("UserID",DbType.String, UserID);

}
else
{
      dbCommandWrapper.AddInParameter("UserID",DbType.String, DBNull.Value);
}

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses

772 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