Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Saturday, March 31, 2012

System.FormatException: Input string was not in a correct format

Hello all,

I'm looking for a long time to find out what's wrong, but I can't find the mistake...
The connection to the database works correctly (Select,..), but when I set up the Insert-Command by clicking a button I get the following exception. Does anybody can help me and tell me what's wrong?!

Thank you for helping!

Exception:
System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Data.OleDb.OleDbParameter.GetParameterValue() at System.Data.OleDb.OleDbParameter.GetParameterScale() at System.Data.OleDb.OleDbParameter.BindParameter(Int32 i, DBBindings bindings, tagDBPARAMBINDINFO[] bindInfo) at System.Data.OleDb.OleDbCommand.CreateAccessor() at System.Data.OleDb.OleDbCommand.InitializeCommand(CommandBehavior behavior, Boolean throwifnotsupported) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at roomplaner.ObjektHinzu.Anlegen_Click(Object sender, EventArgs e) in C:\Inetpub\...\ObjektHinzu.aspx.vb:line 107

line 107 --> Command.ExecuteNonQuery()


Dim Command As New OleDbCommand

'create OleDb database connection
Dim SQL_CONNECTION_STRING As String = "Provider=SQLOLEDB;Server=...;...."
Command.Connection = New OleDbConnection(SQL_CONNECTION_STRING)

'create SQL statement for INSERT into table
Command.CommandText = "INSERT INTO t_object (Name, ObjectType, Category, Manufactor, Length, Width, Height, Text_Short, Text_Long, URL_Pic_Small, URL_Pic_Big, URL_Pic_Plan, URL_VET, VET_ObjectName, Material, Color, Price, ObjectLink, Comment, MaxSceneCount) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
Command.CommandType = CommandType.Text

'add input parameters and values to INSERT statement
Command.Parameters.Add("@dotnet.itags.org.Name", OleDbType.VarChar, 100).Value = O_Name.Text
Command.Parameters.Add("@dotnet.itags.org.ObjectType", OleDbType.BigInt, 8).Value = O_ObjectType.SelectedValue
Command.Parameters.Add("@dotnet.itags.org.Category", OleDbType.BigInt, 8).Value = O_Category.SelectedValue
Command.Parameters.Add("@dotnet.itags.org.Manufactor", OleDbType.BigInt, 8).Value = O_Manufactor.SelectedValue
Command.Parameters.Add("@dotnet.itags.org.Length", OleDbType.Integer, 4).Value = O_Length.Text
Command.Parameters.Add("@dotnet.itags.org.Width", OleDbType.Integer, 4).Value = O_Width.Text
Command.Parameters.Add("@dotnet.itags.org.Height", OleDbType.Integer, 4).Value = O_Height.Text
Command.Parameters.Add("@dotnet.itags.org.Text_Short", OleDbType.VarChar, 100).Value = O_Text_Short.Text
Command.Parameters.Add("@dotnet.itags.org.Text_Long", OleDbType.VarChar, 500).Value = O_Text_Long.Text

Command.Parameters.Add("@dotnet.itags.org.URL_Pic_Small", OleDbType.VarChar, 100).Value = "0"
Command.Parameters.Add("@dotnet.itags.org.URL_Pic_Big", OleDbType.VarChar, 100).Value = "0"
Command.Parameters.Add("@dotnet.itags.org.URL_Pic_Plan", OleDbType.VarChar, 100).Value = "0"

Command.Parameters.Add("@dotnet.itags.org.URL_VET", OleDbType.VarChar, 100).Value = "0"
Command.Parameters.Add("@dotnet.itags.org.VET_ObjectName", OleDbType.VarChar, 50).Value = O_VET_ObjectName.Text
Command.Parameters.Add("@dotnet.itags.org.Material", OleDbType.BigInt, 8).Value = O_Material.SelectedValue
Command.Parameters.Add("@dotnet.itags.org.Color", OleDbType.BigInt, 8).Value = O_Color.SelectedValue
Command.Parameters.Add("@dotnet.itags.org.Price", OleDbType.VarChar, 50).Value = O_Price.Text
Command.Parameters.Add("@dotnet.itags.org.ObjectLink", OleDbType.VarChar, 100).Value = O_ObjectLink.Text
Command.Parameters.Add("@dotnet.itags.org.Comment", OleDbType.VarChar, 100).Value = O_Comment.Text
Command.Parameters.Add("@dotnet.itags.org.MaxSceneCount", OleDbType.Integer, 4).Value = O_MaxSceneCount.Text

