Having a great deal of frustration trying to get this to really work with an Oracle 9i database.I will try to go into detail to see what I am missing:
Oracle has a TNSNAMES.ORA file that looks like this:
TRAC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = medsvr)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = Trac)
)
)
The Host = medsvr goes to the host file where the ip for the server is found.
When I create a project I add a reference to the System.data.oracleclient assembly.
I create a business object and configure the project properties to look like this:
Data Source=Trac;User ID=medselect;password=tceles
I configure the business object properties and use Oracle. It knows all the tables.
Build the partial class and everything seems ok.
This is in the program.cs SetDataSources:
ConnectionManager
.AddRequiredDataSourceItem("", "SQL Connection",DataSourceTypeOptions.SqlServer, "MyDatabase", "This connection is used by WindowsApplication1.");// Oracle ConnectionConnectionManager.AddRequiredDataSourceItem("MedSelect", "Oracle Connection", DataSourceTypeOptions.Oracle, "Trac", "This connection is used by WindowsApplication1.");Just for a test I hook into the ParentFormLoading and do the following query on the Users table this business object is associated with:
FillDataTable(
"Select * from Users");I build and try to run and get exception:
{"Cannot open database \"MyDatabase\" requested by the login. The login failed.\rLogin failed for user 'YOUR-72486D6880\\hp1'."}
WHAT IS GOING ON?