Error in Data Submitiing on user machine's

Posted by Prabhakar under Sql Server on 4/22/2011 | Points: 10 | Views : 1178 | Status : [Member] [MVP] | Replies : 5
Hi Friends,


i am made one website and running on local host . i have 6 machine 1 a server and 5 user machine .. in a entry form . . my entry save properly but after some time connection was automatically Closed . . i don't know what's the reason . . i am totaly blank about this . . this problem not to come fix time . . after 10 min . . after 25 min . . after some time connection was automatically reset

suggest me what i do . . it's urgent . .

Thank's for advance

Best Regard's
Prabhakar



Responses

Posted by: Ndebata on: 4/22/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

Could you please post how you are handling database connection?



Prabhakar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/22/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi, Ndebata

i am stablish connection in my class . . and call in entry page . .

in a class

public void myconnection()
{

//uname = HttpContext.Current.Session["uname"].ToString();
uname = HttpContext.Current.Request.Cookies["databaseusername"].Value.ToString();
upwd = HttpContext.Current.Request.Cookies["databaseuserpassword"].Value.ToString();
databasename = HttpContext.Current.Request.Cookies["databasename"].Value.ToString();
server = HttpContext.Current.Request.Cookies["databaseserver"].Value.ToString();
//firm_id = Convert.ToInt32(Session["firmid"].ToString());
//firm_id=Convert.ToInt32(HttpContext.Current.Session["firmid"].ToString());
//firm_id = HttpContext.Current.Request.Cookies["firm_id"].Value.ToString();

mycon.ConnectionString = "Persist Security Info=True;User ID=" + uname + ";pwd=" + upwd + ";Initial Catalog=" + databasename + ";Data Source=" + server + ";";
try
{
mycon.Open();

}
catch (Exception ex)
{

err=ex.ToString();
return ;


}


}


in a .axpx page . . .

   localclass1.myconnection();

cmd = new SqlCommand(sql1, localclass1.mycon);



Best Regard's
Prabhakar

Prabhakar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: PandianS on: 4/22/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi

Could you pls try the link once ?

http://www.dotnetfunda.com/interview/exam2661-sql-server-connection-is-terminated-after-the-query-completes-why-.aspx

Cheers

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Prabhakar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/23/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi ...PandianS

thanku for reply i try it . .



Best Regard's
Prabhakar

Prabhakar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/23/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi pandian's

i am check box "Disconnect after the query executes" and Click OK. . . but my problem not solve . . connection is automatically closed after some time . .

Best Regard's
Prabhakar

Prabhakar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response