|
-
Jan 31st, 2007, 08:16 AM
#1
Thread Starter
Lively Member
In VB.NET is there a SQL IsNull(value,valueifNull) or Access NZ Type Function
Hi Guys,
In VB.NET is there a
SQL IsNull(value,valueifNull) or
Access NZ Type Function
ie if an object or a string value is null you can give it a default value using a function
eg
If IsNull(me.txtname.text,"Blank") = "Blank" Then
msgbox "Please enter name"
end if
Thanks
Rag
-
Jan 31st, 2007, 08:59 AM
#2
Re: In VB.NET is there a SQL IsNull(value,valueifNull) or Access NZ Type Function
Hi. there a sample on how to check sql null.
VB Code:
con.ConnectionString = constring
con.Open()
com.Connection = con
com.CommandType = CommandType.Text
com.CommandText = "select codigo from armazem where codigo ='" & artigo & "'"
reader = com.ExecuteReader
While reader.Read
If TypeOf reader(0) Is DBNull Then
existe = False
Else
existe = True
End If
End While
reader.Close()
con.Close()
"The dark side clouds everything. Impossible to see the future is."
-
Jan 31st, 2007, 09:22 AM
#3
Addicted Member
Re: In VB.NET is there a SQL IsNull(value,valueifNull) or Access NZ Type Function
-
Jan 31st, 2007, 10:48 AM
#4
Thread Starter
Lively Member
Re: In VB.NET is there a SQL IsNull(value,valueifNull) or Access NZ Type Function
Thanks guys,
so in .net u have to distinguish between
a DB null and Null assigned to a VB variable because it hasnt been initiated?
-
Jan 31st, 2007, 10:51 AM
#5
Re: In VB.NET is there a SQL IsNull(value,valueifNull) or Access NZ Type Function
 Originally Posted by ragstta
Thanks guys,
so in .net u have to distinguish between
a DB null and Null assigned to a VB variable because it hasnt been initiated?
corect
"The dark side clouds everything. Impossible to see the future is."
-
Jan 31st, 2007, 10:53 AM
#6
Addicted Member
Re: In VB.NET is there a SQL IsNull(value,valueifNull) or Access NZ Type Function
You got Nullable, Nothing and DBNull dont know if there are more ;P
more info
Last edited by figa; Jan 31st, 2007 at 10:58 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|