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 below names will change depending on the lesson you are doing, but all will be similar)
Create a new Database named, [Test
Right-click on [Databases
Choose [New Database
When Dialog opens.
Database Name: Test
Create a new SQL Server Database user named , [testuser
Right-click on [Security
] | [Login
Login name: testuser
Select [SQL Server authentication
confirm password: testuser
Under [Select a page
Choose [Server Roles
Add a check to [sysadmin
Choose [User Mapping
From the [User mapped to this login
Choose the [Test
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.
Create our connection string to our newly created database.
In a new file, copy and paste the code.
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 below items need changing to your system specs.
- [getServer] = this is the Computer (or) Server name.
- [getInstance] = This is the SQL Server instance name.
- [getID] = Username of the SQL User
- [getPW] = Password of the SQL User
- [getCat] = The name of the Database
Classic ASP (Copy and paste and save as ACN.asp)
VB and C# (Copy and paste and save as database.config, then refer to this file from Web.config)