G
Guest
I have 2 datagrids, dg1 and dg2, both attached to different tables. The application is for something like an order entry system, where all available items are in dg2, and a user can either dbl click or hit a button to copy the selected row from dg2 to dg1.
I can set up a DataRow and set the values for each cell manually and insert into dg1, but for some reason cannot figure out how to extract the values from dg2 to put into that DataRow for insertion.
Here is my current code:
Dim key As String = Me.DataGridView2.SelectedCells.Item(1).RowIndex
ItemOrdered = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemName()
ItemType = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemType()
ItemPrice = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemPrice()
ItemTranslation = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemTranslation()
When I run this, it throws a "StrongTyping_CannotAccessDBNull"
Does anyone know what that means?
I can set up a DataRow and set the values for each cell manually and insert into dg1, but for some reason cannot figure out how to extract the values from dg2 to put into that DataRow for insertion.
Here is my current code:
Dim key As String = Me.DataGridView2.SelectedCells.Item(1).RowIndex
ItemOrdered = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemName()
ItemType = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemType()
ItemPrice = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemPrice()
ItemTranslation = Me.SNDBDataSet.Menu.FindByMenuItemID(key).MenuItemTranslation()
When I run this, it throws a "StrongTyping_CannotAccessDBNull"
Does anyone know what that means?