Connecting to an Oracle database in Visual Studio

Note the instructions below assume you already have a database setup on the Oracle server you want to connect to. Please see the Oracle support pages for details on how to get an Oracle database setup for your use.

To connect to your Oracle database bring up Server Explorer either by clicking on the tab next to the Toolbox or by going View > Server Explorer. Right click on ‘Data Connections’ then click ‘Add Connection…’

On the next screen (titled ‘Choose Data Source’) change the data source by ensuring ‘Oracle Database’ is selected then click the ‘Continue’ button.

Screenshot: Connecting to SQL Server

For the ‘Server name’ enter obiwan or quigon, then enter your username and MySQL password (for obiwan or quigon respectively) in the relevant fields. E.g. to connect to quigon, user sj593 would enter the following:

Screenshot: Connecting to SQL Server

Click the ‘Test Connection’ button to ensure you have entered the correct details

Assuming that you get told the test connection succeeded, click the ‘OK’ button to exit the ‘Add Connection’ wizard and you will have added a connection to the database that will appear under ‘Data Connections’ in ‘Server Explorer’, and you can then setup an SQLDataSource using this connection.

Screenshot: Connecting to SQL Server

You can then setup a SQLDataSource using this connection, and use it to populate data controls such as a grid view, etc. as shown:

Screenshot: Connecting to SQL Server


Comments are closed.