Probable BUG in MyODBC connection
Posted by:
fremsoft
Date: November 29, 2004 03:48AM
Hi people,
I'm connecting to my MySQL db on Linux RH9.1 through MyODBC 3.51.06 from Win2000 with program written in C#.
Following the source code of library I'm written down to execute queries:
public void Select(string sql_what, string sql_from, string sql_clause)
{
//E.g. Select("Colonna_1, Colonna_2", "Tabella_1", "Colonna_1 = 'pippo'")
string select_sql = "SELECT "+sql_what+" FROM "+sql_from+" "+sql_clause;
bool ok = false;
int retries = 0;
while ((!ok) && (retries < n_max_retries))
{
ok = false;
try
{
OdbcConnection dbConn = new OdbcConnection("DSN=mydb;");
dbConn.Open();
OdbcCommand myAccessCommand = new OdbcCommand(select_sql, dbConn);
OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(myAccessCommand);
myDataSet = new DataSet();
try
{
myDataAdapter.Fill(myDataSet, sql_from); // $$$$ HERE IS ERROR
ok = true;
}
catch
{
ok = false;
}
finally
{
myDataAdapter.Dispose();
dbConn.Close();
}
currentTable = myDataSet.Tables[sql_from];
}
catch //(Exception e)
{
ok = false;
}
retries++;
}
if (!ok)
{
// server disconnected;
throw new ApplicationException("Select server Error");
}
}
The problem consists in that:
1 - first of all I try to get data from the server correctly
2 - then I disconnect the LAN
3 - when I try to get other data from the server the program blocks to
>>> myDataAdapter.Fill(myDataSet, sql_from); // $$$$ HERE IS ERROR
with no exceptions thrown!!! neither error code returned back!!!
Thanks.
Subject
Written By
Posted
Probable BUG in MyODBC connection
November 29, 2004 03:48AM
December 01, 2004 02:01AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.