In all lessons with a SQL Server database connection, you will have a Connection string supplied to you with the database and table SQL scripts so that you can follow along with the code provided in the lesson.
(The names below will change depending on the lesson you are doing, but all will be similar)
SQL Server.
[Step 1]:
  1. Create a new Database named [Test]
  2. Right-click on [Databases]
  3. Choose [New Database]
  4. When Dialog opens - Database Name: Test
  5. Choose [OK]
[Step 2]:
  1. Create a new SQL Server Database user named [testuser]
  2. Right-click on [Security]
  3. Choose [New] | [Login]
  4. Login name: testuser
  5. Select [SQL Server authentication]
  6. password: testuser
  7. confirm password: testuser
  8. Under [Select a page]
  9. Choose [Server Roles]
  10. Add a check to [sysadmin]
  11. Next - Choose [User Mapping]
  12. From the [User mapped to this login]
  13. Choose the [Test] database.
  14. Click [OK]
[Step 3]:
Right-click on the new database [Test]
Choose [New Query]
Copy and paste the code from the [SQL] tab into the Query window, and click on [Execute]
You should now have a table called Tags with nine records.
[Step 4]:
Create our connection string to our newly created database.
In a new file, copy and paste the code.
Classic ASP
Top of the [ASP] tab and save the file as [ACN.asp]
Top of the [ASP.NET] tab and save the file as [database.config]
The items below need to be changed to your system specs.
  1. [getServer] = this is the Computer (or) Server name.
  2. [getInstance] = This is the SQL Server instance name.
  3. [getID] = Username of the SQL User
  4. [getPW] = Password of the SQL User
  5. [getCat] = The name of the Database
Classic ASP (Copy and paste and save as ACN.asp)
[ACN.asp]
CFFCS | CarrzSynEdit: | ASP/VBScript

username = "USERNAME"
password = "PASSWORD"
(ALWAYS-ON-LISTENER = This is the listener name if you have set up the "Always On High Availability" Group)
getSerInstance = "ALWAYS-ON-LISTENER,2433" (OR) "SERVER-NAME\INSTANCE-NAME"
Set siteconn = CreateObject("ADODB.Connection")
siteconn.Open("Provider=SQLOLEDB; Data Source="&getSerInstance&"; Initial Catalog=New-CS;User ID="&username&";Password="&password&";")

VB and C# (Copy and paste and save as database.config, then refer to this file from Web.config)
[database.config]
CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)

<?xml version="1.0"?>
<connectionStrings>
  <add name ="Virtual-Learning" connectionString="Data Source=sqlcorecs-01\sql2019;Database=Virtual-Class-01;User ID=testuser;Password=testuser;MultipleActiveResultSets=True"/>
</connectionStrings>