June 3rd, 2013, 08:07 PM
How To Save Data From DataGridView bound to one datasource to aTableadapter
I have a dataGridView that is bound to a DataTable and I am trying to save the data to a TableAdapter.
This is a VS 2008 C# Windows Application.
I know that I am casting this correctly as I am raising the following error:
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'MFG_CAPTURE_DATADataTable'.
Here is the call that is raising the error:
Here is the method itself in the myST_BLL class:
static private MFG_CAPTURE_DATATableAdapter _captureDataTableAdapter;
public MFG_CAPTURE_DATATableAdapter captureDataTableAdapter()
if (_captureDataTableAdapter == null)
_captureDataTableAdapter = new MFG_CAPTURE_DATATableAdapter();
_captureDataTableAdapter.Connection.ConnectionString = _connStr;
The DataTable is one that I have created by combining two tables but the format is identical to the table that the MFG_CAPTURE_DATATableAdapter is connected to.
Can someone give me a little guidance please?
Click Here to Expand Forum to Full Width