473,508 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set field to dbnull??

In the following code the line: row("OrderDate") = DBNull is invalid. But,
how can I set the field to DBNull?

Thanks,

Gary

daClearOrders.Fill(DsClearOrders1)

Dim row As DataRow

For Each row In DsClearOrders1.Inventory.Rows

row("QuantityOrdered") = 0

row("OrderDate") = DBNull (this doesn't work)

Next

daClearOrders.Update(DsClearOrders1)
Nov 18 '05 #1
1 2580
Hi Gary,

Try assigning DBNull.Value instead of DBNull.

Harold

"Gary" <Ga**@nospam.com> wrote in message
news:et*************@tk2msftngp13.phx.gbl...
In the following code the line: row("OrderDate") = DBNull is invalid. But, how can I set the field to DBNull?

Thanks,

Gary

daClearOrders.Fill(DsClearOrders1)

Dim row As DataRow

For Each row In DsClearOrders1.Inventory.Rows

row("QuantityOrdered") = 0

row("OrderDate") = DBNull (this doesn't work)

Next

daClearOrders.Update(DsClearOrders1)

Nov 18 '05 #2

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

Similar topics

6
16246
by: FatboyCanteen | last post by:
When I using dataset to append a null value to the datetime field. It throw a error -> can not convert db.null to system.date Can there is any standard to pass a Null value to the DateTime...
1
315
by: Gary | last post by:
In the following code the line: row("OrderDate") = DBNull is invalid. But, how can I set the field to DBNull? Thanks, Gary daClearOrders.Fill(DsClearOrders1) Dim row As DataRow
3
3007
by: Joachim | last post by:
Hi I am a beginner in VB.NET, and have a problem with empty field in Access I have transfered a worksheet in Excel to Access table. Some of the cels are empty I use VB.NET program to acces...
4
14905
by: Dursun | last post by:
Hi, I am trying to assign NULL to a datetime field in the SQL Server database. Here is the code that does NOT work: INSERT INTO ... .... VALUES ... .... CType(IIf(dateWitness2Date.Checked,...
2
2806
by: Neo | last post by:
I have a table Contacts with a field "Male" which is of type Bit (SQL Server). I've got two radio buttons in a panel, & one of them is bound to the above field, (so that one can see if the...
2
6987
by: mPiccoli | last post by:
how I can a Guid field on Null setting (DATASET)
2
2926
by: Julian | last post by:
I have the following code: Dim strQuery As String = "SELECT tblData.CoPayFundGrant, tblData.M_DSS_SSA_Benefits, tblData.O_DSS_SSA_Benefits, " & _ "tblData.Ref_MPS, tblData.Ref_LA,...
3
6278
by: Finn Stampe Mikkelsen | last post by:
Hi I have defined a table in my database, with 2 date-fields. I have set a default value to DBNull. I have integrated a nullable datetimepicker control to my project and set the apropriate...
1
31316
by: Brad Pears | last post by:
I am using vb.net 2005 and SQL server 2000. In my table I have a date field of type "smalldatetime". In my vb application, the user may or may not enter a date value into the appropriate text box....
0
7227
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,...
0
5633
agi2029
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 project—planning, coding, testing,...
1
5056
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...
0
4713
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...
0
3204
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...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.