pkahal
February 14th, 2005, 05:39 PM
Hi
I am getting this error on an NT machine but not on Win 2000.
My machine configuration: NT SP6a, MDAC 2.5 SP3, Microsoft .NET Framework Version 1.1 Redistributable Package, IE 6.
When I try query (select * from tableName) from any table that has result rows with null parameters, I get an exception. The Exception message is quite meaningless and just says : NO DATA.
Seems an issue specific to NT. I replaced the data with whitespaces and it works good.
My code is below.
//private void accessDB(string myInsertQuery, string myConnection)
{
string myConnection = "some user, pwd etcXXXX";
string myInsertQuery = "select * from tableName";
OdbcConnection myConn = new OdbcConnection(myConnection);
OdbcCommand myOdbcCommand = new OdbcCommand(myInsertQuery);
try
{
myOdbcCommand.Connection = myConn;
myConn.Open();
OdbcDataAdapter da = new OdbcDataAdapter();
OdbcCommand cmd = ((OdbcConnection)myConn).CreateCommand();
cmd.CommandText = myInsertQuery;
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds); // here it throws an exception
}
catch(Exception Ex)
{
Console.WriteLine(Ex.Message);
}
finally
{
myOdbcCommand.Connection.Close();
}
}
I am getting this error on an NT machine but not on Win 2000.
My machine configuration: NT SP6a, MDAC 2.5 SP3, Microsoft .NET Framework Version 1.1 Redistributable Package, IE 6.
When I try query (select * from tableName) from any table that has result rows with null parameters, I get an exception. The Exception message is quite meaningless and just says : NO DATA.
Seems an issue specific to NT. I replaced the data with whitespaces and it works good.
My code is below.
//private void accessDB(string myInsertQuery, string myConnection)
{
string myConnection = "some user, pwd etcXXXX";
string myInsertQuery = "select * from tableName";
OdbcConnection myConn = new OdbcConnection(myConnection);
OdbcCommand myOdbcCommand = new OdbcCommand(myInsertQuery);
try
{
myOdbcCommand.Connection = myConn;
myConn.Open();
OdbcDataAdapter da = new OdbcDataAdapter();
OdbcCommand cmd = ((OdbcConnection)myConn).CreateCommand();
cmd.CommandText = myInsertQuery;
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds); // here it throws an exception
}
catch(Exception Ex)
{
Console.WriteLine(Ex.Message);
}
finally
{
myOdbcCommand.Connection.Close();
}
}