private void button2_Click(object sender, EventArgs e) { String connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data" + @" Source = company.accdb"; String query = "select * from [Table] where [code] ="+txt_code.Text; DataSet ds = new DataSet(); OleDbConnection conn = new OleDbConnection(connectionString); conn.Open(); OleDbDataAdapter da = new OleDbDataAdapter(query, conn); da.Fill(ds,"Table"); conn.Close(); txt_price.Text = ds.Tables["Table"].Rows[0]["price"].ToString(); txt_number.Text = ds.Tables["Table"].Rows[0]["number"].ToString(); txt_des.Text = ds.Tables["Table"].Rows[0]["description"].ToString(); double w = double.Parse(txt_price.Text); double tax = w * 0.16; txt_tax.Text = tax.ToString(); w = w - tax; txt_w.Text = w.ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)