cjard
Well-known member
- Joined
- Apr 25, 2006
- Messages
- 7,081
- Programming Experience
- 10+
I'm trying to figure out why, if I use a DataAdapter to fill a generic DataTable, a grid bound to the table suddenly throws a "Controls must be accessed on the thread where they were created" error.. The whole idea of doing a database operation on a background worker is to avoid halting the UI..
This DataGridView is set to AutoGenerateColumns = true and the schema of the DataTable is not known in advance, which is where i suspect the problem may be occurring (which kinda implies the control itself is bugged?)
This DataGridView is set to AutoGenerateColumns = true and the schema of the DataTable is not known in advance, which is where i suspect the problem may be occurring (which kinda implies the control itself is bugged?)
VB.NET:
System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0xdf bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.SendMessage(int msg = 11, int wparam = 0, int lparam = 0) + 0x1e bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.BeginUpdateInternal() + 0x4c bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.RefreshColumns() + 0x31 bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.RefreshColumnsAndRows() + 0x37 bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.DataGridViewDataConnection.ProcessListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x6d bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.DataGridViewDataConnection.currencyManager_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x27 bytes
System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x17 bytes
System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.List_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) + 0x139 bytes
System.Windows.Forms.dll!System.Windows.Forms.BindingSource.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x7b bytes
System.Windows.Forms.dll!System.Windows.Forms.BindingSource.InnerList_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) + 0x2e bytes
System.Data.dll!System.Data.DataView.OnListChanged(System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0xf1 bytes
System.Data.dll!System.Data.DataView.ColumnCollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) + 0x12f bytes
System.Data.dll!System.Data.DataViewListener.ColumnCollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) + 0x57 bytes
System.Data.dll!System.Data.DataColumnCollection.OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs ccevent) + 0x5d bytes
System.Data.dll!System.Data.DataColumnCollection.AddAt(int index, System.Data.DataColumn column) + 0xdc bytes
System.Data.dll!System.Data.ProviderBase.SchemaMapping.SetupSchemaWithoutKeyInfo(System.Data.MissingMappingAction mappingAction = Passthrough, System.Data.MissingSchemaAction schemaAction = Add, bool gettingData = true, System.Data.DataColumn parentChapterColumn = null, object chapterValue = null) + 0x15e bytes
System.Data.dll!System.Data.ProviderBase.SchemaMapping.SchemaMapping(System.Data.Common.DataAdapter adapter, System.Data.DataSet dataset, System.Data.DataTable datatable, System.Data.ProviderBase.DataReaderContainer dataReader, bool keyInfo, System.Data.SchemaType schemaType, string sourceTableName, bool gettingData, System.Data.DataColumn parentChapterColumn, object parentChapterValue) + 0x289 bytes
System.Data.dll!System.Data.Common.DataAdapter.FillMapping(System.Data.DataSet dataset, System.Data.DataTable datatable, string srcTable, System.Data.ProviderBase.DataReaderContainer dataReader, int schemaCount, System.Data.DataColumn parentChapterColumn, object parentChapterValue) + 0xbb bytes
System.Data.dll!System.Data.Common.DataAdapter.FillFromReader(System.Data.DataSet dataset = null, System.Data.DataTable datatable = {}, string srcTable = null, System.Data.ProviderBase.DataReaderContainer dataReader = {System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader}, int startRecord = 0, int maxRecords = 0, System.Data.DataColumn parentChapterColumn = null, object parentChapterValue = null) + 0x4b bytes
System.Data.dll!System.Data.Common.DataAdapter.Fill(System.Data.DataTable[] dataTables = {Dimensions:[1]}, System.Data.IDataReader dataReader = {System.Data.OracleClient.OracleDataReader}, int startRecord = 0, int maxRecords = 0) + 0x11c bytes
System.Data.dll!System.Data.Common.DbDataAdapter.FillInternal(System.Data.DataSet dataset, System.Data.DataTable[] datatables, int startRecord, int maxRecords, string srcTable, System.Data.IDbCommand command = {System.Data.OracleClient.OracleCommand}, System.Data.CommandBehavior behavior) + 0xde bytes
System.Data.dll!System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable[] dataTables, int startRecord, int maxRecords, System.Data.IDbCommand command, System.Data.CommandBehavior behavior) + 0xa3 bytes
System.Data.dll!System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable dataTable) + 0x6c bytes
> Credaro.exe!Credaro.CredaroMainForm.bgwDBQ_DoWork(object sender = {System.ComponentModel.BackgroundWorker}, System.ComponentModel.DoWorkEventArgs e = {System.ComponentModel.DoWorkEventArgs}) Line 79 + 0x19 bytes