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
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.)
Question by:ajaymaster143
LVL 13

Expert Comment

ID: 35103878

Author Comment

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);
        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);
            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);


Open in new window

LVL 11

Expert Comment

by:Kusala Wijayasena
ID: 35107058
Check this out:

LVL 29

Accepted Solution

fibo earned 500 total points
ID: 35353511

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
LVL 29

Expert Comment

ID: 35361167

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!

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Introduction This article is intended for those who are new to PHP error handling (  It addresses one of the most common problems that plague beginning PHP develop…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

823 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