Showing posts with label closed. Show all posts
Showing posts with label closed. Show all posts

Monday, March 26, 2012

The connection was closed.

Hi, I have a web page that call another one with this code:

WebClient SendSite = new WebClient();
SendSite.Headers.Add("Content-Type", "application/x-www-form-
urlencoded");
string StrReqSend = "Par1=aaa&Par2=2222";
byte[] Param = System.Text.Encoding.ASCII.GetBytes(StrReqSend);
byte[] Rps = SendSite.UploadData("http://localhost/nomeprogetto/
prova.aspx", "POST", Param);

The web page called read the parameters, run the code and return 1 or
0.

The code that prepare the answer is the follow:

private void WriteResult(string StrResult)
{
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.Write(StrResult);
Response.Flush();
Response.Close();
}

When I run the code happen an error:

Unable to read data from the transport connection: The connection was
closed.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.IO.IOException: Unable to read data from the
transport connection: The connection was closed.

How can I solve the problem?

Thanks in advice.Try commenting out Response.Close(); and see what happens.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
<support@dotnet.itags.org.missmobile.netwrote in message
news:1180699146.296715.194340@dotnet.itags.org.o5g2000hsb.googlegro ups.com...

Quote:

Originally Posted by

Hi, I have a web page that call another one with this code:
>
WebClient SendSite = new WebClient();
SendSite.Headers.Add("Content-Type", "application/x-www-form-
urlencoded");
string StrReqSend = "Par1=aaa&Par2=2222";
byte[] Param = System.Text.Encoding.ASCII.GetBytes(StrReqSend);
byte[] Rps = SendSite.UploadData("http://localhost/nomeprogetto/
prova.aspx", "POST", Param);
>
The web page called read the parameters, run the code and return 1 or
0.
>
The code that prepare the answer is the follow:
>
private void WriteResult(string StrResult)
{
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.Write(StrResult);
Response.Flush();
Response.Close();
}
>
When I run the code happen an error:
>
Unable to read data from the transport connection: The connection was
closed.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
>
Exception Details: System.IO.IOException: Unable to read data from the
transport connection: The connection was closed.
>
>
How can I solve the problem?
>
Thanks in advice.
>


On 2 Giu, 00:56, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@dotnet.itags.org.comcast.netNoSpamMwrote:

Quote:

Originally Posted by

Try commenting out Response.Close(); and see what happens.
>
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBAhttp://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)
>
************************************************
Think outside the box!
************************************************<supp...@dotnet.itags.org.missmobile.netwrote in message
>
news:1180699146.296715.194340@dotnet.itags.org.o5g2000hsb.googlegro ups.com...
>
>
>

Quote:

Originally Posted by

Hi, I have a web page that call another one with this code:


>

Quote:

Originally Posted by

WebClient SendSite = new WebClient();
SendSite.Headers.Add("Content-Type", "application/x-www-form-
urlencoded");
string StrReqSend = "Par1=aaa&Par2=2222";
byte[] Param = System.Text.Encoding.ASCII.GetBytes(StrReqSend);
byte[] Rps = SendSite.UploadData("http://localhost/nomeprogetto/
prova.aspx", "POST", Param);


>

Quote:

Originally Posted by

The web page called read the parameters, run the code and return 1 or
0.


>

Quote:

Originally Posted by

The code that prepare the answer is the follow:


>

Quote:

Originally Posted by

private void WriteResult(string StrResult)
{
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.Write(StrResult);
Response.Flush();
Response.Close();
}


>

Quote:

Originally Posted by

When I run the code happen an error:


>

Quote:

Originally Posted by

Unable to read data from the transport connection: The connection was
closed.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.


>

Quote:

Originally Posted by

Exception Details: System.IO.IOException: Unable to read data from the
transport connection: The connection was closed.


>

Quote:

Originally Posted by

How can I solve the problem?


>

Quote:

Originally Posted by

Thanks in advice.- Nascondi testo tra virgolette -


>
- Mostra testo tra virgolette -


Hi, if I comment Response.Close(); works fine but i receive too HTML
code.

The page must contain only the value of "StrResult" because the same
page are request by a lot of VB6 application.

I can't upgrade all VB6 application...

Thanks in advice

Matteo

The connection was not closed. The connections current state is open

I'm not sure why I am still getting this connection error

www.photopizzaz.biz/allcode.txt

resolved it, please disregard this thread.


Okay, But you might want to remove that code for security reasons(from the server).

The connection was closed.

Hi, I have a web page that call another one with this code:
WebClient SendSite = new WebClient();
SendSite.Headers.Add("Content-Type", "application/x-www-form-
urlencoded");
string StrReqSend = "Par1=aaa&Par2=2222";
byte[] Param = System.Text.Encoding.ASCII.GetBytes(StrReqSend);
byte[] Rps = SendSite.UploadData("http://localhost/nomeprogetto/
prova.aspx", "POST", Param);
The web page called read the parameters, run the code and return 1 or
0.
The code that prepare the answer is the follow:
private void WriteResult(string StrResult)
{
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.Write(StrResult);
Response.Flush();
Response.Close();
}
When I run the code happen an error:
Unable to read data from the transport connection: The connection was
closed.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.IO.IOException: Unable to read data from the
transport connection: The connection was closed.
How can I solve the problem?
Thanks in advice.Try commenting out Response.Close(); and see what happens.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)
****************************************
********
Think outside the box!
****************************************
********
<support@dotnet.itags.org.missmobile.net> wrote in message
news:1180699146.296715.194340@dotnet.itags.org.o5g2000hsb.googlegroups.com...
> Hi, I have a web page that call another one with this code:
> WebClient SendSite = new WebClient();
> SendSite.Headers.Add("Content-Type", "application/x-www-form-
> urlencoded");
> string StrReqSend = "Par1=aaa&Par2=2222";
> byte[] Param = System.Text.Encoding.ASCII.GetBytes(StrReqSend);
> byte[] Rps = SendSite.UploadData("http://localhost/nomeprogetto/
> prova.aspx", "POST", Param);
> The web page called read the parameters, run the code and return 1 or
> 0.
> The code that prepare the answer is the follow:
> private void WriteResult(string StrResult)
> {
> Response.ClearHeaders();
> Response.ClearContent();
> Response.ContentType = "text/plain";
> Response.ContentEncoding = System.Text.Encoding.Default;
> Response.Write(StrResult);
> Response.Flush();
> Response.Close();
> }
> When I run the code happen an error:
> Unable to read data from the transport connection: The connection was
> closed.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
> Exception Details: System.IO.IOException: Unable to read data from the
> transport connection: The connection was closed.
>
> How can I solve the problem?
> Thanks in advice.
>
On 2 Giu, 00:56, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@dotnet.itags.org.comcast.netNoSpamM> wrote:
> Try commenting out Response.Close(); and see what happens.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBAhttp://gregorybeamer.spaces.live.com
> Co-author: Microsoft Expression Web Bible (upcoming)
> ****************************************
********
> Think outside the box!
> ****************************************
********<supp...@dotnet.itags.org.missmobile.net> w
rote in message
> news:1180699146.296715.194340@dotnet.itags.org.o5g2000hsb.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
> - Mostra testo tra virgolette -
Hi, if I comment Response.Close(); works fine but i receive too HTML
code.
The page must contain only the value of "StrResult" because the same
page are request by a lot of VB6 application.
I can't upgrade all VB6 application...
Thanks in advice
Matteo

Saturday, March 24, 2012

The Error

I was developing an ASP.NET web application..and suddenly..i got hungry...i saved everything and closed Visual Studio.Net (2003) ..ate...back to VS.NET..start my application...then..i got this error

Visual Studio cannot create or open the application because the web server on this computer is not running. Start the web server before processing.

Now,this is my whole story..i did nothin to VS ..what should i do

(i found that the web server is running..i stopped it..then restarted it..but in vain...un then re install the iis....restart windows (XP pro) ..and i got the same error)

try running the regiis, that sometimes fixes the problem and you should do it after re-installing iis.

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i


MxMxM wrote:

I was developing an ASP.NET web application..and suddenly..i got hungry...i saved everything and closed Visual Studio.Net (2003) ..ate...back to VS.NET..start my application...then..i got this error

Visual Studio cannot create or open the application because the web server on this computer is not running. Start the web server before processing.

Now,this is my whole story..i did nothin to VS ..what should i do

(i found that the web server is running..i stopped it..then restarted it..but in vain...un then re install the iis....restart windows (XP pro) ..and i got the same error)

You may just re-start your IIS server.


i tried everything...aspnet_regiis.exe /i ...stop and restart...remove the IIS and add it again..then aspnet_regiis.exe /i ...