Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OdbcDataReader error

Status
Not open for further replies.

Strannik

Programmer
Jul 4, 2002
132
0
0
UA
I design web-application which uses MySQL 4.0 and ODBCconnection.
Framework 1.1. On the developer PC (WinXP SP1, VS2003) everything is OK.
On the test PC(Win2000 server, Framework 1.1 + MDAC 2.7 + MySQL ODBC drivers) the following code raises exception:
oAdapter.Fill(table);

NO_DATA - no error information available

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: NO_DATA - no error information available
 
Stack trace:

[OdbcException: NO_DATA - no error information available]
System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle, SQL_HANDLE hType, RETCODE retcode) +32
System.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype, Int32 cb) +258
System.Data.Odbc.OdbcDataReader.internalGetString(Int32 i) +103
System.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap typemap) +69
System.Data.Odbc.OdbcDataReader.GetValue(Int32 i) +52
System.Data.Odbc.OdbcDataReader.GetValues(Object[] values) +51
System.Data.Common.SchemaMapping.LoadDataRow(Boolean clearDataValues, Boolean acceptChanges) +61
System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping) +155
System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +260
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDataReader dataReader) +90
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior) +28
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +88
Debt.CSQLHelper.getLeads(EnumLeadStatuses status) in c:\inetpub\Debt.leads.InitGrid() in c:\inetpub\Debt.leads.InitPage() in c:\inetpub\Debt.leads.Page_Load(Object sender, EventArgs e) in c:\inetpub\System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
can you provide a bit of code?

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
DataTable table = new DataTable("leads");
OdbcDataAdapter oAdapter = new OdbcDataAdapter();
OdbcCommand oCmd = new OdbcCommand("SELECT * FROM lead",m_oConnection);

oCmd.CommandType = CommandType.Text;
oAdapter.SelectCommand = oCmd;
oAdapter.Fill(table);

return table;
 
I've had some problems using mysql when it comes to table names. make sure you wrote it case sensitive.

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Well ... as i said on WinXP everything works OK.
On win2000 the following code works:
OdbcDataReader oReader = oCmd.ExecuteReader();

but I when populate table using OdbcDataAdapter it raises exception :(
 
check the driver versions for ODBC to be the same, also MySQL database version

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Well ... I've installed new MDAC version ... now 2.8 and everything works OK.
 
Well ... I've installed new MDAC version ... 2.8 now and everything works OK
 
ok... :)

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top