Deleted in DataSet not in DB


Well-known member
Jan 12, 2005
Programming Experience
im having trouble deleting records in my database.. i just started using
i was successful in deleting rows in datasets.. my problem is that i want to delete the records also... i've used oledbcommands... command adapters but sadly i am yet to succeed in deleting the rows that i have deleted in the dataset in the database... hope you guys can help..

tnx dude, sadly it didnt work...
i was able to catch some errors though but the deletion did happen...
i already had this line on my code...
dataadapter.update(dataset, "tablename")

anyways thnx for the help... if you come up with any suggestions i would love to here 'em...
Sub DelUser(ByVal IDstr As String, ByVal DSet As DataSet)

Dim DelPrm As OleDb.OleDbParameter

Dim DelCom As New OleDbCommand

DelCom.CommandText = ("delete from users where userid='" & Trim(IDstr) & "'")

DelCom.Connection = XConn


'DelPrm = DelCom.Parameters.Add("@UID", IDstr)

'DelPrm.SourceVersion = DataRowVersion.Original

MyAdpUser = Nothing

MyAdpUser = New OleDbDataAdapter

MyAdpUser.DeleteCommand = DelCom



MyAdpUser.Update(MyDstUser, "Users")

Catch ex As Exception


End Try

this isnt working...

i have also tried using parameters... still didnt work...

im hoping there's still another approach that i could use...
im kinda stuck, in this part of my study...

cjaymcmeans said:
DelSet.Tables("Users").GetChanges(DataRowState.Deleted).Rows.Count =nothing

u r Dataadpter with Delete Only Those records for which RowState is mark as Deleted................But as said U r getting Value nothing that means ur rowstate has been Reseted(might be...............)

i would be better if u send be message at so it will be convinient to track the problem...........


Latest posts