Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null Dates
Message
 
To
13/08/2003 11:36:33
Mindy Shingara
Central Susquehanna Intermediate Unit
Lewisburg, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
WebForms
Title:
Miscellaneous
Thread ID:
00811250
Message ID:
00819996
Views:
20
Mindy,

Try separating out the dimming of the dr variable outside of the For/Next loop:
Dim dr As DataRow
Dim dtFoxProNull As DateTime = DateTime.Parse("12/10/1899")
For Each dr In DSfatrans.Tables("fatrans").Rows
    If (DateTime.Parse(dr("tr_chkdate").ToString()) = dtFoxProNull) Then
        dr("tr_chkdate") = DBNull.Value
    End If
Next
DSfatrans.AcceptChanges()
Also try removing all the code inside the For/Next to make sure there isn't a problem with that section.

>Hi Cathi!
>I am using the exact chunk of code that you had suggested I try. For some reason, I am now getting the "Object variable or With Block variable not set" error. When I look at the code, I see exactly what it should be doing, but not sure why it's not. I can't step through it because it blows up on the ForEach dr As DataRow... line. My dataset and table are defined correctly and I have data. What else can I do or how else can I debug this error? Your help is greatly appreciated by all of us at the CSIU!!!
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform