473,748 Members | 10,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Typed DataSet string and null value

hi there,
has anyone come across this?

i've a typed dataset with a table and a column of type string.
I want to insert a new row and for some reason i keep getting "Null" in my
dataset.

take a simple exply of person
Name:string
Comment:string
age:int
so i create a new row
PersonRow newRow = ds.PersonTable. NewPersonRow();
then i set the values
newRow.Name = "brian";
newRow.Age = 29;
newRow.Comment = null;
newRow.SetComme ntNull();

ds.PersonTable. Add(newRow);

......BUT it has added the string "Null" to my row not the Value null

Can anyone explain this? or offer a solution?

thanks in advance

Nov 17 '05 #1
1 1673
My database containted the "Null" dough!

"Brian Keating" wrote:
hi there,
has anyone come across this?

i've a typed dataset with a table and a column of type string.
I want to insert a new row and for some reason i keep getting "Null" in my
dataset.

take a simple exply of person
Name:string
Comment:string
age:int
so i create a new row
PersonRow newRow = ds.PersonTable. NewPersonRow();
then i set the values
newRow.Name = "brian";
newRow.Age = 29;
newRow.Comment = null;
newRow.SetComme ntNull();

ds.PersonTable. Add(newRow);

.....BUT it has added the string "Null" to my row not the Value null

Can anyone explain this? or offer a solution?

thanks in advance

Nov 17 '05 #2

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

Similar topics

2
403
by: Vaap | last post by:
I am trying to get dataset working through IDbDataAdapter interface as my solution need to work with Sql Server and Oracle ODP. I am using different data provider factories and the code here only shows SQL Server. My code snippets are // Build the interface in provider factory (_pf in code below) public IDbDataAdapter CreateDataAdapter() {
5
7470
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 invented to make life easier, to be able to get to tge Tables and Values with less code, in less time? But with this thing you need to add a Try-Catch around every statement when using the value, add for each value a default value in your DataSet (and...
6
1721
by: Kiran | last post by:
Hi, I am using typed dataset for Employees Table and found a problem, can anyone tell me what's wrong Case 1: Employees Table: ID: int,Not Null,Idendity, Primary col Name:varchar(20),Not Null Type: Varchar(5), Null(Allowed)
1
1123
by: Li Weng | last post by:
Hi, I just installed Visual Studio 2005. In VS 2003, if a field's NullValue in a data table is set to -1, I can assign it -1 in code as NULL value. But in VS 2005, look like the data table doesn't take -1 as NULL value although property NullValue = -1. it takes it as a normal value and check table relationship to see if it's in primary key table. I saw in 2005 property DefaultValue is set to <DBNull>. I don't care this
0
4536
by: Mateusz [PEYN] Adamus | last post by:
Hi I have a Typed DataSet. I've databinded it to some text controls on my form, controls show data when I show record. But now I would like to create a new record with this form, controls and dataset. A add new row to dataset: <C#>
7
1800
by: Bob | last post by:
Hi, I have a typed unbound dataset that is passed to a datahandling class to be filled. The datahandling class fills it from a sproc using an oledbDataAdapter (SQLAnywhere database) The only table in the dataset has two int32 columns. There is one row of data and as expected, column 0 contains an int and column 1 contains a null. I want to update column1. The following code executes but the row cell remains unchanged.
5
3132
by: John | last post by:
Hi, I am developing a windows app using C# 2005. This app uses SQL Server or Oracle database depending on the what the user is using. Can I create one typed dataset and use it for SQL Server and Oracle? Probably not. How can I structure my data access layer so the app will be switching easily between those two databases with a locally stored db connection string? How about the following? Thanks for your suggestions.
5
3063
by: =?Utf-8?B?UlBhcmtlcg==?= | last post by:
I used the wizard to generate a typed dataset for my table and let it create my SPROCs. It created everything, and the GetData() method and the custom GetByUserName query works great, but when I try to call the Update() method of my TableAdapter, I get the following: "Procedure 'stp_SecurityUsers_Update' expects parameter '@userName', which was not supplied."
0
1129
by: =?Utf-8?B?UGFvbG8=?= | last post by:
Using a typed Dataset. From debugging I can see that each dataset.<tableis filled with the correct data (see ###) cmbxPayee DisplayMember, ValueMember and DataSource each show the expected values (see <---) cmbxCategory DisplayMember and ValueMember show expected values but DataSource shows null (see ***)
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.