[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP.net table adapter parameter query

Posted on 2011-02-21
4
Medium Priority
?
826 Views
Last Modified: 2012-06-22
Hi

In ASP.net 4 I have a table adapter with a parameter query. How do I pass a NULL value
into a parameter query?
0
Comment
Question by:Murray Brown
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 1000 total points
ID: 34949038
SqlDbValue.Null?
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 34949039
Use System.DBNull.Value
0
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 1000 total points
ID: 34949040
dim Parameter as SqlParameter
for each Parameter in comm.Parameters
      if Parameter.Value is null then
            Parameter.Value = DBNull.Value
      end if
next
0
 

Author Closing Comment

by:Murray Brown
ID: 34949082
Thanks very much
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

834 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