Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

App crash in debugger while stepping through exception handler

Status
Not open for further replies.

recurse

Programmer
Sep 4, 2001
10
0
0
US
I am doing a pretty vanilla connection to a SQL Server. (The code follows)

String strSQL = "";

//get the connection
try
{
strSQL = "data source=" + txtServer + ";initial catalog=" + strDatabase + ";persist security info=False;user id=sa;packet size=4096";
cn = new SqlConnection(strSQL);
//open the connection to make sure all is well
cn.Open();

//just close it now, let the app deal with opening it when needed
cn.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
throw(new Exception("Unable to connect to database."));
}

The problem is this:
When testing the error handler (disconnecting from the network and trying to log in) I get an "Out of memory" error, or if I try to put a break point on a line in the catch block, the debugger will crash after a few seconds with no error.

Gah!

Any suggestions? Has anyone else ever seen this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top