Hi all,
In java, if a field is Integer type, we can assign it to null indicating
that this field has not been set yet. How can we achieve that in C#? In C#,
"int" is struct, we cannot set it to null. Thank you
zlf 3 1186
If you're using version 2.0, google "Nullable Types". And int is not
exactly a struct, it's a value-type, where structs are also
value-types.
zlfcn wrote:
Hi all,
In java, if a field is Integer type, we can assign it to null indicating
that this field has not been set yet. How can we achieve that in C#? In C#,
"int" is struct, we cannot set it to null. Thank you
zlf
If your not in .NET 2, I used to use int.minvalue as null equivilent.
It does need converting to put it in a db though.
Ciaran O'Donnell
"zlfcn" wrote:
Hi all,
In java, if a field is Integer type, we can assign it to null indicating
that this field has not been set yet. How can we achieve that in C#? In C#,
"int" is struct, we cannot set it to null. Thank you
zlf This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Chris Uwins |
last post by:
Hi there, i know theres a number of ways I can achieve this but want
to know the best, (but still quite simple).
Up until a year ago I never used Access but have designed a few
databases for...
|
by: MLH |
last post by:
I have a number of reports that are essentially black 'n
white prepared forms (picture an IRS form 1040). The
data fields are overlaid onto the report fields in the
correct positions and I would...
|
by: Karl |
last post by:
Hi,
In SQL server, I created a Person table with a spouseID field, which refers
to PersonID as the foreign key. It is like this:
PersonID (primary key),
PersonName,
SpouseID (foreign key refer...
|
by: Dennis |
last post by:
I use the following code for a strongly typed arraylist and it works great.
However, I was wondering if this is the proper way to do it. I realize that
if I want to implement sorting of the...
|
by: DraguVaso |
last post by:
Hi,
Something I don't understand about a Typed DataSet: When a value in the
DataSet is DBNull, it throws this error: "Cannot get value because it is
DBNull".
But aren't Typed DataSets...
|
by: Xah Lee |
last post by:
in March, i posted a essay “What is Expressiveness in a Computer
Language”, archived at:
http://xahlee.org/perl-python/what_is_expresiveness.html
I was informed then that there is a academic...
|
by: Scott_from_Carematic |
last post by:
I'm trying to use a strongly typed dataset in my asp.net (2.0) project with
visual studio 2005. I have generated the dataset and tableadapters in the
designer. I'm using SQL server EE 2005 as the...
|
by: dave |
last post by:
I am having trouble accessing a property set during run-time in a user
control that I have built. The control is supposed to connect to a
database using the path supplied by the developer at...
|
by: =?Utf-8?B?RGF2ZSBU?= |
last post by:
I have a list box that is bound to an object data source. I added a column,
say ColumnC, to my typed data set (using the designer) and for the expression
property I entered
ColumnA + ': ' +...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
| |