using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace DataD1629
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter1;
private System.Data.OleDb.OleDbCommand oleDbSelectCommand1;
private System.Data.OleDb.OleDbCommand oleDbInsertCommand1;
private System.Data.OleDb.OleDbCommand oleDbUpdateCommand1;
private System.Data.OleDb.OleDbCommand oleDbDeleteCommand1;
private System.Data.OleDb.OleDbConnection oleDbConnection1;
private System.Data.DataSet dataSet1;
private System.Windows.Forms.TextBox textBoxISBN;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBoxTitle;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBoxAuthor;
private System.Windows.Forms.Button buttonAdd;
private System.Windows.Forms.Button buttonFind;
private System.Windows.Forms.Button buttonUpdate;
private System.Windows.Forms.Button buttonClear;
private System.Windows.Forms.Label labelStatus;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
oleDbConnection1.Open();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter();
this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbInsertCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbUpdateCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbDeleteCommand1 = new System.Data.OleDb.OleDbCommand();
this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
this.dataSet1 = new System.Data.DataSet();
this.textBoxISBN = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBoxTitle = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBoxAuthor = new System.Windows.Forms.TextBox();
this.buttonAdd = new System.Windows.Forms.Button();
this.buttonFind = new System.Windows.Forms.Button();
this.buttonUpdate = new System.Windows.Forms.Button();
this.buttonClear = new System.Windows.Forms.Button();
this.labelStatus = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
this.SuspendLayout();
//
// oleDbDataAdapter1
//
this.oleDbDataAdapter1.DeleteCommand = this.oleDbDeleteCommand1;
this.oleDbDataAdapter1.InsertCommand = this.oleDbInsertCommand1;
this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Books", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("ISBN", "ISBN"),
new System.Data.Common.DataColumnMapping("Title", "Title"),
new System.Data.Common.DataColumnMapping("Author", "Author"),
new System.Data.Common.DataColumnMapping("Publisher", "Publisher"),
new System.Data.Common.DataColumnMapping("Subject_Code", "Subject_Code"),
new System.Data.Common.DataColumnMapping("Shelf_Location", "Shelf_Location"),
new System.Data.Common.DataColumnMapping("Fiction", "Fiction")})});
this.oleDbDataAdapter1.UpdateCommand = this.oleDbUpdateCommand1;
//
// oleDbSelectCommand1
//
this.oleDbSelectCommand1.CommandText = "SELECT Author, Fiction, ISBN, Publisher, Shelf_Location, Subject_Code, Title FROM" +
" Books";
this.oleDbSelectCommand1.Connection = this.oleDbConnection1;
//
// oleDbInsertCommand1
//
this.oleDbInsertCommand1.CommandText = "INSERT INTO Books(Author, Fiction, ISBN, Publisher, Shelf_Location, Subject_Code," +
" Title) VALUES (?, ?, ?, ?, ?, ?, ?)";
this.oleDbInsertCommand1.Connection = this.oleDbConnection1;
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Author", System.Data.OleDb.OleDbType.VarWChar, 30, "Author"));
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Fiction", System.Data.OleDb.OleDbType.Boolean, 2, "Fiction"));
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("ISBN", System.Data.OleDb.OleDbType.VarWChar, 13, "ISBN"));
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Publisher", System.Data.OleDb.OleDbType.VarWChar, 30, "Publisher"));
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Shelf_Location", System.Data.OleDb.OleDbType.VarWChar, 7, "Shelf_Location"));
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Subject_Code", System.Data.OleDb.OleDbType.VarWChar, 3, "Subject_Code"));
this.oleDbInsertCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Title", System.Data.OleDb.OleDbType.VarWChar, 50, "Title"));
//
// oleDbUpdateCommand1
//
this.oleDbUpdateCommand1.CommandText = @"UPDATE Books SET Author = ?, Fiction = ?, ISBN = ?, Publisher = ?, Shelf_Location = ?, Subject_Code = ?, Title = ? WHERE (ISBN = ?) AND (Author = ? OR ? IS NULL AND Author IS NULL) AND (Fiction = ?) AND (Publisher = ? OR ? IS NULL AND Publisher IS NULL) AND (Shelf_Location = ? OR ? IS NULL AND Shelf_Location IS NULL) AND (Subject_Code = ? OR ? IS NULL AND Subject_Code IS NULL) AND (Title = ? OR ? IS NULL AND Title IS NULL)";
this.oleDbUpdateCommand1.Connection = this.oleDbConnection1;
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Author", System.Data.OleDb.OleDbType.VarWChar, 30, "Author"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Fiction", System.Data.OleDb.OleDbType.Boolean, 2, "Fiction"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("ISBN", System.Data.OleDb.OleDbType.VarWChar, 13, "ISBN"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Publisher", System.Data.OleDb.OleDbType.VarWChar, 30, "Publisher"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Shelf_Location", System.Data.OleDb.OleDbType.VarWChar, 7, "Shelf_Location"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Subject_Code", System.Data.OleDb.OleDbType.VarWChar, 3, "Subject_Code"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Title", System.Data.OleDb.OleDbType.VarWChar, 50, "Title"));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_ISBN", System.Data.OleDb.OleDbType.VarWChar, 13, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ISBN", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Author", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Author", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Author1", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Author", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Fiction", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Fiction", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Publisher", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Publisher", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Publisher1", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Publisher", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Shelf_Location", System.Data.OleDb.OleDbType.VarWChar, 7, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Shelf_Location", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Shelf_Location1", System.Data.OleDb.OleDbType.VarWChar, 7, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Shelf_Location", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Subject_Code", System.Data.OleDb.OleDbType.VarWChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Subject_Code", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Subject_Code1", System.Data.OleDb.OleDbType.VarWChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Subject_Code", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Title", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
this.oleDbUpdateCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Title1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
//
// oleDbDeleteCommand1
//
this.oleDbDeleteCommand1.CommandText = @"DELETE FROM Books WHERE (ISBN = ?) AND (Author = ? OR ? IS NULL AND Author IS NULL) AND (Fiction = ?) AND (Publisher = ? OR ? IS NULL AND Publisher IS NULL) AND (Shelf_Location = ? OR ? IS NULL AND Shelf_Location IS NULL) AND (Subject_Code = ? OR ? IS NULL AND Subject_Code IS NULL) AND (Title = ? OR ? IS NULL AND Title IS NULL)";
this.oleDbDeleteCommand1.Connection = this.oleDbConnection1;
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_ISBN", System.Data.OleDb.OleDbType.VarWChar, 13, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ISBN", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Author", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Author", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Author1", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Author", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Fiction", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Fiction", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Publisher", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Publisher", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Publisher1", System.Data.OleDb.OleDbType.VarWChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Publisher", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Shelf_Location", System.Data.OleDb.OleDbType.VarWChar, 7, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Shelf_Location", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Shelf_Location1", System.Data.OleDb.OleDbType.VarWChar, 7, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Shelf_Location", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Subject_Code", System.Data.OleDb.OleDbType.VarWChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Subject_Code", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Subject_Code1", System.Data.OleDb.OleDbType.VarWChar, 3, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Subject_Code", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Title", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
this.oleDbDeleteCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("Original_Title1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Title", System.Data.DataRowVersion.Original, null));
//
// oleDbConnection1
//
this.oleDbConnection1.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\360\Programs_managedVCSharp\rnrbooks.mdb;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
//
// dataSet1
//
this.dataSet1.DataSetName = "NewDataSet";
this.dataSet1.Locale = new System.Globalization.CultureInfo("en-US");
//
// textBoxISBN
//
this.textBoxISBN.Location = new System.Drawing.Point(112, 64);
this.textBoxISBN.Name = "textBoxISBN";
this.textBoxISBN.Size = new System.Drawing.Size(160, 20);
this.textBoxISBN.TabIndex = 3;
this.textBoxISBN.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 23);
this.label1.TabIndex = 1;
this.label1.Text = "ISBN";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 23);
this.label2.TabIndex = 2;
this.label2.Text = "Title";
//
// textBoxTitle
//
this.textBoxTitle.Location = new System.Drawing.Point(112, 24);
this.textBoxTitle.Name = "textBoxTitle";
this.textBoxTitle.Size = new System.Drawing.Size(160, 20);
this.textBoxTitle.TabIndex = 0;
this.textBoxTitle.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(16, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 23);
this.label3.TabIndex = 4;
this.label3.Text = "Author";
//
// textBoxAuthor
//
this.textBoxAuthor.Location = new System.Drawing.Point(112, 104);
this.textBoxAuthor.Name = "textBoxAuthor";
this.textBoxAuthor.Size = new System.Drawing.Size(160, 20);
this.textBoxAuthor.TabIndex = 5;
this.textBoxAuthor.Text = "";
//
// buttonAdd
//
this.buttonAdd.Location = new System.Drawing.Point(16, 200);
this.buttonAdd.Name = "buttonAdd";
this.buttonAdd.TabIndex = 6;
this.buttonAdd.Text = "Add";
this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
//
// buttonFind
//
this.buttonFind.Location = new System.Drawing.Point(112, 200);
this.buttonFind.Name = "buttonFind";
this.buttonFind.TabIndex = 7;
this.buttonFind.Text = "Find";
this.buttonFind.Click += new System.EventHandler(this.buttonFind_Click);
//
// buttonUpdate
//
this.buttonUpdate.Location = new System.Drawing.Point(16, 240);
this.buttonUpdate.Name = "buttonUpdate";
this.buttonUpdate.TabIndex = 8;
this.buttonUpdate.Text = "Update";
this.buttonUpdate.Click += new System.EventHandler(this.buttonUpdate_Click);
//
// buttonClear
//
this.buttonClear.Location = new System.Drawing.Point(112, 240);
this.buttonClear.Name = "buttonClear";
this.buttonClear.TabIndex = 9;
this.buttonClear.Text = "Clear";
this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click);
//
// labelStatus
//
this.labelStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.labelStatus.Location = new System.Drawing.Point(24, 144);
this.labelStatus.Name = "labelStatus";
this.labelStatus.Size = new System.Drawing.Size(240, 40);
this.labelStatus.TabIndex = 10;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.labelStatus,
this.buttonClear,
this.buttonUpdate,
this.buttonFind,
this.buttonAdd,
this.textBoxAuthor,
this.label3,
this.textBoxTitle,
this.label2,
this.label1,
this.textBoxISBN});
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void buttonFind_Click(object sender, System.EventArgs e)
{
dataSet1.Clear();
oleDbDataAdapter1.SelectCommand.CommandText = "SELECT * FROM Books WHERE Title = '" + textBoxTitle.Text + "'";
oleDbDataAdapter1.Fill(dataSet1);
Display(dataSet1); // call helper function Display
labelStatus.Text = "Query Successful";
}

