Learn how to connect to a SQL Server database using the ADO.NET data providers for C#.
Useful Links:
Code sample with Database script:
https://github.com/thecodebiteschannel/ConnectingToSQLServer
The Connection Strings Reference:
https://www.connectionstrings.com
To download Visual Studio 2019:
https://visualstudio.microsoft.com
Topics:
00:00 Intro
00:12 Getting started
00:22 Sample database: tables and data
01:02 Creating the sample application that will connect to the database
01:28 How to import the System.Data.SQLClient namespace?
02:10 The necessary classes: SQLConnection, SQLCommand, SQLDataReader.
02:48 What is a connection string?
03:35 How to add a connection string to your code?
04:02 Step 1: Create and configure a SQLConnection object.
05:41 Step 2: Create and configure a SQLCommand object.
07:08 Step 3: Retrieve data using a SQLDataReader object.
08:35 How to output retrieved data?
10:15 How to keep the console application open?
10:29 Run and test your application.
10:51 Thank you and Subscribe!
Download
0 formats
No download links available.
How to connect to a SQL Server Database in C# (using ADO.NET data providers) | NatokHD