I have a small problem that is not crucial but is a bit annoying. I have been using your components for a WinForms application.
I am usign the InterFormLink component (wich is great by the way!!) and only 1 OracleConnection component for all my solution. The connection string is define in the app.config.
When the program excecutes, it shows a login form and ask the user for credentials. Those credentials should open the ConnectionString mentioned above. In other words, my users are OracleSchemas. This way i have security integrated with Oracle.
The problem is that the OracleConnection harcoded in the Designer.cs code so i cannot changed.
Is there a way to overcome this problem?
ConnectionString in app.config
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
You can set a reference to the connection put on another form either at design-time or at run-time. At design-time you can refer to the connection by some other component (like OracleDataTable) and then edit OracleDataTable.Connection. At run-time you can get the connection directly like this:
Please let us know if this helped.
Code: Select all
OracleConnection con = (OracleConnection)Devart.Common.GlobalComponentsCache.GetObjectByName ("YourDataForm.YourConnection");
Your solution works fine, but the i have the problem of setting all the Connections again for every DataTable i have.
This may cause error, because if i don`t set the OracleConnection, everything will run ok, because it is still taking the connection of the designer.
But on a production enviorment will not work.
What i wanted to do, was to be able to change the Connection that the designer is using at runtime.
This may cause error, because if i don`t set the OracleConnection, everything will run ok, because it is still taking the connection of the designer.
But on a production enviorment will not work.
What i wanted to do, was to be able to change the Connection that the designer is using at runtime.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please send us a small project with the problem?
As far as I could understand, you are using the only OracleConnection for multiple DataTables and this connection is somehow set at design-time. Since OracleConnection is a reference type, its properties can be changed once in any DataTable.Connection and this will affect all other DataTables. Please let me know if I've missed something.
As far as I could understand, you are using the only OracleConnection for multiple DataTables and this connection is somehow set at design-time. Since OracleConnection is a reference type, its properties can be changed once in any DataTable.Connection and this will affect all other DataTables. Please let me know if I've missed something.