473,394 Members | 1,700 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,394 software developers and data experts.

is nothing in C#

In VB.NET we set object to Nothing. What do i do in C# to achive the same
thing?
Oct 30 '07 #1
3 3100
Shashi Sadasivan
1,435 Expert 1GB
In VB.NET we set object to Nothing. What do i do in C# to achive the same
thing?
Well, i struggled the other way around.
All major languages define nothing as null, and vb defines nothing as nothing....
so C# its null (all in lowercase)
cheers :)
Oct 30 '07 #2
In VB.NET we set object to Nothing. What do i do in C# to achive the same
thing?
if i try the code
if (File1.PostedFile is null)

it gives an error
Cannot implicitly convert type 'string' to 'System.Web.HttpPostedFile'
Oct 30 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
In VB.NET we set object to Nothing. What do i do in C# to achive the same
thing?
if i try the code
if (File1.PostedFile is null)

it gives an error
Cannot implicitly convert type 'string' to 'System.Web.HttpPostedFile'
Expand|Select|Wrap|Line Numbers
  1. if (File1.PostedFile == null) {
  2. //your if statement code goes here
  3. }
Oct 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

96
by: BadPony | last post by:
Anyone using Peoplesoft on a Federated UDB (shared nothing)Environment on Open System Platforms? Preferably AIX, but any war stories would be good. TEA EB-C
24
by: Hardy | last post by:
I'm pretty new in this field. when reading some 70x material, I met with this term but cannot catch its accurate meaning. who can help me? thanks in advance:)~
6
by: Bob Day | last post by:
VS 2003 The documentation says " Nothing keyword represents the default value of any data type" this is simply not true and causing a lot of problems. 1) Consider an SQL table of 3 columns: ...
26
by: Bob Day | last post by:
VS 2003, vb.net, sql native (MSDE)... I have railed against the inconsistency of the Nothing key word. The documentation says is will assign a default value for any datatype...well, not...
4
by: David Schwartz | last post by:
Seems that setting an object = Nothing no longer does anything in .NET. Garbage collection destroys the object eventually. So, does it ever make sense to set an object = Nothing in .NET? Thanks.
5
by: John A Grandy | last post by:
do these mean the same thing ? Dim s As String ..... If s Is Nothing Then ..... If s = Nothing Then .....
8
by: Tiraman | last post by:
Hi , i would like to get some explanation about using the Obj = Nothing . For example , I have a function that hold a local object like in this example public function Test() dim objMyCol...
12
by: Mike Eaton | last post by:
Hi all, What do people regard as the best practice with respect to freeing object references when you're done with them? Some people I've worked with in the past suggested that if you create an...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
6
by: DippyDog | last post by:
This is an old old post that I'm referencing regarding what happens when you set an integer variable to Nothing. It gets set to zero, not "Nothing." ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.