Newbie SetConnection help


Author
Message
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)
Group: Forum Members
Posts: 41, Visits: 259
I'm working my way through the tutorials and have hit a snag trying to establish a db connection. If I use the following...



ConnectionManager.ApplicationKey = "App1";

ConnectionManager.ApplicationDefaultTitle = "App1 Connection";

ConnectionManager.ApplicationDefaultDescription = "This application connection is used by App1";



ConnectionManager.SetConnections();





then the application starts, brings up the Connection Wizard, I enter the Oracle connection info (for TNSNAMES, etc.) and then bombs with the following message



The program '[2308] App1.exe: Managed' has exited with code -1073741819 (0xc0000005).




But, if I use the following...





ConnectionManager.ApplicationKey = "App1";

ConnectionManager.ApplicationDefaultTitle = "App1 Connection";

ConnectionManager.ApplicationDefaultDescription = "This application connection is used by App1";



DataLayer.DataSources.Add(new OracleDataSourceItem("", "Data Source=STSGEO;user id=abc;password=xyz;"))





it works! Any help is much appreciated!!!





Aaron Young
Aaron Young
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I am no expert on this but it sounds like the Connection Wizard is not saving the connection string. I have seen this before on Vista so, if you are running Vista, try running your application as Administrator and see if the connection string is saved.



Aaron
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You are missing the AddRequiredDatasource calls.  You have to tell the connection manager what data sources are expected.

ConnectionManager.ApplicationKey = "App1";
ConnectionManager.ApplicationDefaultTitle = "App1 Connection";
ConnectionManager.ApplicationDefaultDescription = "This application connection is used by App1";

ConnectionManager.AddRequiredDataSourceItem("", "Oracle Connection",
                DataSourceTypeOptions.Oracle, "MyDatabaseName", "This connection is used by App1.");

ConnectionManager.SetConnections();


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