What am I missing?When I try to delete the first record (and only the first record) in my PostgreSQL DB, I get an error that says:
An unhandled exception of type 'System.Data.DeletedRowInaccessibleException' occurred in system.data.dll
Additional information: Deleted row information cannot be accessed through the row.
VB Code:
'Public declarations Dim con As New Odbc.OdbcConnection Dim ds As New DataSet Dim da As Odbc.OdbcDataAdapter Dim sql As String Dim inc As Integer Dim maxrows As Integer 'Form Load Private Sub PartsManager_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = [LONG ODBC CONNECTION STRING IS HERE] con.Open() sql = "SELECT * FROM customer ORDER BY customername ASC;" da = New Odbc.OdbcDataAdapter(sql, con) da.Fill(ds, "customer") maxrows = ds.Tables("Customer").Rows.Count inc = 0 NavigateRecords() 'References another sub that tells where to put what, basically End Sub 'The Delete button code Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim cb As New Odbc.OdbcCommandBuilder(da) ds.Tables("customer").Rows(inc).Delete() maxrows = maxrows - 1 inc = 0 NavigateRecords() da.Update(ds, "customer") End Sub
Thanks in advance...Let me know if there's something else you need.
CP




When I try to delete the first record (and only the first record) in my PostgreSQL DB, I get an error that says:
Reply With Quote