473,382 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Null not support by .net?

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("C onnectionString"))
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
Nov 19 '05 #1
2 1007
No. It will never be null.

Check for the an empty string.

If TextBox_Account.Text <> String.Empty Then
.....
End If

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #2
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.

"MasterGaurav" <ga**********@gmail.com> ???
news:11**********************@z14g2000cwz.googlegr oups.com ???...
No. It will never be null.

Check for the an empty string.

If TextBox_Account.Text <> String.Empty Then
....
End If

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

102
by: junky_fellow | last post by:
Can 0x0 be a valid virtual address in the address space of an application ? If it is valid, then the location pointed by a NULL pointer is also valid and application should not receive "SIGSEGV"...
4
by: Peter Hemmingsen | last post by:
Hi, I have a dotnet object (implemented in mc++ and used in c#) which have a property called "Info". The Info property is also a dotnet object (implemented in mc++). In the constructor of the...
10
by: Jason Collins | last post by:
There are some Requests that occur that have a NULL UserAgent. Some of these are legitimate crawlers (e.g., Overture's crawler), and I'm attempting to adjust my <browserCaps> to correctly classify...
7
by: Mirek Endys | last post by:
Hello, the problem I have now, is: Im binding generic collection based on List<iDB2SQLTransferItem> // iDB2SQLTransferItem is my class // into WebCOntrol DataList. But the DataItem of the...
13
by: Federico Balbi | last post by:
Hi, I was wondering if PGSQL has a function similar to binary_checksum() of MS SQL Server 2000. It is pretty handy when it comes to compare rows of data instead of having to write long boolean...
7
by: TS | last post by:
I get this message in the window "cannot assign 'null' into 'xxxxx'". this is an object and hence a reference type. Sometimes this isn't permitted...why? thanks
4
by: Laurahn | last post by:
How can i send from VB 2005 a null value to a image field on a database in SQL 2005
9
by: Christopher | last post by:
If a method is declared to return a type boost::shared_ptr<sometype>, how can the method be changed to do the equivalent of returning NULL when it was declared to return a raw pointer?
11
by: coomberjones | last post by:
I have a few std::strings that I am using to store raw binary data, each of which may very well include null bytes at any point or points. I want to slap them together into a single string, so I...
4
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.