Windows Vista Error when program started
Hello
I just completed the first phase of developling a windows application, and on loading the application on my windows vista i somtimes get error from vista tell me that the program has stopped working, this occurs when i have lots of programs running. now i ran this on my VS in debug mode and what i noticed brougth up the debuging tool was the constructor of my startup form, which a connection to a database is attached, somtimes it times out in an attempt to connect, thats when the debug comes up, so i did a try catch code for this and created a recursive statment in the catch, but still i get that vista problem when i deploy the apps., although i dont get the debug comin up when i run the app from VS. please can anyone tell me what to do.
Here is the code of the constructor of my first page
public Processor()
{
Connectme = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MyBase.mdf;Integrated Security=True;User Instance=True";
Command = "SELECT*FROM table01";
ConnectDatabase();
}
public void ConnectDatabase()
{
try
{
myconnect.ConnectionString = Connectme;
OpenDatabase();
}
catch (Exception e)
{
CloseDatabase();
myconnect.ConnectionString = Connectme;
ConnectDatabase();
}
myadapter = new SqlDataAdapter(Command, Connectme);
mybuilder = new SqlCommandBuilder(myadapter);
table01 = new DataTable();
myadapter.Fill(table01);
}