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
Pnkl
NA
114
66k
Data Lost on Multiple Request in Asp.Net Web site
Dec 9 2015 5:59 AM
Hello Guys,
I have Developed one website in Asp.Net 4.0 And Sql Server 2012 And I used 3-tier Data Access method but sometimes many requests are occur then data lost from Sql Server Db so why this happen?
If you have solution then reply me.
Below is my sample code
in DataClass.cs filldata method :
public static SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString);
public static DataTable Filladptor(SqlCommand cmd)
{
DataTable dt = new DataTable();
cmd.Connection = cn;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
try
{
//cmd = new SqlCommand();
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
adp.Fill(dt);
}
catch (Exception ex)
{
errmsg = ex.Message;
}
finally
{
cmd.Dispose();
if (cn.State == ConnectionState.Open)
{
cn.Close();
}
}
return dt;
}
I
N Webconfig Connectionstring:
<add name="constr" connectionString="Data Source=MyServerIp;User ID=myusername;Password=mypassword;persist security info=False;Initial catalog=myDB;Connection Timeout=15;Connection Lifetime=0;Min Pool Size=0;Max Pool Size=100;Pooling=true;" providerName="System.Data.SqlClient"/>
Thanks..
Reply
Answers (
4
)
how to get information of a gprs device in c#
How to set client side default printer page size in ASP.NET,