My application has a feature to connect to 4 different database servers (MS SQL, MySql, SQLite and Oracle), and if no database exists, it will create a new one with the specified database name. This logic works on all servers, except on Oracle. If the database exists, i can connect to it on all four servers, so i think the problem is not related to my tns, or wrong dll, or anything like that, but maybe my connectionstring is wrong in this case.
The Oracle server version is 11.0.0.1, and i installed the necessary odac drivers. There is a tns set on my pc and everything is working properly when the database exists. In this case the connectionstring looks like this:
User Id=<myuser>; Password=<mypassword>; POOLING=true; Connection Lifetime=15;
Connection Timeout=15; incr pool size=10; Data Source=
(
DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=<myserveraddress>)
(PORT=<myport>)
)
(
CONNECT_DATA=
(SID=<mysid>)
(SERVICE_NAME=<mydatabasename>)
)
);
Now, if i remove the servicename section from the connectionstring, i get an "ORA-12505: TNS:listener does not currently know of SID given in connect descriptor" exception.
What should i do when i only want to connect to a server, but not directly to a database?