日期:2014-05-17 浏览次数:21486 次
//开始检索
occ.Open();
string sql = "select Chinese from NewwordInfo where English=@eng ";
ocm = new OleDbCommand(sql, occ);
ocm.Parameters.AddWithValue("@eng", tbselect.Text.ToString());
OleDbDataReader ldr = ocm.ExecuteReader();
string strEng;
string strChn;
if (ldr.Read())
{
strEng = ldr["English"].ToString();
strChn = ldr["Chinese"].ToString();
ldr.Close();
//判别是否存在这个单词
if (strEng == tbselect.Text.ToString())
{
MessageBox.Show(strChn);
// label2.Text = strChn ;
}
else
{
MessageBox.Show("该单词不存在");
}
}