imranmp

I am new to this so pardon my ignorance :)

I have two tables with inner join displaying a bunch of feilds in a datagrid... i am able to view, edit and save the values from the datagrid.

heres the sql statement

SELECT tblInspectionItems.InspItem_CategoryID, tblInspectionItems.InspItem_Name, tblInspectionDetails.InspectDtl_Condition, tblInspectionDetails.InspectDtl_Notes, tblInspectionDetails.InspectDtl_InspID, tblInspectionDetails.InspectDtl_InspItemID, tblInspectionItems.InspItem_SortOrder
FROM tblInspectionItems INNER JOIN tblInspectionDetails ON tblInspectionItems.InspItem_ID = tblInspectionDetails.InspectDtl_InspItemID
WHERE (tblInspectionDetails.InspectDtl_InspID = @InspID) AND (tblInspectionItems.InspItem_Active = 1)

i then needed a checkbox in the table tblInspectionDetails so i added the checkbox field (InspectDtl_Active) and also added the checkbox to the datagrid binding it to the field in the tblInspectionDetails

now i am trying to edit and save the info form the datagrid but am having a problem saving the checkbox value, and if i add tblInspectionDetails.InspectDtl_Active to the above SELECT statement then i am getting an error during build
"Error 3 'Update' is not a member of 'AAM.InspectionDataSetTableAdapters.ItemDetailsTableAdapter'.

i dont understand why i am getting this error; please help

thanks



Re: Windows Forms Data Controls and Databinding Error on trying to Update data grid

hrubesh

when having more than one table in a select statement,(joins) then you should manually update each table.

tblInspectionItems - use its adapter and update it with the id of the record, and using the changed values.

tblInspectionDetails - same.






Re: Windows Forms Data Controls and Databinding Error on trying to Update data grid

imranmp

This is how I update my table and reload data into the grid

Me.ItemDetailsBindingSource.EndEdit()
Me.ItemDetailsTableAdapter.Update(Me.InspectionDataSet.ItemDetails)
Me.ItemDetailsTableAdapter.Fill(Me.InspectionDataSet.ItemDetails, Properties.SelectedInspID)

the three main things that are being edited are the condition (tblInspectionDetails.InspectDtl_Condition), notes (tblInspectionDetails.InspectDtl_Notes), and the checkbox (tblInspectionDetails.InspectDtl_Active)

what i am having a hrad time understanding is that the sql statement below works fine and updates the condition and notes but it doesnt update the checkbox field and when i add tblInspectionDetails.InspectDtl_Active to the SELECT statment i get the error "Error 3 'Update' is not a member of 'AAM.InspectionDataSetTableAdapters.ItemDetailsTableAdapter'.

imranmp wrote:

SELECT tblInspectionItems.InspItem_CategoryID, tblInspectionItems.InspItem_Name, tblInspectionDetails.InspectDtl_Condition, tblInspectionDetails.InspectDtl_Notes, tblInspectionDetails.InspectDtl_InspID, tblInspectionDetails.InspectDtl_InspItemID, tblInspectionItems.InspItem_SortOrder
FROM tblInspectionItems INNER JOIN tblInspectionDetails ON tblInspectionItems.InspItem_ID = tblInspectionDetails.InspectDtl_InspItemID
WHERE (tblInspectionDetails.InspectDtl_InspID = @InspID) AND (tblInspectionItems.InspItem_Active = 1)

if i have to update the two tables separately then how come it works when i dont have the checkbox field (tblInspectionDetails.InspectDtl_Active) in the SELECT statement