Question: Write C# code to retrieve data from a SQLite database and display it to a console application. In this current assignment as well as the

Write C# code to retrieve data from a SQLite database and display it to a console application. In this current assignment as well as the next two assignments, use the open source chinook database. This database contains a table structure found in many business applications.
Download a ZIP archive containing this database(opens in a new tab).
This ZIP file contains several different files. Use the file named Chinook_Sqlite_AutoIncrementPKs.sqlite.
Earlier in the lesson, you set up a connection string that looks like this:
@"Data Source=C:\Sqlite\BikeShop.db; datetimeformat=CurrentCulture;";
Place the chinook database in the C:\Sqlite directory. This means your connection string will look like this:
@"Data Source= C:\Sqlite\Chinook_Sqlite_AutoIncrementPKs.sqlite; datetimeformat=CurrentCulture;";
The instructor can change the directory within your application to grade your assignment.
On this assignment, you will need to retrieve all rows from the customer table as well as the invoice table.
Retrieve the following columns from the customer table:
CustomerId (int)
FirstName (string)
LastName (string)
Country (string)
Email (string)
You will need to retrieve the following columns from the Invoice table:
InvoiceId (int)
CustomerId (int)
InvoiceDate (datetime)
Total (decimal)
Create a console application that displays the data from each row. For example, the output for the customer table would look like this (the data may differ):
CustomerId: 1 FirstName: John LastName: Smith Country: Brazil
--Please provide steps--

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!