插入NULL [英] inserting NULL

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

问题描述

如何在其中一个字段中插入一个空值的记录?


我需要使用数据适配器的更新方法。数据在XML

文件中。

解决方案

bill< be * ***@datamti.com>写道:

如何在其中一个字段中插入一个空值的记录?

我需要使用数据适配器的更新方法。数据在XML
文件中。




只需将null(DBNull.Value)放入
$的相应行/列中b $ b数据表。如果这不起作用,你可以发一个简短但完整的

程序来证明这个问题吗?


参见 http://www.pobox.com/~skeet/csharp/complete.html 详情

我的意思是什么。


-

Jon Skeet - < sk *** @ pobox。 com>
http://www.pobox.com/~skeet

如果回复小组,请不要给我发邮件


谢谢Jon

我是使用streamwriter创建XML文件。

然后我使用ReadXML将XML文件读入数据集。


然后我将数据集传递给数据适配器更新方法将数据

插入数据库。


我只是不知道在XML文件字段标记之间放什么来表示

null值应为inse rt。


否则它的工作正常。


-Bill

" Jon Skeet [C#MVP]" ; < SK *** @ pobox.com>在消息中写道

新闻:MP ********************** @ msnews.microsoft.com ...

bill< be **** @ datamti.com>写道:

如何在其中一个字段中插入一个空值的记录?

我需要使用数据适配器的更新方法。数据位于
XML文件中。



只需将null(DBNull.Value)放入
数据表的相应行/列即可。如果这不起作用,你可以发一个简短但完整的程序来证明这个问题吗?

http://www.pobox.com/~skeet/csharp/complete.html 了解详情
我是什么这意味着。

-
Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet
如果回复小组,请不要给我发邮件



Bill,


我假设你使用streamwriter创建一个XML数据集文件(你怎么样) b $ b这样做并不重要。)


通常情况下,

与DBnull相同的标签之间没有设置任何东西(但不是真的没什么)。价值(null)。


我希望这有帮助吗?


Cor


" bill" ; < be **** @ datamti.com>

...

谢谢Jon
我正在使用streamwriter来创建XML文件。<然后我使用ReadXML将XML文件读入数据集。
然后我将数据集传递给数据适配器Update方法,将
数据插入数据库。

我只是不知道在XML文件字段标记之间放什么来表示应插入
空值。

否则它的工作正常。

-Bill

" Jon Skeet [C#MVP]" < SK *** @ pobox.com>在消息中写道
新闻:MP ********************** @ msnews.microsoft.com ...

bill <是**** @ datamti.com>写道:

>如何在其中一个字段中插入空值的记录?
>
>我需要使用数据适配器的更新方法。数据是XML>文件。



只需将null(DBNull.Value)放入
数据表的相应行/列中。如果这不起作用,你可以发一个简短但完整的程序来证明这个问题吗?

http://www.pobox.com/~skeet/csharp/complete.html 了解详情
我是什么这意味着。

-
Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet
如果回复小组,请不要给我发邮件




How can I insert a record with a null value in one of the fields?

I need to use the update method from a data adapter. The data is in a XML
file.


解决方案

bill <be****@datamti.com> wrote:

How can I insert a record with a null value in one of the fields?

I need to use the update method from a data adapter. The data is in a XML
file.



Simply put a null (DBNull.Value) into the appropriate row/column of the
datatable. If this doesn''t work, could you post a short but complete
program which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Thanks Jon
I''m using streamwriter to create a XML file.
Then I use ReadXML to read the XML file into the dataset.

Then I pass the dataset to the data adapter Update method to insert the data
into the database.

I just don''t know what to put between the XML file field tags to indicate a
null value should be inserted.

It works fine otherwise.

-Bill
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP**********************@msnews.microsoft.com ...

bill <be****@datamti.com> wrote:

How can I insert a record with a null value in one of the fields?

I need to use the update method from a data adapter. The data is in a XML file.



Simply put a null (DBNull.Value) into the appropriate row/column of the
datatable. If this doesn''t work, could you post a short but complete
program which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too



Bill,

I assume that you create a XML dataset file using the streamwriter (how you
do that is not important).

Normally is setting nothing (not the word however really nothing) between
the tags the same as DBnull.value(null).

I hope this helps?

Cor

"bill" <be****@datamti.com>
...

Thanks Jon
I''m using streamwriter to create a XML file.
Then I use ReadXML to read the XML file into the dataset.

Then I pass the dataset to the data adapter Update method to insert the
data
into the database.

I just don''t know what to put between the XML file field tags to indicate
a
null value should be inserted.

It works fine otherwise.

-Bill
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP**********************@msnews.microsoft.com ...

bill <be****@datamti.com> wrote:

> How can I insert a record with a null value in one of the fields?
>
> I need to use the update method from a data adapter. The data is in a XML > file.



Simply put a null (DBNull.Value) into the appropriate row/column of the
datatable. If this doesn''t work, could you post a short but complete
program which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too




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

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