private void Display(DataSet dataSet)
{
DataTable dataTable = dataSet.Tables[0];
if (dataTable.Rows.Count != 0)
{
textBoxISBN.Text =(string)dataTable.Rows[0][0];
textBoxTitle.Text =(string)dataTable.Rows[0][1];
textBoxAuthor.Text =(string)dataTable.Rows[0][2];
}
}

private void buttonAdd_Click(object sender, System.EventArgs e)
{

//oleDbDataAdapter1.InsertCommand.CommandText =
//"INSERT INTO Books (ISBN, Title, Author) VALUES ('333567', 'Book', 'Smith')";

//This works
oleDbDataAdapter1.InsertCommand.CommandText =
"INSERT INTO Books (" +
"ISBN, Title, Author" +
") VALUES ('" +
textBoxISBN.Text + "', '" +
textBoxTitle.Text + "', '" +
textBoxAuthor.Text + "')";

labelStatus.Text = "Sending add query";
oleDbDataAdapter1.InsertCommand.ExecuteNonQuery();
labelStatus.Text = "Record Added";
}

private void buttonUpdate_Click(object sender, System.EventArgs e)
{

//This works
//oleDbDataAdapter1.UpdateCommand.CommandText =
//"UPDATE Books SET Author = 'xxx' where Title = 'Somebook'";

//oleDbDataAdapter1.UpdateCommand.CommandText =
//"UPDATE Books SET Author = 'eee', ISBN = '987' where Title = 'Somebook'";

//This works
//oleDbDataAdapter1.UpdateCommand.CommandText =
// "UPDATE Books SET Author = '" +
// textBoxAuthor.Text + "'" +
// " where Title = " + "'" +
// textBoxTitle.Text + "'";

oleDbDataAdapter1.UpdateCommand.CommandText =
"UPDATE Books SET Author = '" +
textBoxAuthor.Text + "'," +
" Title = '" + textBoxTitle.Text + "'" +
" where ISBN = " + "'" +
textBoxISBN.Text + "'";


/* oleDbDataAdapter1.UpdateCommand.CommandText =
"UPDATE Books SET " +
"Title ='" + textBoxTitle.Text +
"', Author='" + textBoxAuthor.Text +
"' WHERE Title=" + textBoxTitle.Text; */

labelStatus.Text = "Sending update query";
oleDbDataAdapter1.UpdateCommand.ExecuteNonQuery();
labelStatus.Text = "Data set updated";
}

private void buttonClear_Click(object sender, System.EventArgs e)
{
textBoxTitle.Clear();
textBoxAuthor.Clear();
textBoxISBN.Clear();
}
}
}