Try
Command.Connection.Open()
Command.ExecuteNonQuery() 'save record

Catch ex As Exception
Response.Write("Exception:")
Response.Write(ex.ToString)
End Try

Command.Connection.Close()
End Sub

The error is associated with a call to System.Number.ParseInt32(). That tells me that one of the parameters is expected to contain an integer or a string representation of an integer but does not. Identify integer parameters. Then in the debugger, determine if any of them are:
1. Not assigned. If a string is provided, is it an empty string?
2. Contains other characters than digits?
These two cases will generate that exception. (The .net docs for Convert.ToInt32 say FormatException will occur when:value does not consist of an optional sign followed by a sequence of digits (zero through nine).)

Wednesday, March 28, 2012

System.InvalidOperationException: Connection must be valid and open

Hi.
I am using this function tu execute updates to a MySql database from a sql
string, but I am getting a System.InvalidOperationException: Connection
must be valid and open.
Database queries work fine, but I cant update the source. Am I missing
something?
Thanks, Alejandro.
public static bool updateSource(string sql)
{
MySqlConnection conn = new MySqlConnection(myConnectionString);
MySqlCommand command = new MySqlCommand(sql,conn);
command.CommandType = CommandType.Text;
try
{
command.ExecuteNonQuery();
return true;
}
catch (Exception)
{return false;}
finally
{
conn.Close();
}Hello Alejandro Penate-Diaz,
Exactly what the error message says... You need to have a valid *and* open
connection.
Try adding conn.Open() before the command.ExecuteNonQuery() method.
Matt Berther
http://www.mattberther.com

> Hi.
> I am using this function tu execute updates to a MySql database from a
> sql string, but I am getting a System.InvalidOperationException:
> Connection must be valid and open.
> Database queries work fine, but I cant update the source. Am I missing
> something?
> Thanks, Alejandro.
> public static bool updateSource(string sql)
> {
> MySqlConnection conn = new MySqlConnection(myConnectionString);
> MySqlCommand command = new MySqlCommand(sql,conn);
> command.CommandType = CommandType.Text;
> try
> {
> command.ExecuteNonQuery();
> return true;
> }
> catch (Exception)
> {return false;}
> finally
> {
> conn.Close();
> }
>
Heyy, thanks!! Problem was that I was like copy-paste and didn't realize
that DataAdapter.Fill actualy does that for me but in this case I have to do
it by myself. ;-)
Thanks a lot!
Alejandro.
"Matt Berther" <mberther@.hotmail.com> wrote in message
news:6852859632389121357049404@.news.microsoft.com...
> Hello Alejandro Penate-Diaz,
> Exactly what the error message says... You need to have a valid *and* open
> connection.
> Try adding conn.Open() before the command.ExecuteNonQuery() method.
> --
> Matt Berther
> http://www.mattberther.com
>
>

System.InvalidOperationException: Connection must be valid and open

Hi.

I am using this function tu execute updates to a MySql database from a sql
string, but I am getting a System.InvalidOperationException: Connection
must be valid and open.

Database queries work fine, but I cant update the source. Am I missing
something?

Thanks, Alejandro.

public static bool updateSource(string sql)

{

MySqlConnection conn = new MySqlConnection(myConnectionString);

MySqlCommand command = new MySqlCommand(sql,conn);

command.CommandType = CommandType.Text;

try

{

command.ExecuteNonQuery();

return true;

}

catch (Exception)

{return false;}

finally

{

conn.Close();

}Hello Alejandro Penate-Diaz,

Exactly what the error message says... You need to have a valid *and* open
connection.

Try adding conn.Open() before the command.ExecuteNonQuery() method.

--
Matt Berther
http://www.mattberther.com

> Hi.
> I am using this function tu execute updates to a MySql database from a
> sql string, but I am getting a System.InvalidOperationException:
> Connection must be valid and open.
> Database queries work fine, but I cant update the source. Am I missing
> something?
> Thanks, Alejandro.
> public static bool updateSource(string sql)
> {
> MySqlConnection conn = new MySqlConnection(myConnectionString);
> MySqlCommand command = new MySqlCommand(sql,conn);
> command.CommandType = CommandType.Text;
> try
> {
> command.ExecuteNonQuery();
> return true;
> }
> catch (Exception)
> {return false;}
> finally
> {
> conn.Close();
> }
Heyy, thanks!! Problem was that I was like copy-paste and didn't realize
that DataAdapter.Fill actualy does that for me but in this case I have to do
it by myself. ;-)

Thanks a lot!
Alejandro.

"Matt Berther" <mberther@.hotmail.com> wrote in message
news:6852859632389121357049404@.news.microsoft.com. ..
> Hello Alejandro Penate-Diaz,
> Exactly what the error message says... You need to have a valid *and* open
> connection.
> Try adding conn.Open() before the command.ExecuteNonQuery() method.
> --
> Matt Berther
> http://www.mattberther.com
>> Hi.
>>
>> I am using this function tu execute updates to a MySql database from a
>> sql string, but I am getting a System.InvalidOperationException:
>> Connection must be valid and open.
>>
>> Database queries work fine, but I cant update the source. Am I missing
>> something?
>>
>> Thanks, Alejandro.
>>
>> public static bool updateSource(string sql)
>>
>> {
>>
>> MySqlConnection conn = new MySqlConnection(myConnectionString);
>>
>> MySqlCommand command = new MySqlCommand(sql,conn);
>>
>> command.CommandType = CommandType.Text;
>>
>> try
>>
>> {
>>
>> command.ExecuteNonQuery();
>>
>> return true;
>>
>> }
>>
>> catch (Exception)
>>
>> {return false;}
>>
>> finally
>>
>> {
>>
>> conn.Close();
>>
>> }
>>
OH Good u found ur Error...
Enjoy
Patrick

"Alejandro Penate-Diaz" wrote:

> Heyy, thanks!! Problem was that I was like copy-paste and didn't realize
> that DataAdapter.Fill actualy does that for me but in this case I have to do
> it by myself. ;-)
> Thanks a lot!
> Alejandro.
> "Matt Berther" <mberther@.hotmail.com> wrote in message
> news:6852859632389121357049404@.news.microsoft.com. ..
> > Hello Alejandro Penate-Diaz,
> > Exactly what the error message says... You need to have a valid *and* open
> > connection.
> > Try adding conn.Open() before the command.ExecuteNonQuery() method.
> > --
> > Matt Berther
> > http://www.mattberther.com
> >> Hi.
> >>
> >> I am using this function tu execute updates to a MySql database from a
> >> sql string, but I am getting a System.InvalidOperationException:
> >> Connection must be valid and open.
> >>
> >> Database queries work fine, but I cant update the source. Am I missing
> >> something?
> >>
> >> Thanks, Alejandro.
> >>
> >> public static bool updateSource(string sql)
> >>
> >> {
> >>
> >> MySqlConnection conn = new MySqlConnection(myConnectionString);
> >>
> >> MySqlCommand command = new MySqlCommand(sql,conn);
> >>
> >> command.CommandType = CommandType.Text;
> >>
> >> try
> >>
> >> {
> >>
> >> command.ExecuteNonQuery();
> >>
> >> return true;
> >>
> >> }
> >>
> >> catch (Exception)
> >>
> >> {return false;}
> >>
> >> finally
> >>
> >> {
> >>
> >> conn.Close();
> >>
> >> }
> >>
>

Monday, March 26, 2012

System.Net.Mail Error: Unable to read data from the transport connection: net_io_connectio

I've looked everywhere for an answer to this, but only a few people
seem to have encountered it.

The code is straightforward:

MailMessage mail = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient("localhost");
client.Send (mail);

The code works fine on my development machine (XP Pro). When moved to
staging (2003 Server), I get the "connection closed" error. I've
confirmed the following:

-- "localhost" resolves to 127.0.0.1 (also tried using the loopback
address with the same error)
-- SMTP service is running on port 25
-- service is configured to relay mail
-- another app (Community Server) is using the service to send email
without any problems.

I'm at wit's end

TIAAs usual, this problem was resolved out not long after posting this
message. The problem was how the SMTP service was set up.
Specifically, the service has been bound to a specific IP address (not
the webserver's; see the "IP Address" dropdown in the "General" tab).
Once this was set to "(All Unassigned)". Everything worked fine.
Hopefully this message will save someone the hours of aggravation I
endured.

nate.strules@.gmail.com wrote:

Quote:

Originally Posted by

I've looked everywhere for an answer to this, but only a few people
seem to have encountered it.
>
The code is straightforward:
>
MailMessage mail = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient("localhost");
client.Send (mail);
>
The code works fine on my development machine (XP Pro). When moved to
staging (2003 Server), I get the "connection closed" error. I've
confirmed the following:
>
-- "localhost" resolves to 127.0.0.1 (also tried using the loopback
address with the same error)
-- SMTP service is running on port 25
-- service is configured to relay mail
-- another app (Community Server) is using the service to send email
without any problems.
>
I'm at wit's end
>
TIA

Saturday, March 24, 2012

System.Net.Sockets.SocketException: An established connection was aborted by the software

Hello, I got this error today in an Application. This app is coded in asp.net 2, using VB. I have the Andri Code (http://makoto.madmedia.ca/2007/03/mysql-membership-and-role-provider-for.html) to connect asp.net with mysql. It has never caused errors in the past, I have the same configuration on another app that has been running for several months with no problem.

This app is new (1 week) and today is the first day I see this error.

Any ideas?

Server Error in '/' Application.
------------------------

An established connection was aborted by the software in your host machine
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.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine

Source Error:


Line 859:
Line 860:
Line 861: conn.Open();
Line 862: using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
Line 863: {

Source File: d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs Line: 861

Stack Trace:


[SocketException (0x2745): An established connection was aborted by the software in your host machine]
System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +1019099
MySql.Data.Common.SocketStream.Write(Byte[] buffer, Int32 offset, Int32 count) +22
System.IO.BufferedStream.FlushWrite() +21
System.IO.BufferedStream.Flush() +26
MySql.Data.MySqlClient.MySqlStream.Flush() +119
MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length) +114
MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName) +29
MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String database) +68
MySql.Data.MySqlClient.MySqlConnection.Open() +323
Andri.Web.MySqlMembershipProvider.ValidateUser(String username, String password) in d:\appfolder\App_Code\CSCode\MySQLMembershipProvider.cs:861
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213

Do you have a firewall on your machine? This may be preventing your app from accessing MySQL via TCP/IP.

One other problem where I received this error was when I built a client/server app, and one machine had IPv6 protocol installed but the other machine had IPv4 (same domain/network). When I changed both to IPv4, it worked.


Hello, I have other apps with the same configuration running in the same machine so I think the firewall is not an option.

This is not a standalone app, it is a web app.


Hi vialetti,

I am afraid to say that it seems a bug said from MySql community. Here is link:http://bugs.mysql.com/bug.php?id=6634

Hope this helps. Thanks.

System.Net.WebException: The underlying connection was closed:

Hi Tim,

From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?

From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:

WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse (textBox2.Text),comboBox4.
Text);

it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?

In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspxHi Tim,

Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

Thank you
Tim Reynold
Verizon
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed:

Hi Tim,

From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?

From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:

WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse (textBox2.Text),comboBox4.
Text);

it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?

In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspxHi Tim,

Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

Thank you
Tim Reynold
Verizon
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed:

Hi Tim,

From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?

From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:

WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse (textBox2.Text),comboBox4.
Text);

