This is a C# project . I am expected to create as this image shows. .pdf
Quanlycanbo
1. namespace canbo
{
public partial class Form1 : Form
{
private OleDbConnection mycon;
public Form1()
{
InitializeComponent();
mycon = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:thuchanhCanbo.mdb");
{
string sql = @"Select * from tblDonvi";
mycon.Open();
OleDbDataAdapter da = new OleDbDataAdapter(sql, mycon);
DataSet ds = new DataSet();
da.Fill(ds, "tblDonvi");
DataTable dtEx = ds.Tables["tblDonvi"];
mycon.Close();
this.madvcb.DataSource = dtEx;
madvcb.DisplayMember = "TenDV";
maDVTextBox.DataBindings.Add("text", dtEx, "TenDV");
}
{
string sl = @"Select * from nguyennhan";
mycon.Open();
OleDbDataAdapter d = new OleDbDataAdapter(sl, mycon);
DataSet s = new DataSet();
d.Fill(s, "nguyennhan");
DataTable dt = s.Tables["nguyennhan"];
mycon.Close();
this.soluongcb.DataSource = dt;
soluongcb.DisplayMember = "nguyennhan";
textBox1.DataBindings.Add("text", dt, "nguyennhan");
}
}
private void tblCanBoBindingNavigatorSaveItem_Click(object sender,
EventArgs e)
{
/*
this.Validate();
this.tblCanBoBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.canboDataSet);
*/
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the
'canboDataSet.nguyennhan' table. You can move, or remove it, as needed.
this.nguyennhanTableAdapter.Fill(this.canboDataSet.nguyennhan);
// TODO: This line of code loads data into the
'canboDataSet.tblCanBo' table. You can move, or remove it, as needed.
this.tblCanBoTableAdapter.Fill(this.canboDataSet.tblCanBo);
}