Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to pass null to string variable in my sql query in where clause(Eg:select * from x WHERE ISNULL('"+S+"',a.ds)=a.ds) to return all records if null and with data set if any code behind in c#
Posted
Updated 25-Apr-13 7:11am
v3

1 solution

Use System.DBNull as value to pass on in your query.
Refer: MSDN: DBNull[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900