Description:
I'm using Connector/Net togheter with asp.net 2.0. I have problems with that my connections doesn't close. For each time I reload my page I get a new connection that doesn't close until max_user_connections is reached. I use this code:
<asp:SqlDataSource ID="DS_processlist" runat="server" DataSourceMode="DataReader" ConnectionString="Data Source=**;Database=**;User ID=**;Password=**;Pooling=false" ProviderName="MySql.Data.MySqlClient" SelectCommand="show processlist"></asp:SqlDataSource>
<asp:DataGrid ID="DG" runat="server" DataSourceID="DS_processlist" AutoGenerateColumns="true"></asp:DataGrid>
When I bind my data in codebehind by myself and closes the connection myself everything works perfect and my connections is closed:
MySqlConnection conn = new MySqlConnection("Data Source=**;Database=**;User ID=**;Password=**;Pooling=false");
cmd = new MySqlCommand("show processlist", conn);
cmd.Connection.Open();
dr = cmd.ExecuteReader();
DG.DataSource = dr;
DG.DataBind();
cmd.Connection.Close();
I've tried both with Pooling enabled and disabled, nothing seems to help.
Please check this out!
How to repeat:
This doesn't work:
<asp:SqlDataSource ID="DS_processlist" runat="server" DataSourceMode="DataReader" ConnectionString="Data Source=**;Database=**;User ID=**;Password=**;Pooling=false" ProviderName="MySql.Data.MySqlClient" SelectCommand="show processlist"></asp:SqlDataSource>
<asp:DataGrid ID="DG" runat="server" DataSourceID="DS_processlist" AutoGenerateColumns="true"></asp:DataGrid>
But this works:
MySqlConnection conn = new MySqlConnection("Data Source=**;Database=**;User ID=**;Password=**;Pooling=false");
cmd = new MySqlCommand("show processlist", conn);
cmd.Connection.Open();
dr = cmd.ExecuteReader();
DG.DataSource = dr;
DG.DataBind();
cmd.Connection.Close();
Description: I'm using Connector/Net togheter with asp.net 2.0. I have problems with that my connections doesn't close. For each time I reload my page I get a new connection that doesn't close until max_user_connections is reached. I use this code: <asp:SqlDataSource ID="DS_processlist" runat="server" DataSourceMode="DataReader" ConnectionString="Data Source=**;Database=**;User ID=**;Password=**;Pooling=false" ProviderName="MySql.Data.MySqlClient" SelectCommand="show processlist"></asp:SqlDataSource> <asp:DataGrid ID="DG" runat="server" DataSourceID="DS_processlist" AutoGenerateColumns="true"></asp:DataGrid> When I bind my data in codebehind by myself and closes the connection myself everything works perfect and my connections is closed: MySqlConnection conn = new MySqlConnection("Data Source=**;Database=**;User ID=**;Password=**;Pooling=false"); cmd = new MySqlCommand("show processlist", conn); cmd.Connection.Open(); dr = cmd.ExecuteReader(); DG.DataSource = dr; DG.DataBind(); cmd.Connection.Close(); I've tried both with Pooling enabled and disabled, nothing seems to help. Please check this out! How to repeat: This doesn't work: <asp:SqlDataSource ID="DS_processlist" runat="server" DataSourceMode="DataReader" ConnectionString="Data Source=**;Database=**;User ID=**;Password=**;Pooling=false" ProviderName="MySql.Data.MySqlClient" SelectCommand="show processlist"></asp:SqlDataSource> <asp:DataGrid ID="DG" runat="server" DataSourceID="DS_processlist" AutoGenerateColumns="true"></asp:DataGrid> But this works: MySqlConnection conn = new MySqlConnection("Data Source=**;Database=**;User ID=**;Password=**;Pooling=false"); cmd = new MySqlCommand("show processlist", conn); cmd.Connection.Open(); dr = cmd.ExecuteReader(); DG.DataSource = dr; DG.DataBind(); cmd.Connection.Close();