473,324 Members | 2,214 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,324 software developers and data experts.

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 2570
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
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
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
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
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
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
by: mPiccoli | last post by:
how I can a Guid field on Null setting (DATASET)
2
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
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
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.