mmosoul
asked on
move row from one bound datagrid to another
I have 2 data grids bound to an access database with binding sources and navigators. The main data has an auto generated number for the index. The archive data has the index set to number. I want to use the same number from the main data because that is the unique ID for that information. When I try to copy the row to the archive and delete it from the main I get an error that the index column can't contain a null value when trying to update the archived data. The ID column has the number from the main data in the cell so this is very confusing. The archive has additional columns in it for dates so it's not a direct copy of the row but all of the information is in the cells before it tries to save.
ASKER
How do I look at the insert command? It's bound data with a navigator. I press the add row button, enter the data then press the save button. I don't pass it any insert commands or anything.
Save button:
Save button:
If Me.Validate() = True Then
Me.PoarchiveBindingSource.EndEdit()
Me.PoarchiveTableAdapter.Update(Me.PolistDataSet.poarchive)
End If
If you have used the wizards to create a binding datasource you (most likely, there are several different ways) may have created a dataset, so in your solution explorer you may have 'DatabaseNameDataSet.xsd'?
If so, expand that and you'll see 'DatabaseNameDataSet.Designer.cs' if you open that and look at InitAdapter, specifically the line the starts:
this._adapter.InsertComman d.CommandT ext = @"INSERT INTO
you should see your insert command and below the parameters that are getting passed to it.
P.S I'm making a lot of assumptions as to how you have set this up... please let me know if I'm wrong.
If so, expand that and you'll see 'DatabaseNameDataSet.Designer.cs' if you open that and look at InitAdapter, specifically the line the starts:
this._adapter.InsertComman
you should see your insert command and below the parameters that are getting passed to it.
P.S I'm making a lot of assumptions as to how you have set this up... please let me know if I'm wrong.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hope that helps