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;
}
IN Webconfig Connectionstring:
Thanks..

Hemant Joshi138 reputationPosted Dec 9, 2015, 1:11 AM EST
Pnkl154 reputationPosted Dec 9, 2015, 9:10 PM EST
Pnkl154 reputationPosted Dec 13, 2015, 7:13 PM EST
Hemant Joshi138 reputationPosted Dec 9, 2015, 11:02 PM EST