I have a code like this in my program and I believe that it's not closing the connection after that the data is getting filled in.
public static string ConnectionInfo = System.Configuration.ConfigurationManager.ConnectionStrings["Default"].ConnectionString;
public static DataTable ExecuteQuery(string query, string table)
{
SqlConnection cnn = new SqlConnection(ConnectionInfo);
SqlDataAdapter Adp = new SqlDataAdapter(query, cnn);
DataSet Ds = new DataSet();
Adp.Fill(Ds, table);
return Ds.Tables[table];
}
Is there any problem in this code ?