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.comwww.prenia.comWeblog: blogs.prenia.com/cathi