it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?

In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspxHi Tim,

Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

Thank you
Tim Reynold
Verizon
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:

1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true

2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue

If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.

In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,

Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed:

Team,
We have deployed a webservice (asmx.cs) to a server. We have created a windo
ws app (C# using visual studios.net 2003 Enterprise Arch) that refers to the
web service. In the windows app, we added the web reference - referring to
the ?wsdl file. The C# co
de is quite simple:
VOSEWebServicesDevW.WebServices WebSvcW = new VOSEWebServicesDevW.WebService
s();
returncode = WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse(textBox2.Tex
t),comboBox4.Text);
This works fine the first time- but when it sits a few minutes and we retry
, we receive...
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a send.
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReq
uest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String method
Name, Object[] parameters)
at TestWebServiceW.VOSEWebServicesDevW.WebServices.OMTestAddOrderXML(String
strCompany, Int32 intOrderNo, String strOrderType)
at TestWebServiceW.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, I
nt32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)
The project for the web service has a web.config file. I see no settings in
there of interest. I am new to this.
I would appreciate the guidance on what to do in the windows app C# code to
correctly access the web service on the team's server without having to clos
e & restart the windows app.
Thanks,
Tim Reynolds
VerizonHi Tim,
From your description, you've a ASP.NET webservcie and created a Winform
client app to consume it. However, when calling the webservice, you found
it worked well the first time but occured unexpected error the second time
after a few minutes, yes?
From the code you provided(calling the webservice), it seems all right and
I don't think the problem is likely in the client application. I'm not sure
about the webservice's detailed code logic in its webmethods but from the
method's signature:
WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse(textBox2.Text),comboBox4.
Text);
it takes simply type params, so I think we can test the webservice through
IE, open the certain url (http://...... .asmx) in the IE and call the
webservice thourgh it. It is better if you can use VS.NET to debug the
webservice on the serverside to see whether the problem also occured when
calling it from IE. If still remains, we can confirm that the problem is
not caused by the winform client , do you think so?
In addition, as for creating client application to consume webservice,
below is the related web link in MSDN:
#Creating Clients for XML Web Services
http://msdn.microsoft.com/library/e...atingclientsfor
webservices.asp?frame=true
Hope also helps. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,
Have you had a chance to view the suggestions in my last reply or have you
got any progresses on this issue? If there is anything else I can help,
please feel free to post here. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks for your reply. However, when I try to go directly to the ..asmx url
via IA, when I click on the name of the web service in order to test, I rec
eive this message - Test
The test form is only available for requests from the local machine. There
fore, I am unclear on how to proceed. The server is in another state so I ca
n't logon directly to it in order to test from my location. How shall I pro
ceed?
Thank you,
Tim Reynolds
Verizon
Hi Tim,
Any progress on this issue? If you have any problems on this or if there're
anything else I can help, please feel free to let me know. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Tim,
From your reply, you haven't the certain permission to logon the server
which host the webservice, yes? Then, I think we can do the following tests
on the webservice:
1. Creating a client proxy through the following guide(using wsdl.exe
rather than via VS.NET) and consume the webservice by the geneated proxy to
see whether the webservice still fail.
#Creating an XML Web Service Proxy
http://msdn.microsoft.com/library/e...atingWebService
Proxy.asp?frame=true
2. I'm not sure whether you have ever tried calling a webservice via
javascript(DHTML) in a webpage, if not, you may have a look at the
following reference:
#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/e...001.asp?frame=t
rue
If you're able to perform a test via the DHTML way, we can further confirm
whether the problem is with the serverside or not.
In addtion, you can create a simple webservice( similiar with the one
you're consuming, maybe just take 2 string parameters) on your local
machine or a remote machine which you have full control on it. And then
call it on the local machine to see whether the same problem occurs. If
not, that also probably proof that the problem is likely due to the
webservice's serverside processing.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

System.Net.WebException: The underlying connection was closed: An unexpected error occurre

I get this error intermittently while using a web service on my local machine.
----------------------------------------------------------
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. -->

System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. -->

System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers) --
End of inner exception stack trace --
at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers) at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers) at System.Net.Connection.Write(ScatterGatherBuffers writeBuffer) at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite) --
End of inner exception stack trace --
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QueuesUtilitiesWS.QueuesUtilitiesService.utilitiesGetHosts() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Temporary ASP.NET Files\website\d482aaa7\b121dbcb\bysspbbr.1.cs:line 50 at QManager.GetQInfo() in c:\MyData\Development\UPMC.2.0.net\Developers\dextdr\WebSite\QManager.aspx.cs:line 97
----------------------------------------------------------
I can't figure out what the problem is and most of the posts I've Googled don't seem to have a very good resolution either.
I'm using Whidbey beta 2
Thanks.
Doug
I have the same error. Please help me! Thanks!
"An established connection was aborted by the software in your host machine"
I have the same error. Who can help me? Thanks!
Hi there..
I have not found an answer to this problem yet.
Check this out though:

