如果整数数据类型中的字段为空,如何在文本框中插入空值 [英] How to insert null value in textbox if field is empty in integer datatype
本文介绍了如果整数数据类型中的字段为空,如何在文本框中插入空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果文本框字段为空,我想在sql中输入null值.
我该怎么办.
I want to enter null value in sql if textbox field is empty.
what can i do.
推荐答案
尝试DBNull.Value
.
do in database where u want set the textboxvalue to the column,
set below case there
(CASE WHEN @textBoxValue=''''
THEN NULL
ELSE @textBoxValue
END)
u可以将列值作为null传递给sql查询,而不用单引号...
u can pass the column value as null for sql query without single quotation...
这篇关于如果整数数据类型中的字段为空,如何在文本框中插入空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文