TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aalhussein
1.6k
133
10.1k
connection string running out of connection pooling
Jan 23 2020 7:21 PM
Hi, I have a webform application, when I access the website, things works fine. but when multiple people access the site, it gives me a message that I have exceeded the connection pooling .
I revised my code accessing the database with the folling one. Still I am having same problem. Any idea how to prevent exceeling connection pool .
thanks for your support
public
static
string
conStr = WebConfigurationManager.ConnectionStrings[
"conStrKfmc"
].ConnectionString;
public
SqlConnection con =
new
SqlConnection(WebConfigurationManager.ConnectionStrings[
"conStrKfmc"
].ConnectionString);
public
DataSet getDataSetPassSql(
string
mySql)
{
DataSet ds;
using
(SqlConnection cn =
new
SqlConnection(conStr))
{
using
(SqlCommand cmd =
new
SqlCommand(mySql, cn))
{
SqlDataAdapter da =
new
SqlDataAdapter(cmd);
ds =
new
DataSet();
using
(cn)
{
cn.Open();
da.Fill(ds);
return
ds;
}
}
}
}
public
int
InsertUpdateDelete(
string
mySql, Dictionary myPara)
{
int
rtn = 0;
using
(SqlCommand cmd =
new
SqlCommand(mySql, con))
{
cmd.CommandType = CommandType.Text;
foreach
(KeyValuePair p
in
myPara)
{
cmd.Parameters.AddWithValue(p.Key, p.Value);
}
using
(con)
{
con.Open();
rtn = cmd.ExecuteNonQuery();
con.Close();
}
}
return
rtn;
}
Thanks for your support
Reply
Answers (
3
)
how to create indexer in our own collection<T>
Can I install and run Xamarin Studio in VS 2013 community?