Probably not the best way, but from Visual Studio:
- Open the Server Explorer panel
- Click "Connect to Database"
From here, there are two options depending on whether the database above was created for SQL Server or as a SQL Express file.
- If the database came from a SQL Express .mdf file, select "Microsoft SQL Server Database File (SqlClient)" as the data source, and browse for the .mdf file.
OR
- If the database resides in SQL Server, change the data source to "Microsoft SQL Server"
- Enter localhost as the server name. This should enable the dropdown list under "Select or enter a database name."
- Select Test1 from the drop down.
You should now see Test1 under data connections in the Server Explorer pane, finally:
- Right click on it and select properties.
- In the properties pane, you will see the Connection String which you can use to connect to the database with code in your project. From here, it depends on what type of project you have.