Null not support by .net?

S

Sam

I want to control textbox where if textbox is not empty process ADO.NET

If TextBox_Account.Text is not null then
Dim con As New
SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim cmd As New SqlCommand()
cmd.CommandText = "Select * from Info where ID = " &
TextBox_Account.Text"
cmd.Connection = con
end if

However, null does not support in .Net and advise to use system.dbnull.

Please advise how to use null in asp.net
 
L

Lau Lei Cheong

And for Visual Basic/vbscript, you should check for Nothing instead of null
in most case.
null is defined in other languages such as C++, C#, J#, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,235
Latest member
Top Crypto Podcasts_

Latest Threads

Top