导入文本变为null [英] import text getting null

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

问题描述

嘿所有,


我有一个winapp,使用数据

适配器将文本文件导入到类型化数据集中。一些值为null。有没有办法删除null

值并为字符字段添加空字符串,为数字字段添加0?


是否有可能的表达式我可以在类型化数据集属性中使用

每个字段去除空值?


谢谢,

rodchar

hey all,

i have a winapp that imports a text file into a typed dataset using the data
adapter. some of the values are null. is there a way to remove the null
values and put an empty string for character fields and 0 for numeric fields?

is there a possible expression i can use in the typed dataset properties for
each field to rid the nulls?

thanks,
rodchar

推荐答案

对于每个数据表,您应该能够设置

字段的默认值,还可以设置返回的值。该字段为空。

您是否尝试过使用这些属性。?

For each Datatable, you should be able to set the Default value of your
fields, and also set a value that is returned if the field is Null.
Have you tried using those properties.?


For each _dr in oDsTXLIBR.TXFP3003
Console.Write(_dr.TF_EXEMPT)

下一页


***命令即时窗口***

?oDsTXLIBR.Tables(" TXFP3003")。Rows(0)(" TF_EXEMPT")

{System.DBNull}

[System.DBNull]: {System.DBNull}

?ROW.TF_EXEMPT

" TEST"

为什么有2个不同的值?我把测试在NullValue属性和

它的工作方式应该如此,但为什么有两个不同的值,它看起来

两个命令应该指向同一个位置?


" Jerry H."写道:
For Each _dr In oDsTXLIBR.TXFP3003
Console.Write(_dr.TF_EXEMPT)
Next

*** Command-Immediate Window ***
?oDsTXLIBR.Tables("TXFP3003").Rows(0)("TF_EXEMPT")
{System.DBNull}
[System.DBNull]: {System.DBNull}
?ROW.TF_EXEMPT
"TEST"
Why are there 2 different values? I put "TEST" in the NullValue property and
it worked like it should but why are there 2 different values where it looks
both commands should be pointed to the same location?

"Jerry H." wrote:
对于每个数据表,您应该能够设置
字段的默认值,并设置一个值,如果该字段为空,则返回。<你有没有试过使用这些属性。?
For each Datatable, you should be able to set the Default value of your
fields, and also set a value that is returned if the field is Null.
Have you tried using those properties.?



仅供参考 - 我知道以下语法差异:

_dr.TF_EXEMPT假设与ROW.TF_EXEMPT相同

i正在进行一些测试并忘记改回来


" rodchar"写道:
FYI - i am aware of the following syntax differences:
_dr.TF_EXEMPT is suppose to be the same as ROW.TF_EXEMPT
i was doing some testing and forgot to change back

"rodchar" wrote:
For each _dr in oDsTXLIBR.TXFP3003
Console.Write(_dr.TF_EXEMPT)
下一页

***命令-Immediate Window ***
?oDsTXLIBR.Tables(" TXFP3003")。Rows(0)(" TF_EXEMPT")
{System.DBNull}
[System.DBNull]: {System.DBNull}
?ROW.TF_EXEMPT
" TEST"

为什么有2个不同的值?我把测试在NullValue属性和
它的工作方式应该如此但为什么它有2个不同的值看起来
两个命令应该指向同一个位置?

Jerry H "写道:
For Each _dr In oDsTXLIBR.TXFP3003
Console.Write(_dr.TF_EXEMPT)
Next

*** Command-Immediate Window ***
?oDsTXLIBR.Tables("TXFP3003").Rows(0)("TF_EXEMPT")
{System.DBNull}
[System.DBNull]: {System.DBNull}
?ROW.TF_EXEMPT
"TEST"
Why are there 2 different values? I put "TEST" in the NullValue property and
it worked like it should but why are there 2 different values where it looks
both commands should be pointed to the same location?

"Jerry H." wrote:
对于每个数据表,您应该能够设置
字段的默认值,并设置一个值,如果该字段为空,则返回。<你有没有尝试过使用这些属性??
For each Datatable, you should be able to set the Default value of your
fields, and also set a value that is returned if the field is Null.
Have you tried using those properties.?



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

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