Wednesday, October 13, 2010

Connect Oracle and Visual Studio 2008 (ASP.NET)

Here it is to connect the ASP.NET application(website) to Oracle database server. First you create a new website from File->New->Website->ASP.NET Website. Then from Tools menu select Connect to a database. Select data source as Oracle database, and .NET Framework data provider for Oracle as data provider. Then provide the necessary details to connect to the oracle database, including Server name (the SID, if the local database itself, for e.g:- orcl). Then you can test the connection, for e.g:- I filled the details as user name to hr and password to hr and finally the database orcl as Server name, then clicked the Test Connection button, I got the message test connection succeeded. Then I tested the same without providing the user name and password, I got the message ORA-01017:Invalid user name/password; logon denied. If your connection is got Ok, then you can see the SID.user (e.g.:- orcl.hr), listed in Server Explorer-> Data Connections. And the list of tables and other details you can browse from their itself.

No comments:

Post a Comment