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,144 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Creating and Managing Databases with phpMyAdmin in cPanel.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now