G
Guest
Hello:
I am using 2 datagrid in a master-detail, now if I want delete a record in
master, I should delete all child record of this master record before I
delete the master.
I don't know how to run mutiple SQL statement in my custom OleDbCommand?
I really appreciate your help.
here is the code:
Dim cmdDelete As New OleDbCommand("DELETE FROM detail WHERE id = ?",
_myUtilDB.irraConnection)
'Dim cmdDelete As New OleDbCommand("DELETE FROM master WHERE id =
?", _myUtilDB.irraConnection)
With cmdDelete.Parameters.Add("@p1", GetType(Double))
.SourceColumn = "id"
.SourceVersion = DataRowVersion.Original
End With
_da.DeleteCommand = cmdDelete
I am using 2 datagrid in a master-detail, now if I want delete a record in
master, I should delete all child record of this master record before I
delete the master.
I don't know how to run mutiple SQL statement in my custom OleDbCommand?
I really appreciate your help.
here is the code:
Dim cmdDelete As New OleDbCommand("DELETE FROM detail WHERE id = ?",
_myUtilDB.irraConnection)
'Dim cmdDelete As New OleDbCommand("DELETE FROM master WHERE id =
?", _myUtilDB.irraConnection)
With cmdDelete.Parameters.Add("@p1", GetType(Double))
.SourceColumn = "id"
.SourceVersion = DataRowVersion.Original
End With
_da.DeleteCommand = cmdDelete