Table of Contents
This assignment is divided into two sections: creating database with SQL scripts and reading data with SQL client.
- The SQL scripts to create a database is located in the 'Backend_Assignment_2_Appendix_B' folder. It holds one individual SQL script containing all the sequantial SQL queries, and in the 'SqlScripts' folder it has all the commands in separate SQL scripts. These queries allow you to create a database, setup some tables in the database, add relationships to the tables, and then populate the tables with data. The database and its theme are surrounding superheroes.
- The ChinookReader is located in the 'Backend_Assignment_2_Appendix_B' folder. It holds a C# console application that connects to a local database (Chinook) and executes CRUD queries. The app also uses the implementation of the repository pattern and is used to interact with the database.
Download and install:
Creating the database can be done in three ways:
- Open in Visual Studio the 'Backend_Assignment_2_Appendix_A.cs.proj' solution. Run the program by clicking on F5 or on start debugging.
- Open the '10_completeScript.sql' file in MSSM and execute it.
- Open the 'SqlScripts' folder and open the individual files and execute them in order.
-
Create Chinook database by executing the Chinook_SqlServer_AutoIncrementPKs.sql file with SQL Server Management Studio.
-
Navigate to Backend_Assignment_2_Appendix_B/DataAccess/ and open SqlHelper.cs file and change DataSource to your own server name.
You can find this name in SQL Server Management Studio:- Right click on your server inside the Object Explorer
- Click on Properties
- Copy the value of the Name field
-
Open in Visual Studio the 'Backend_Assignment_2_Appendix_B.csproj' solution. Run the program by clicking on F5 or on start debugging.
@AhmadKhodabaks
@Richard Stølen
PRs accepted.
Small note: If editing the Readme, please conform to the standard-readme specification.
MIT © Richard Stølen, Ahmad Khodabaks