Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > set field to dbnull??

Reply
Thread Tools

set field to dbnull??

 
 
Gary
Guest
Posts: n/a
 
      04-03-2004
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)


 
Reply With Quote
 
 
 
 
Harold Hsu
Guest
Posts: n/a
 
      04-03-2004
Hi Gary,

Try assigning DBNull.Value instead of DBNull.

Harold

"Gary" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
how to show an Image field from a SQL Server table field to a aspx page J Sahoo ASP .Net 3 04-30-2009 08:30 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
Validating a field based on value of another field Emmanuel ASP .Net 1 11-22-2005 12:35 PM
Placing the selection of a list field in a text field Jerry Manner HTML 5 06-09-2005 01:52 PM



Advertisments