Connection Wizard appearing
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Connection Wizard appearingExpand / Collapse
Author
Message
Posted 05/12/2008 3:14:31 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/01/2008 3:59:05 PM
Posts: 34, Visits: 95
In the sample as soon as the statement: StrataFrameApplication.RunApplication();  executes, if the connection info is not found, the connection wizard appears. The project I am working on, the client wants to suppress the wizard from appearing but bring up a form to tell the user to contact the administrator. Is there a way to intercept the logic before the connection wizard displays.

The sample I am referencing is in the program.cs in the security sample.

StrataFrameApplication.ShowLoginAndInitializeForm +=

new StrataFrameApplication.ShowLoginAndInitializeFormEventHandler(

ShowLoginAndInitMainForm);

//-- Run the application

StrataFrameApplication.RunApplication();

 

Post #16342
Posted 05/12/2008 5:15:19 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 07/01/2008 3:59:05 PM
Posts: 34, Visits: 95
To further clarify when the Application Run occurs the method SetDataSources() executes first and the command: ConnectionManager.SetConnections(); executes. If the connection is not found, that is when the Database Connection Wizard form appears. My question is whether I could test the result before the Connection Wizard appears and then decide whether to go ahead and display the Connection Wizard or to bring up a form informing the user that they need to contact their administrator.
Post #16343
Posted 05/12/2008 5:38:56 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
SetConnections() does not return any thing, so I don't think you can change this. I.e. SetConnections() will show the wizard if the connections aren't found in the cached connection file on the user's machine.

Which means that either they would have to use the wizard at least once OR you would have to distribute this file.

There are other ways, however. Most of the time you'll actually manage the connection yourself, using the DataLayer.DataSources() collection. This allows you lots of flexibility in how you set the connection. You might search the forum for this, as there are some excellent posts on how this can be done.

Hope that helps!
Post #16344
Posted 05/13/2008 9:21:48 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 8:47:41 AM
Posts: 4,104, Visits: 4,175
SetConnections just lines it all up for you.  You can just call the GetActiveConnection strings and manually set the connection. 

If ConnectionManager.GetApplicationActiveConnectionString("MyKey", "").Length > 0 Then
    '-- You have an active connection
End If

Once you have the connection string you can just manually add it to the datasources collection:

MicroFOur.StrataFrame.Data.Databasics.DataSources.Add(New SqlDbDataSourceItem("",MyConnectionString)
Post #16356
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 10:05am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.