eladreznik 0 Newbie Poster

I am trying to delete a row and update the database, i wrote the code, but it results in an error:

Dynamic SQL generation for the updatecommand is not supported against a selectcommand that does not return and key column information.

the SQL table contains a primary key, any idea ?

grdAccountTypes.Rows.Remove(grdAccountTypes.CurrentRow)
dataAdapter.Update(CType(Me.bindingSource1.DataSource, DataTable))
bindingSource1.DataSource.AccountTypse.acceptchanges()
MessageBox.Show("Update successful")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.