110,533
社区成员
发帖
与我相关
我的任务
分享
{
string str1 = "select Name= '" + Name.Text.ToString() + "' or Sex= '" + Sex.Text.ToString() + "' or HomeTel= '" + HomeTel.Text.ToString() + "' or OfficeTel= '" + OfficeTel.Text.ToString() + "' or Mark='" + Mark.Text.ToString() + "'";
dr = ds.Tables[0].Select(str1);
if(dr.Length>0)
{
i = 0;
string str2 = "the infomation :\n" + "Name=" + dr[i][1].ToString() + "Sex=" + dr[i][2].ToString() + "HomeTel=" + dr[i][3].ToString() + "\nOfficeTel=" + dr[i][4].ToString() + "Mark=" + dr[i][5].ToString();
MessageBox.Show(str2);
}
else
{
MessageBox.Show("without this people");
}
private void search_Click(object sender, EventArgs e)
{
string str="";
if(Name.Text.Trim()==str&&Sex.Text.Trim()==str&&HomeTel.Text.Trim()==str&&OfficeTel.Text.Trim()==str&&Mark.Text.Trim()==str)
MessageBox.Show("请输入信息");
else
{
string str1 = "select Name= '" + Name.Text.ToString()+"' or Sex= '" + Sex.Text.ToString() + "' or HomeTel= '" + HomeTel.Text.ToString() + "' or OfficeTel= '" + OfficeTel.Text.ToString() + "' or Mark='" + Mark.Text.ToString() + "'";
dr = ds.Tables[0].Select(str1);
if(dr.Length>0)
{
i = 0;
string str2 = "the infomation :\n" + "Name=" + dr[i][1].ToString() + "Sex=" + dr[i][2].ToString() + "HomeTel=" + dr[i][3].ToString() + "\nOfficeTel=" + dr[i][4].ToString() + "Mark=" + dr[i][5].ToString();
MessageBox.Show(str2);
}
else
{
MessageBox.Show("without this people");
}
}
}