http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
Let me know if you figure it out and I will do the same.
God Bless.
Doug
Any luck on solving this problem?
We have a Reporting Services server and client program we have been running for a year. Lately, it is has been randomly failing with the same message.
I tried the keepalive fix but that is causing an access denied error. I then tried the fix for the 401 message in the MSDN knowledge base w/o success

//Create an instance of the CredentialCache class.
System.Net.CredentialCache cache =new System.Net.CredentialCache();

// Add a NetworkCredential instance to CredentialCache.

// Negotiate for NTLM or Kerberos authentication.
cache.Add(new Uri(rs.Url), "Negotiate",new System.Net.NetworkCredential("username", "password", "domain"));

//Assign CredentialCache to the Web service Client Proxy(myProxy) Credetials property.
rs.Credentials = cache;


Unhandled Exception: System.Net.WebException: The request failed with HTTP status 401: Access Denied.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at ReportManager.RsService.ReportingService.ListChildren(String Item, Boolean Recursive) in c:\webprojects.n
at ReportManager.ReportHelper.GetItemList(String rootPath, ItemTypeEnum[] typeList, Boolean recursive) in c:

Thanks!

Nope, not yet...
But our next step was to override the GetWebRequest method and set the KeepAlive property of the webrequest object to false:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
Check out the link above in my previous post...
Let me know if it works!
thanks
Doug

