Connection Wizard appearing


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
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();

 


Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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!
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
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)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search