Hi Guys I need some urgent help
I have Created a C# windows application to implement a form with
• a ListBox,
• a TextBox,
• an Edit button,
• an Insert button,
• a Delete button,
• a Update button and
• an Exit button.
[
I have also Created a database which interects with the window application. The BookCSharp DB should contain at least to 10 books about C# from 6 different authors. Information about these books should be arranged into the following two tables:
• Books – BookKey (that is ISBN), Title, Pages, AuthorKey, Publisher
• Authors – AuthorKey, First_Name, Surname
which I have done
Now the problem is here I have been able to connect the database to the windows application I have debugged it, and had the form appear also been able to have the exit button work but I have a problem on going about with the other buttons please can some one help me as I am a c# amateur .:'(
below is the code that I have executed so far
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
public static OleDbDataAdapter CreateDataAdapter(
OleDbConnection connection)
{
string dbconnection = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\mystery\Desktop\BookCSharp.accdb";
string dbcommand = "Select Title Pages from Books;";
OleDbDataAdapter adapter = new OleDbDataAdapter(dbcommand, dbconnection);
DataSet ds = new DataSet();
adapter.Fill(ds);
DataTable dt = ds.Tables[0];
foreach (DataRow row in dt.Rows)
{
listBox1.Items.Add(row["Title"] + "(" + row["Pages"] + ")");
}
}
private void textbox1_Click_1(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void textbox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}