File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ ms.topic: quickstart
10
10
author : stevestein
11
11
ms.author : sstein
12
12
ms.reviewer :
13
- ms.date : 03/25 /2019
13
+ ms.date : 12/31 /2019
14
14
---
15
15
# Quickstart: Use .NET and C# in Visual Studio to connect to and query an Azure SQL database
16
16
@@ -95,7 +95,6 @@ Get the connection information you need to connect to the Azure SQL database. Yo
95
95
Console .WriteLine (" \n Query data example:" );
96
96
Console .WriteLine (" =========================================\n " );
97
97
98
- connection .Open ();
99
98
StringBuilder sb = new StringBuilder ();
100
99
sb .Append (" SELECT TOP 20 pc.Name as CategoryName, p.name as ProductName " );
101
100
sb .Append (" FROM [SalesLT].[ProductCategory] pc " );
@@ -105,6 +104,7 @@ Get the connection information you need to connect to the Azure SQL database. Yo
105
104
106
105
using (SqlCommand command = new SqlCommand (sql , connection ))
107
106
{
107
+ connection .Open ();
108
108
using (SqlDataReader reader = command .ExecuteReader ())
109
109
{
110
110
while (reader .Read ())
You can’t perform that action at this time.
0 commit comments