Create a Books database to include two tables: BookTable and CourseBookTable. The BookTable table should have fields for ISBN number, title, copyright date, primary author, publisher, and number of...

1 answer below »

Create a Books database to include two tables: BookTable and CourseBookTable. The BookTable table should have fields for ISBN number, title, copyright date, primary author, publisher, and number of pages. The CourseBookTable table should have fields for course number and ISBN. Populate the tables with books in your current collection, including the books you are using for your classes. Books that are not associated with a specific course can be placed in the table with a FUN course number. Create a an Access database. Write a C# program to display the course number (or FUN) and the ISBN and name of the book on the same screen.


Submit the Database and the C# project in a zipped folder.

Answered Same DayAug 04, 2021

Answer To: Create a Books database to include two tables: BookTable and CourseBookTable. The BookTable table...

Shweta answered on Aug 07 2021
138 Votes
Order62883/BookLibrary.zip
BookLibrary/App.config





BookLibrary/BookLibrary.csproj



Debug
AnyCPU
{0AB51BCA-21F3-473A-BEC6-D8F7E685C2F3}
WinExe
BookLibrary
BookLibrary
v4.7.2
512
true
true


AnyCPU
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
4


AnyCPU
pdbonly
true
bin\Release\
TRACE
prompt
4
















Form


Form1.cs




Form1.cs


ResXFileCodeGenerator
Resources.Designer.cs
Designer


True
Resources.resx


SettingsSingleFileGenerator
Settings.Designer.cs


True
Settings.settings
True






BookLibrary/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace BookLibrary
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

}

private void Form1_Load_1(object sender, EventArgs e)
{
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Acer\Documents\Books.accdb";
string queryString = "select b.ISBN_number as ISBN_Number, IIF(Course_number IS NULL, 'FUN', Course_number) as Course_Number,Title from BookTable b left join CourseBookTable c on b.ISBN_number = c.ISBN_number";
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbCommand command = new OleDbCommand(queryString, connection);
connection.Open();
using (OleDbDataAdapter adapter = new OleDbDataAdapter(command))
{
using (DataTable dataTable = new DataTable())
{
adapter.Fill(dataTable);
dataGridView1.DataSource = dataTable;
}

}
}
}
}

}
BookLibrary/Form1.Designer.cs
namespace BookLibrary
{
partial class Form1
{
///
/// Required designer variable.
///

private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///

/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.dataGridView1 = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// dataGridView1
//
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(48, 31);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(690, 373);
this.dataGridView1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here