0
使用datagrid我已連接到sqlite。我可以打開sqlite的特定表格到數據網格中。但現在我想從表中搜索特定的東西,我使用select語句並應用文本框。用戶從那裏輸入並輸入數據。以下是我的代碼使用C#在datagrid中搜索特定的文本#
private void button2_Click(object sender, EventArgs e)
{
SQLiteConnection connection2 = new SQLiteConnection(@"Data Source = C:\ssds\WEBATM\APTRABuilder.sqlite;Version =3");
connection2.Open();
string sql2 = "Select *from builderScreenResourceBundleTBL where screenId like '%_textboxSearch%'";
SQLiteDataAdapter connect2 = new SQLiteDataAdapter(sql2, connection2);
DataSet ds2 = new DataSet();
connect2.Fill(ds2);
dataGridView.DataSource = ds2.Tables[0];
}
所以在sql2字符串語句中,我需要如何通過文本框輸入?
非常感謝,它的工作 – Sohail
我接受了它並且給了你投票權,因爲你的回答在更快的時間裏讓我滿意 – Sohail