Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

Posted on 2011-03-10
7
Medium Priority
?
1,241 Views
Last Modified: 2012-05-11
i get this error some time in my website .
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
0
Comment
Question by:ajaymaster143
5 Comments
 

Author Comment

by:ajaymaster143
ID: 35104635
not help for me
look at my code
 string cnshiv = "Data Source=myserver;Initial Catalog=shivdiamond;pooling=false;Persist Security Info=True;User ID=admin;Password=admin";
   string cnstock = "Data Source=newserver;Initial Catalog=shiv;pooling=false;Persist Security Info=True;User ID=saadmin;Password=password";

    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection cnsql;
        SqlCommand cmsql;
        SqlDataReader drsql;
        cnsql = new SqlConnection(cnshiv);
        cnsql.Open();
        string sql = "select * from shivadmin.exportsotck where id >3170 order by id";
        cmsql = new SqlCommand(sql, cnsql);
        drsql = cmsql.ExecuteReader();
        while (drsql.Read())
        {
            SqlConnection cn;
            SqlCommand cm;
            cn = new SqlConnection(cnstock);
            cn.Open();
            string id,Code,designno,exportno,grosswt,diamonpc,diamondwt,size,length,width,clarity,status,price,itemstype,exportto,endtime,aprl,soldprice,address,image,category,subcategory;
            id = drsql["id"].ToString();
            Code = drsql["Code"].ToString();
            designno = drsql["designno"].ToString();
            exportno = drsql["exportno"].ToString();
            grosswt = drsql["grosswt"].ToString();
           
            diamonpc = drsql["diamonpc"].ToString();
            diamondwt = drsql["diamondwt"].ToString();
            size = drsql["size"].ToString();
            length = drsql["length"].ToString();
            width = drsql["width"].ToString();
            clarity = drsql["clarity"].ToString();
            status = drsql["status"].ToString();
            price = drsql["price"].ToString();
            itemstype = drsql["itemstype"].ToString();
            exportto = drsql["exportto"].ToString();
            endtime = drsql["endtime"].ToString();
            aprl = drsql["aprl"].ToString();
            soldprice = drsql["soldprice"].ToString();
            address = drsql["address"].ToString();
            image = drsql["image"].ToString();

            category = drsql["category"].ToString();

            subcategory = drsql["subcategory"].ToString();

            
            string sq="insert into sainath.exportsotck values('" + id + "','" + Code + "','" + designno +"','" + exportno + "','" + grosswt + "','" + diamonpc + "','" + diamondwt + "','" + size + "','" + length + "','" + width + "','" + clarity + "','" + status + "','"  + price + "','" + itemstype + "','" + exportto + "','" + endtime + "','" + aprl + "','" + soldprice + "','" + address + "','" + image + "','" + category + "','" + subcategory + "')";   
        cm=new SqlCommand(sq,cn);
            cm.ExecuteNonQuery();
            cn.Close();
            cm.Dispose();
        
        }


    }

Open in new window

0
 
LVL 11

Expert Comment

by:Kusala Wijayasena
ID: 35107058
Check this out:

http://support.microsoft.com/kb/919710

-Kusala
0
 
LVL 29

Accepted Solution

by:
fibo earned 2000 total points
ID: 35353511
Ajay,

Can you test the result of changing line 11 to
        string sql = "select  id,Code,designno,exportno,grosswt,diamonpc,diamondwt,size,length,width,clarity,status,price,itemstype,exportto,endtime,aprl,soldprice,address,image,category,subcategory from shivadmin.exportsotck where id >3170 order by id";

Open in new window

This would decrease the volume of data to be transferred and so the burden on the network
0
 
LVL 29

Expert Comment

by:fibo
ID: 35361167
@ajaymaster,

Thx for the grade and points. You did not comment though if my suggestion solves your problem.
If it does not, you should restart the "question delete" process. If needed, moderators will help.

B-) And if this is a solution, I'm glad for both of us!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question