![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
is a reader automaticaly disposed if the connection it is associated with is closed? what will happen if an app: while true open connection open reader close connection end while |
#3
| |||
| |||
|
| Why don't you try it and see? This willl get you started. Then post your results. public IDataReader CustomersGetAllReader() { String myConn ="Provider=Microsoft.JET.OLEDB.4.0;Data Source=C:\\Wutemp\\Nwind.mdb;"; //naturally, you gotta have a database (mdb) somewhere...change value here String myQuery = "Select [CustomerID],[ContactName],[City] From [Customers];"; OleDbConnection cn = new OleDbConnection(myConn); cn.Open(); OleDbCommand cmd = new OleDbCommand(myQuery , cn); return cmd.ExecuteReader(CommandBehavior.CloseConnection ); // } "Daniel" <softwareengineer98037 (AT) yahoo (DOT) com> wrote in message news:OXdwsjj%23HHA.464 (AT) TK2MSFTNGP02 (DOT) phx.gbl... is a reader automaticaly disposed if the connection it is associated with is closed? what will happen if an app: while true open connection open reader close connection end while |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |