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
Solved

Null

Posted on 2006-07-17
4
237 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
4 Comments
 
LVL 52

Expert Comment

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

Accepted Solution

by:
SystemExpert earned 125 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 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