I have a .NET Windows form (C# code) in which I execute a query using the MS Data Application Block in the form's Load event and populate a grid on the form. This all works fine. But executing the query code in the form's Load ( or the Constructor ) seems to corrupt something since subsequently launching common dialogs ( e.g. FolderBrowserDialog or OpenFileDialog) from a button click does not work properly. The FolderBrowserDialog opens but the folder tree control does not appear on the dialog form. Launching the OpenFileDialog causes a terminal wait state and the hourglass appears. Task manager says the application is not responding and the process has to be terminated.
This seems to have something to do with launching the query from the form Load (or Constructor), since eliminating the query launch in the Load or Cosntructor and instead launching the query from a button click on the form after form instantiation allows the common dialogs to work properly.
Interestingly, however, I have another application similar to this one but all queries are launched from button clicks. I tested this application by launching one of the queries and populating a grid in the form Load, then launching the FolderBrowserDialog from a button click and it works properly. Go figure. :-|
Has anyone seen anything like this, and knows the cause and the cure?
Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.