问题描述
我正在使用datareader(dr1)来读取查询返回的行。我收到了错误:行/列没有数据。在如果
IsDbNull ......在下面的代码中。字段Photo1确实存在并且在一些
行中它是null,在其他行中它可能是一个空字符串而在其他行中它可能
有一个文件名。我不知道系统究竟抱怨什么
关于这里?
Wayne
== ========= code ============
如果是IsDBNull(dr1.Item(" Photo2"))那么
txtPhoto2.Text =""
Else
txtPhoto2.Text = dr1.Item(" Photo2" ;)
结束如果
I am using a datareader (dr1) to read through rows returned from a query. I
am getting the error: "No data exists for the row/column." at the "If
IsDbNull..." in the code below. The field "Photo1" does exist and in some
rows it is null, in others it may be an empty string and in others it may
have a file name. I don''t understand exactly what the system is complaining
about here?
Wayne
=========== code ============
If IsDBNull(dr1.Item("Photo2")) Then
txtPhoto2.Text = ""
Else
txtPhoto2.Text = dr1.Item("Photo2")
End If
这篇关于不明白这个错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!