Ithinkwe've found that the problem is not as I previously thought.
The software architect pointed me in this direction:
--------------------------
Make sure that the URL property of the webservice object is set to the correct url.
IE:
public QueuesWS.QueuesService qSvc =new QueuesWS.QueuesService();
qSvc.Credentials = System.Net.CredentialCache.DefaultCredentials;
qSvc.URL = "http://localhost:7506/QueuesWS/QueuesService.asmx";
--------------------------
Itseems to have helped.
For now.
God Bless.
Doug


Nope.

Still not fixed.
I was wrong (again).


Followup to my original post:
I now believe there to be a resource consumption issue in Reporting Services when you are performing a large number of management actions through the web services. Our program creates links for many users/reports and sets permissions on their folders. When it gets to a certain, reproducible point (around 300 links), the error occurs for the next 120 seconds (like clockwork). After that we can continue on for another for ~300 links.
We adjusted every RS config variable we could w/o luck. Also, we checked everything we could using perfmon.
So, I swallowed my pride :) and added a sleep for 120 seconds after every 300 links. The program takes a little while longer but at least it runs to completion w/o each night.
Hope this helps someone.
Mike

System.NullReferenceException

I hope this is the right forum section. I am a getting started. Please take a look at this I can't seem to get this data connection to work.

Sub Page_Load()
Teamlist.Datasource = getteams
teamlist.databind()
End Sub

