如何做搜索,即使它並不確切,但會在DataGridViewC#(搜索按鈕)有一個函數包含
OleDbCommand cmdDatabase = new OleDbCommand("Select User_ID, Firstname, Lastname, Pass, Account_Type from Account where Lastname'"+textBox1.Text+"'", con);
try
{
OleDbDataAdapter sda = new OleDbDataAdapter();
sda.SelectCommand = cmdDatabase;
DataTable dbdataset = new DataTable();
sda.Fill(dbdataset);
BindingSource bSource = new BindingSource();
bSource.DataSource = dbdataset;
dataGridView1.DataSource = bSource;
sda.Update(dbdataset);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
顯示
Your code worked to me!謝謝btw – Rence
抱歉代碼,即時通訊困惑做參數 – Rence