Jump to content
Xtreme .Net Talk

LeifW

Members
  • Posts

    1
  • Joined

  • Last visited

LeifW's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I have a problem which I hope is easy. I have a program written in C#. I'm using a DataReader to retrive 4 rows of data from a Sybase database. Everything seems to work fine except when I call the DataReader.Close() method. The system just hangs. I'm using the OleDbDataReader. When I trace through the code using the debugger, I see that correct data is being returned in a timely manner. Also if I use Odbc objects (OdbcConnection, OdbcDataReader, OdbcCommand) with the appropriate connect string, everything works fine. Any help or guidance would be appreciated. Thanks. Here's the code. OleDbConnection myConn = new OleDbConnection(Session["ConnectionString"].ToString()); string mySelectQuery = "select id from Cashflow where number = 464000"; OleDbCommand myCommand = new OleDbCommand(mySelectQuery,myConn); OleDbDataReader dr; myConn.Open(); dr = myCommand.ExecuteReader(); while (dr.Read()) { ListBox2.Items.Add(dr[0].ToString()); } dr.Close(); // <---- System hangs here! myConn.Close(); Thanks, LeifW
×
×
  • Create New...