Hi all,
we get a AccessViolationException when using System.Data.OleDb with "Microsoft OLE DB Provider for Visual FoxPro 9.0" (vfpoledb) after inserting a new row with a DataTable and OleDbDataAdapter.Update().
ExceptionDetails:
StackTrace: null
Data: {System.Collections.ListDictionaryInternal}
HResult: -2147467261
HelpLink: null
InnerException: null
Message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source: null
TargetSite: null
Fatal error. 0xC0000005
at System.Data.Common.UnsafeNativeMethods+ICommandWithParameters.SetParameterInfo(IntPtr, IntPtr[], System.Data.OleDb.tagDBPARAMBINDINFO[])
at System.Data.OleDb.OleDbCommand.ApplyParameterBindings(ICommandWithParameters, System.Data.OleDb.tagDBPARAMBINDINFO[])
at System.Data.OleDb.OleDbCommand.CreateAccessor()
at System.Data.OleDb.OleDbCommand.InitializeCommand(System.Data.CommandBehavior, Boolean)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(System.Data.CommandBehavior, System.Object ByRef)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(System.Data.CommandBehavior, System.String)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at System.Data.Common.DbDataAdapter.UpdateRowExecute(System.Data.Common.RowUpdatedEventArgs, System.Data.IDbCommand, System.Data.StatementType)
at System.Data.Common.DbDataAdapter.Update(System.Data.DataRow[], System.Data.Common.DataTableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(System.Data.DataTable, System.Data.Common.DataTableMapping)
at System.Data.Common.DbDataAdapter.Update(System.Data.DataTable)
at OleDBTest.Program.Main(System.String[])
associated Code:
using(OleDbConnectionoledbConn=newOleDbConnection(@"Provider=vfpoledb;Data Source=d:\temp\dbfile.dbf;Collating Sequence = machine;")){oledbConn.Open();using(OleDbDataAdapterda=newOleDbDataAdapter($"select * from dbfile.dbf",oledbConn)){OleDbCommandBuildercb=newOleDbCommandBuilder(da);da.InsertCommand=cb.GetInsertCommand();DataTabledt=newDataTable();da.Fill(dt);varcustomerRow=dt.NewRow();//Fill columnsdt.Rows.Add(customerRow);da.Update(dt);// <-- the AccessViolationException is thrown here}}We ported the code from classic .Net Framework (4.8) where the code works without a problem.
Hi all,
we get a AccessViolationException when using System.Data.OleDb with "Microsoft OLE DB Provider for Visual FoxPro 9.0" (vfpoledb) after inserting a new row with a DataTable and OleDbDataAdapter.Update().
associated Code:
We ported the code from classic .Net Framework (4.8) where the code works without a problem.