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);
...