Function GetTeams() As System.Data.IDataReader
Dim connectionString As String = _
ConfigurationSettings.AppSettings("connectionstring")
Dim dbConnection = ConfigurationSettings.AppSettings("connectionstring")

Dim queryString As String = "SELECT [Teams].[TeamID], [Teams].[TeamName], [Teams].[Notes] FROM [Teams]"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

dbConnection.Open
Dim dataReader As System.Data.IDataReader = dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

Return dataReader
End Function

Now I get this:
Exception Details: System.NullReferenceException: Object variable or With block variable not set.

Source Error:

Line 21: dbCommand.Connection = dbConnection
Line 22:
Line 23: dbConnection.Open
Line 24: Dim dataReader As System.Data.IDataReader = dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Line 25:

Here is the contents of my web.config

<?xml version="1.0" encoding="UTF-8" ?
<configuration
<!--

The <appSettings> section is used to configure application-specific configuration
settings. These can be fetched from within apps by calling the
"ConfigurationSettings.AppSettings(key)" method:

<appSettings>
<add key="connectionstring"
value="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4;
Data Source=C:\begaspnet11\wroxunited\database\wroxunited.mdb"/>
</appSettings
--
<system.web
<!--

The <sessionState" section is used to configure session state for the application.
It supports four modes: "Off", "InProc", "StateServer", and "SqlServer". The
later two modes enable session state to be stored off the web server machine -
allowing failure redundancy and web farm session state scenarios.

<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;trusted_connection=true"
cookieless="false"
timeout="20" /
--
<!--

The <customErrors> section enables configuration of what to do if/when an
unhandled error occurs during the execution of a request. Specifically, it
enables developers to configure html error pages to be displayed in place of
a error stack trace:

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
<customErrors
--
<!--

