Bizarre error with no error information.
am 05.01.2007 22:03:20 von zeyaisI am writing a C# program that uses MySQL as database and MySQL ODBC
3.51 driver.
It works fine all the way except this scenario that needs to be
addressed.
1. Get a set of records to process (this brings back a datatable in C#
and works fine. It uses a limit of 30 records each time).
2. Process the information from Step 1.
3. Check in table B if data of this exists in table B
4. Based on info from Step 3 Insert/Update data in table B (in either
case only one row will be affected)
5. Get next record in Step 2 and repeat further till all records
processed.
Doing so throws exception that I have no idea.
>From Event Viewer.
First I get two COM+ errors and then my application log.
COM+ errors category - unknown and Event - 4786:
------------------------------------------------------------ ------------------------------------------------------------ ------------------------
The system has called a custom component and that component has failed
and generated an exception. This indicates a problem with the custom
component. Notify the developer of this component that a failure has
occurred and provide them with the information below.
Component Prog ID: 0[ODBC][Env 32212a0]
Method Name: IDispenserDriver::DestroyResource
Process Name: MyApp.exe
Exception: C0000005
Address: 0x7C910E03
Call Stack:
ntdll!wcsncpy + 0x374
myodbc3! + 0x4DB5D
myodbc3!SQLTransact + 0x8F5D
COM+ Second error:
------------------------------------------------------------ ------------------------------------------------------------ ------------------------
The system has called a custom component and that component has failed
and generated an exception. This indicates a problem with the custom
component. Notify the developer of this component that a failure has
occurred and provide them with the information below.
Component Prog ID: 0[ODBC][Env 32212a0]
Method Name: IDispenserDriver::CreateResource
Process Name: MyApp.exe
Exception: C0000005
Address: 0x7C91142E
Call Stack:
ntdll!wcsncpy + 0x99F
myodbc3! + 0x4DAA2
myodbc3! + 0x4DAC4
Then my app logs:
------------------------------------------------------------ ------------------------------------------------------------ ------------------------
ERROR - no error information available
at System.Data.Odbc.OdbcConnection.Open()
.....
Second log from my app:
------------------------------------------------------------ ------------------------------------------------------------ ------------------------
System.Data
Object reference not set to an instance of an object.
at System.Data.Common.Odbc32.SQLDisconnect(HandleRef
ConnectionHandle)
at System.Data.Odbc.DBCWrapper.CloseAndRelease()
at System.Data.Odbc.OdbcConnection.DisposeClose()
at System.Data.Odbc.OdbcConnection.Close()
at System.Data.Odbc.OdbcConnection.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
.....
What is going on? How do I resolve this?
Thanks in advance.
PS: I may cross post this in different forums (possible other forums:
MySQL, C#)