From: Le r. A. <ar...@me...> - 2006-05-29 15:45:53
|
>It maybe ... i will try to confirm it .. if possible .... >Can you check in the case of sql server what is the state of the data reader > immediatly after the instruction where you do the data binding ?? the data reader state after the data binding in the sql server provider is : PROPERTY : IsClosed = true Private : Command = null Connection = null More over i continue my search and i find that if i do a dispose of sqlcommand before the databind, the datareader is not closed !! Exemple : SqlDataReader d; SqlConnection fb = new SqlConnection(ConfigurationManager.ConnectionStrings["dsncom"].ConnectionString); fb.Open(); SqlCommand fc = new SqlCommand("select * from categories", fb); d = fc.ExecuteReader(CommandBehavior.CloseConnection); fc.Dispose(); // With this line the datareader is not closed and the connection stay open after the databind ! GridView1.DataSource = d; GridView1.DataBind(); if you have an idea ? |