Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to enter null value in sql if textbox field is empty.
what can i do.
Posted
Comments
Technoses 27-Feb-12 8:09am    
which language u r using
write code how u work with??
Sergey Alexandrovich Kryukov 27-Feb-12 20:22pm    
Not a question.
--SA

Try DBNull.Value.
 
Share this answer
 
Comments
piushshukla 27-Feb-12 7:16am    
DBNull.Value is not working..
piushshukla 27-Feb-12 7:16am    
@ Sudip I want to this on code behind
do in database where u want set the textboxvalue to the column,

set below case there

(CASE WHEN @textBoxValue=''
      THEN NULL
      ELSE @textBoxValue
    END)
 
Share this answer
 
u can pass the column value as null for sql query without single quotation...
 
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