Search This Blog

February 24, 2013

Data source name for Oracle 11g in Visual Studio is host name and service name

Before I worked on this project, I talked to my colleagues to provide the data source for Oracle 11g database because I wanted to use Visual Studio 2010 to connect to Oracle 11g and wrote a simple unit test.

They didn’t know what data source name looked like in Oracle 11g.  They showed me the configuration in Oracle SQL Developer. I talked to them: In SQL Server, you can use server name\instance name (ie. Test1\sst01) as a data source name. How about Oracle?  They felt so confused.

I can see host name and service name in Oracle SQL Developer. But what the data source name looks like in Oracle 11g ?

After several attempts, I found data source name = host name/ service name  and connection name can be anything else.

The interest part is that SQL Server uses “\”, but Oracle uses “/” as a data source name.

Next time if you like to connect to Oracle 11g via Visual Studio, you can try this way.

No comments: