HighTechTalks DotNet Forums  

Error when deleting last record

Dotnet VSA microsoft.public.dotnet.vsa


Discuss Error when deleting last record in the Dotnet VSA forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bronislav
 
Posts: n/a

Default Error when deleting last record - 11-29-2004 , 04:03 PM






I have an error when I try to delete last record in the record set. The code
I'm using is:
lcurrow = Me.BindingContext(DsTextProdMain,
"TextProductsMain").Current
lcurrow.Delete()
This code works for all records in the recordset except last one. But if
recordset contains only one record the code works fine. The error is coming
out only in 2003 version, 2002 version works fine. I'm using ADO.net

The system give me a not understandable error.

An unhandled exception of type 'System.NullReferenceException' occurred in
system.data.dll

Additional information: Object reference not set to an instance of an object.

Has somebody met this behabior?


Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: Error when deleting last record - 12-20-2004 , 11:12 AM






in article 15E59E98-0AD4-459A-92C9-197EBABB5404...soft (DOT) com, Bronislav at
Bronislav (AT) discussions (DOT) microsoft.com wrote on 11/29/04 5:03 PM:

Quote:
I have an error when I try to delete last record in the record set. The code
I'm using is:
lcurrow = Me.BindingContext(DsTextProdMain,
"TextProductsMain").Current
lcurrow.Delete()
This code works for all records in the recordset except last one. But if
recordset contains only one record the code works fine. The error is coming
out only in 2003 version, 2002 version works fine. I'm using ADO.net

The system give me a not understandable error.

An unhandled exception of type 'System.NullReferenceException' occurred in
system.data.dll

Additional information: Object reference not set to an instance of an object.

Has somebody met this behabior?



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.