将空白值插入数据库 [英] insert blank values to database

查看:76
本文介绍了将空白值插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在数据库中插入空白值或空值..
它适用于所有数据类型,例如int,char和and,date,decimal ..


如果我给出null表示它不接受整数
我给textbox.text ="也没有接受解决方案

How can i insert blank value or null value in database..
its suitable to all datatypes like int, char ,and ,date, decimal ..


if i give null mean it not accept by integer
i give textbox.text="" it also not accepted wat the solution

推荐答案

使用
int? i = null; 




or

Nullable<int> i = null;</int>


变量声明.


variable declaration.


我不清楚您要问什么.

插入空值

插入表格
(第1列,第2列,第3列)

(23,null,``Hello world'')

您的textbox.text =表示您正在使用某种编程语言来检索数据并尝试显示它,但是如果返回的数据为null,则会出现问题.

在不知道哪种编程语言的情况下,任何帮助都需要通用的-但您需要执行类似的操作


I''m not clear on what you are asking.

to insert a null value

insert into table
(column1, column2, column3)
values
(23, null,''Hello world'')

Your textbox.text = implies you are using some programming language which has retrieved the data and are trying to display it, but have an issue if the data returned is null.

without knowing what programming language, any help needs to be generic - but you need to do something like


If row("column2") is DbNull.Value Then
  TextBox1.Text = String.empty
Else
  TextBox1.Text - row("Column2")
End If


这篇关于将空白值插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