December 2019
Intermediate to advanced
494 pages
11h 41m
English
Let's make a connection and print our data using ADO.NET. Create a new .NET Core console application using Visual Studio 2017. In .NET Core, it's necessary to install the System.Data.SqlClient package using NuGet. This package contains the necessary classes, such as SqlConnection and SqlCommand, which have been around since the very first version of .NET:
using System;using System.Data;using System.Data.SqlClient;namespace AzureSqlConnectionConsole{ internal class Program { private static void Main(string[] args) { using (SqlConnection connection = new SqlConnection("Server=tcp:[your server].database.windows.net,1433;" + "Initial Catalog=migrationdb;Persist Security Info=False;" + "User ID=[your username];Password=[your ...