为了账号安全,请及时绑定邮箱和手机立即绑定

C#窗体应用程序中,怎样多个输入框只用一个查询按钮查询数据?

/ 猿问

C#窗体应用程序中,怎样多个输入框只用一个查询按钮查询数据?

C#
苦咖 2019-04-28 15:13:15

C#窗体应用程序中,怎样多个输入框只用一个查询按钮查询数据?已经写出一个输入框查询了

  public void show(int pageIndex)
        {

            searchData = searchText.Text.Trim();
          
            string SqlStr1 = string.Format(@"SELECT *
                                               FROM IMOS_LO_Bin 
                                       where Material_Code like '%{0}%' or  Material_Name like '%{0}%' or Material_Spec like '%{0}%'
                                       ", searchData);

            DataSet ds1 = DataHelper.Fill(SqlStr1);
            dgvWarning.DataSource = ds1.Tables[0];
            dgvWarning.RowsDefaultCellStyle.BackColor = Color.LightCyan;
            dgvWarning.AlternatingRowsDefaultCellStyle.BackColor = Color.White;

        }

        private void dgvWarning_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            e.Row.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            e.Row.HeaderCell.Value = string.Format("{0}", e.Row.Index + 1);
        }

      

        private void search_Click(object sender, EventArgs e)
        {
             show(1);
        }


查看完整描述

目前暂无任何回答

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信