Bryan Posted April 25, 2004 Posted April 25, 2004 I am having trouble using the IsNull() function in VB.net. Here the line of code: If Not IsNull(TextBox1.Text) Then End If it tells me that IsNull is not declared, do I have to use an inherits system.??? to be able to use the IsNull() function? Quote
Administrators PlausiblyDamp Posted April 25, 2004 Administrators Posted April 25, 2004 If you are checking if the textbox is empty you can check for an empty string if TextBox1.Text <> String.Empty Then End IF If you are checking if a variable is null the nunder vb check for nothing dim o as object if o is nothing then end if Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
georgepatotk Posted April 25, 2004 Posted April 25, 2004 If Not TextBox1.Text IS system.dbnull.value Then End If Quote George C.K. Low
Bryan Posted April 25, 2004 Author Posted April 25, 2004 If you are checking if the textbox is empty you can check for an empty string if TextBox1.Text <> String.Empty Then End IF If you are checking if a variable is null the nunder vb check for nothing dim o as object if o is nothing then end if yes, but what about the IsNull function. I'd like to use that, i've used it before, but it's been a while and I'd like to know how to use it. Quote
Administrators PlausiblyDamp Posted April 25, 2004 Administrators Posted April 25, 2004 IIRC IsNull is no longer supported in VB.Net - the nearest equivalent is DbNull as georgepatotk suggested in the post above. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.