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
1,176 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
7 Comments
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 35103878
0
 

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 500 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

679 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