HELP!!!! SQLEXPRESS and Connection Issue


Author
Message
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)StrataFrame User (245 reputation)
Group: Forum Members
Posts: 153, Visits: 462
I was using the 6 month trial on SQL 2008 and had to create the same database in SQL Express 2008. Both are identical with the same user ID and password to get into that database for both. When I set the default connection to SQL 2008 and start my application the log in appears instantly. When I set the default connection to SQL Express when I start the app there is a 60 second delay and then the Connect Manager appears. I simply SELECT the default connect of SQL Express and the login instantly appears. What can be going on? It is almost as though the delay is some kind of a timeout in relation to SQL EXpress that then causes the Connect Manager to appear. I am running the latest version of StrataFrame
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Well, the most obvious thing to me is that you are trying to make a call to a database through a BO before you have ever set the connection string.  I will scan through all of the code that you posted, but this is a red flag:


//-- ToDo:  Configure the security settings
                //--------------------------------------------
                //-- Retrieve the global preferences
                try
                {
                    SFSPreferencesBO.RetrieveSecurityPreferences();
                }
                catch
                {
                        if (ConnectionManager.ShowAvailableConnectionStrings())
                        {
                            // Set the connections
                            ConnectionManager.SetConnections();


                            SFSPreferencesBO.RetrieveSecurityPreferences();
                        }
                }


In this code, you are placing a try/catch around attempting to retrieve the security preferences.  If you don't have your connection string set by this point, a try catch in this scenario isn't going to help and you are just going to make the end-user wait for a while as it times out.

I think that you are making this diagnosis far harder than it needs to be.  Go back to your program.cs and open the SetDataSources method.  Instead of calling SetConnections, manually specify the connection string just as you try and diagnose what is going on here.  This way you are not relying on the ConnectionStringWizard, but have hard coded the connection string.

MicroFour.StrataFrame.Data.DataBasics.DataSources.Add(new SqlDataSourceItem(string.Empty,"MyHardCodedConnectionString"));


If you aren't familiar with connection strings, here is a sample that specifies the password:

MicroFour.StrataFrame.Data.DataBasics.DataSources.Add(new SqlDataSourceItem(string.Empty,"server=MySqlServer;user=sa;password=MyPass;database=MyDatabase;"))


Here is a connection string that uses Windows authentication:

MicroFour.StrataFrame.Data.DataBasics.DataSources.Add(new SqlDataSourceItem(string.Empty,"server=MySqlServer;integrated security=SSPI;database=MyDatabase;"))


After you do this and get it working, then clear our the connections.dat again.  Then put back in the code that has the SetConnections();.  After this, if you still are not working, then turn on the debugging on the connection.  This will output an HTML file giving you all of the queries taking place and this will 100% clue you in.

MicroFour.StrataFrame.Data.DataBasics.DataSources[string.Empty].SetDebugOn(@"c:\output.html", true, true);


In the above code snippet, I like adding that last "true" as it will show a message reminding you that you have debug mode on.  It really stinks when you leave this on in a run-time environment by accident. Smile

And finally, as you have learned the hard way, I never recommend installing a trial version of anything in a production environment because it seems to expire and have issues causing down-time.  I too have learned this the hard way. Wink
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ross L. Rooker, Sr. - 13 Years Ago
Edhy Rijo - 13 Years Ago
Keith Chisarik - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Ivan George Borges - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Trent L. Taylor - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago
Ivan George Borges - 13 Years Ago
Ross L. Rooker, Sr. - 13 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search