Re: Too many connections
From: Shabam (blislecp_at_hotmail.com)
Date: 11/02/04
- Previous message: Cirrosi: "OT: Too many connections"
- In reply to: Cirrosi: "Re: Too many connections"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 15:34:33 -0800
Ok here is the code. It appears to be closing the connection:
public DataSet BindlstBrowse(int index,int pagesize,string sortorder)
{
String strCon =ApplicationData.DB_CONNECTION;
SqlConnection conn = new SqlConnection(strCon);
SqlCommand cmd;
SqlDataAdapter daObj=new SqlDataAdapter();
DataSet ds=new DataSet();
conn.Open();
cmd=new SqlCommand("sp_browseusers",conn);
cmd.CommandType =CommandType.StoredProcedure;
cmd.Parameters.Add("@sortField",SqlDbType.VarChar);
daObj.SelectCommand =cmd;
daObj.SelectCommand.Parameters["@sortField"].Value
=sortorder;
//Pass index and page size to get the required set of
records into dataset
daObj.Fill(ds,index,pagesize,"finalset");
//GET the total number of records
int TotalRecords
=Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString());
daObj.Dispose();
conn.Close();
return ds;
}
- Previous message: Cirrosi: "OT: Too many connections"
- In reply to: Cirrosi: "Re: Too many connections"
- Messages sorted by: [ date ] [ thread ]