The <authentication> section enables configuration of the security authentication
mode used by ASP.NET to identify an incoming user. It supports a "mode"
attribute with four valid values: "Windows", "Forms", "Passport" and "None":

The <forms> section is a sub-section of the <authentication> section,
and supports configuring the authentication values used when Forms
authentication is enabled above:

<authentication mode="Windows"
<forms name=".ASPXAUTH"
loginUrl="login.aspx"
protection="Validation"
timeout="999999" /
</authentication
--
<!--

The <authorization> section enables developers/administrators to configure
whether a user or role has access to a particular page or resource. This is
accomplished by adding "<allow>" and "<deny>" sub-tags beneath the <authorization>
section - specifically detailing the users/roles allowed or denied access.

Note: The "?" character indicates "anonymous" users (ie: non authenticated users).
The "*" character indicates "all" users.

<authorization>
<allow users="joeuser" />
<allow roles="Admins" />
<deny users="*" />
</authorization
--
</system.web
</configuration>Hi,
Which line throw an error?
One problem I can see in your code is connection scope. DataReader can not be used if associated connection is closed. In your case connection (attached to command object) exists in scope of GetTeams scope and you are using DataReader out of this scope. It is wrong.
Line 23
dbconnection.open
Change this:


Dim dbConnection = ConfigurationSettings.AppSettings("connectionstring")

to:

Dim dbConnection as New SqlConnection()
dbConnection.ConnectionString = ConfigurationSettings.AppSettings("connectionstring")

dbConnection should be declared in the same scope where you are using associated datareader (see my previous reply)
1. Appreciate you working with me.

2. I'm using a Access mdb for this. How do that change this:

Dim dbConnection as New SqlConnection()

dbConnection.ConnectionString = ConfigurationSettings.AppSettings("connectionstring")

Thanks!
Rich
Sorry, I did not realize it is OleDb. Use this instead:


Dim dbConnection as New OleDbConnection()
dbConnection.ConnectionString = ConfigurationSettings.AppSettings("connectionstring")

Thanks but I got the same error.

The ConnectionString property has not been initialized.
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.InvalidOperationException: The ConnectionString property has not been initialized.

Source Error:

Line 25: dbCommand.Connection = dbConnection
Line 26:
Line 27: dbConnection.Open
Line 28: Dim dataReader As System.Data.IDataReader = dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Line 29:

Source File: C:\begasnet11\wroxunited\teams.aspx Line: 27

Stack Trace:

[InvalidOperationException: The ConnectionString property has not been initialized.]
System.Data.OleDb.OleDbConnection.Open() +203
ASP.teams_aspx.GetTeams() in C:\begasnet11\wroxunited\teams.aspx:27
ASP.teams_aspx.Page_Load() in C:\begasnet11\wroxunited\teams.aspx:9
System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +10
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Page.ProcessRequestMain() +731

------------------------

Dim dbConnection as New OleDbConnection(ConfigurationSettings.AppSettings("connectionstring"))
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand("SELECT [Teams].[TeamID], [Teams].[TeamName], [Teams].[Notes] FROM [Teams]", dbConnection)
Constructors are faster than instantiating and then initializing (admittedly you won't be noticing the speed gain, but still, it's good to have performance in mind at all times).
Still nothing. I've tried this on 2 diffrent computers. Grasping at straws.

Same error.

Thanks!
Rich
Was this statement (dbConnection.ConnectionString = ConfigurationSettings.AppSettings("connectionstring") ) executed?
If it was, check dbConnection.ConnectionString value in debugger. May be Config file entry was not read correctly.
I set debug to true and this is what I got in addition to the same error

[InvalidOperationException: The ConnectionString property has not been initialized.]
System.Data.OleDb.OleDbConnection.Open() +203
ASP.teams_aspx.GetTeams() in C:\begasnet11\wroxunited\teams.aspx:26
ASP.teams_aspx.Page_Load() in C:\begasnet11\wroxunited\teams.aspx:10
System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +10
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Page.ProcessRequestMain() +731
Man I feel so dumb. OK here it is. The <appsettings> in the webconfig file was commented out. I removed the comment tags and bang.

Thanks everyone!!
Does it matter if this is in a folder or a virtual directory? Does the web config file need a virtual directory to work in like a global asa?