I noted my form takes awhile to load after an initial Message box requesting the user confirm a new session or not.
Looking through it, it appears that the delay occurs at this part:
Program.cs:
Now, I like the fact that the connection is being tested, but I dislike that the form takes a good 20 secs to load while it does this (connection isn't local). There is a thread here - Resolved - just close application?
Where I first discussed the problem.
I would like for the form to load, and if the sql test fails, then provide a messagebox and then close as the form shouldn't be used without that connection - I just think it is bad to load an application and then have nothing happen for awhile....I would rather that it loaded and then if necessary booted the user out and closed.
Given the issues I had before, I thought I would ask and see if anyone had any ideas. Thanks.
Looking through it, it appears that the delay occurs at this part:
Program.cs:
C#:
static void main()
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fale);
If (SqlTest(@"...connectionstring....")
Application.Run(new Form1());
private static bool SqlTest(String connectionString)
// check whether a connection has been made return false if no connection
Now, I like the fact that the connection is being tested, but I dislike that the form takes a good 20 secs to load while it does this (connection isn't local). There is a thread here - Resolved - just close application?
Where I first discussed the problem.
I would like for the form to load, and if the sql test fails, then provide a messagebox and then close as the form shouldn't be used without that connection - I just think it is bad to load an application and then have nothing happen for awhile....I would rather that it loaded and then if necessary booted the user out and closed.
Given the issues I had before, I thought I would ask and see if anyone had any ideas. Thanks.