This section describes how to connect to a database.
x
Procedure: How to Create a Database Connection
To create a database connection:
-
In the File Explorer, right-click the Databases node,
and click New, Database Connection,
as shown in the following image.
The New Database Connection
dialog box opens, as shown in the following image.
-
From the Database type drop-down list, click the type
of database to which you are connecting.
-
In the Connection name field, type a name for the new
database connection.
-
Select By fields or By URL.
- By fields. Specify the host, port, and database name
in the corresponding fields.
- By URL. Specify a connection string to connect to the specified
database type.
-
Complete the required fields.
-
To connect to the database, click Finish.
After the database connection has been made, the database
is shown in the Databases node in the File Explorer.
-
Click a table name to show metadata for that table in
the Properties panel.
-
To display the results of an SQL query on a table, right-click
a table, and click Open in SQL editor.
The SQL editor opens, as shown in the following image.
A default query is
shown, listing all table entries. Table entries are grouped in batches
if the number of rows is large.
-
To change the query, edit the query text, and click the Execute button.
-
To retrieve additional rows from the query, click Next batch,
or to show all results, click Read rest.