私の計画は、文字Mを挿入すると、単語の先頭にある文字Mの全体がリストボックスを使って表示されますが、できません。私はこのコードを使用しますが、それは働いていなかった理由を私は見つけることができません。リストをフィルタリングするC#msアクセス
conn.Open();
OleDbCommand cmd2 = new OleDbCommand("SELECT fnID, Lastname, Firstname, Middlename FROM tbl_Fullname WHERE Firstname LIKE '%?'", conn);
cmd2.Parameters.Add("@Firstname", OleDbType.VarChar).Value = textBox3.Text;
try
{
OleDbDataReader dr = cmd2.ExecuteReader();
if (dr.Read())
{
textBox1.Text = dr[0].ToString(); //fnID
listBox1.Items.Add(dr[1].ToString()); //Lastname
textBox3.Text = dr[2].ToString(); //Firstname
textBox4.Text = dr[3].ToString(); //Middlename
}
else
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
//MessageBox.Show("No result");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
conn.Close();
あなたの計画の文(最初の行)を読みやすく(そして何らかの意味で)理解できるように改訂することはできますか? – Bhaskar