OleDbConnection mycnc = new OleDbConnection("Provider=Microsoft.Ace.OLEDB.12.0; Data Source=F:\\Database1.accdb"); OleDbDataAdapter myadpt = new OleDbDataAdapter(); DataSet mydtSet = new DataSet(); myadpt.SelectCommand = new OleDbCommand(); myadpt.SelectCommand.CommandText = "select * from area where SNO=" + textBox1.Text + ""; myadpt.SelectCommand.Connection = mycnc; mycnc.Open(); myadpt2.Fill(mydtSet, "area"); mycnc.Close(); dataGridView1.DataSource = mydtSet; dataGridView1.DataMember = "area"; MessageBox.Show("successfully search !"); textBox1.Clear();
myadpt.SelectCommand.CommandText = "select * from area where SNO=" + textBox1.Text + " UNION ALL SELECT * FROM CITY WHERE SNO=" + textbox1.Text + "";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)