PC Review


Reply
Thread Tools Rate Thread

another delete prob.

 
 
Marc Miller
Guest
Posts: n/a
 
      21st Feb 2005
I've read other posts concerning unsuccessful deletes, but I can't find
anything that tells me what is wrong
with my code. After I delete() the row in the dataset, the dataset is empty
and I get 0 as the value for
my 'isDel' variable. What am I doing that I shouldn't be doing, or
vice-a-versa?

Thanks for any help,
Marc Miller

Dim sr As New StringReader(CStr(viewstate("dsbldgdata1")))

DsBldgData1.ReadXml(sr)

..DsBldgData1.Tables("Profile").Rows(0).Delete()

SqlConnection1.Open()


Dim iDel As Integer

Try

iDel = SqlDataAdapter1.Update(Me.DsBldgData1, "Profile")

Catch ex As Exception

errWindowShow(ex.message)

Finally

SqlConnection1.Close()

End Try


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd Feb 2005
Marc,

How did you create the rows in the dataset.

I ask this because when you did not do that from the original database table
(where you than did not use the option to avoid setting to unchanged), than
you have to do before the deletes an accept.changes.

The delete works as follows.
When the row state is "inserted" it will remove the row from the dataset.
In other situations it sets the rowstate to "deleted".

With the acceptchanges you change the new state to "unchanged".

I hope this helps,

Cor


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Re: can't access shared files--ZA prob--Update prob? PA Bear [MS MVP] Windows XP General 0 11th Jul 2009 05:33 PM
Thunderbird prob may be a Windows prob Thunderbird Windows XP General 9 11th Jul 2008 11:44 AM
2 Questions: Cursor prob and Monitor prob Purple Shrub Support 1 28th Jan 2007 10:14 PM
another delete prob. Marc Miller Microsoft ADO .NET 2 22nd Feb 2005 04:21 PM
another delete prob. Marc Miller Microsoft ADO .NET 2 21st Feb 2005 07:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:16 AM.