Convertion from vb6 to vb.net
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vb.

Post a new message to this list...

ReidarT
I have an application in vb6 converted to vb.net
During debugging it stops at the folloewing code

If RsORDRE.Fields("Kommentar").Value <> "" Then
strKommentar = RsORDRE.Fields("Kommentar").Value
Else
strKommentar = ""
End If

The error is <>"" where Kommentar is a varchar field in the database
regards
reidarT

Reply to this message...
 
    
Cor Ligthert
Reidar,

Are you sure it is not a DBNull.value?
What is mostly the problem in this kind of code.
(Not that I still know much about AdoDb)

Cor

"ReidarT" <Click here to reveal e-mail address>
[Original message clipped]

Reply to this message...
 
    
ReidarT
It is a DBNull if that means there is no data in this field for this record
How can I ommit the problem?
reidarT
"Cor Ligthert" <Click here to reveal e-mail address> skrev i melding
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Cor Ligthert
Reidar,

Probably, (I did not (do as I wrote) much AdoDb last times)

If RsORDRE.Fields("Kommentar").Value Is DbNull.value then

I hope this helps?

Cor

"ReidarT" <Click here to reveal e-mail address>
..
> It is a DBNull if that means there is no data in this field for this
record
[Original message clipped]

Reply to this message...
 
    
ReidarT
Thanks alot
Reidar
"Cor Ligthert" <Click here to reveal e-mail address> skrev i melding
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.DBNull




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com