c#如何禁止textbox录入时自动查询数据

privatevoidbutton1_Click(objectsender,EventArgse){DateTimeZz=Convert.ToDateTime(dateT... private void button1_Click(object sender, EventArgs e)
{
DateTime Zz = Convert.ToDateTime(dateTimePicker1.Text);
DateTime dt2 = Convert.ToDateTime(dateTimePicker2.Text);
string r1 = Zz.ToString("yyyy-MM-dd");
string r2 = dt2.ToString("yyyy-MM-dd");
string fbillno = this.Sebillno.Text.Trim();
string fnumber = this.ItemNo.Text.Trim();
string khname = this.CustName.Text.Trim();
string ZT = Fstatus.Text.ToString();
ZT = Fstatus.Text;

string yj;
string yj2 = "select a.fdate as '日期',a.fbillno as '销售订单号',case when a.FClosed=0 then '未关闭' when a.FClosed=1 then '关闭' end as '是否关闭'," +
"b.FEntrySelfS0162 as '客户订单号',c.fname as '客户名称',d.fnumber as '产品代码',b.FEntrySelfS0168 as '产品名称',d.fmodel as '规格型号', \n\r " +
"convert(decimal(10,0),b.FAuxQty) as '数量',convert(decimal(10,0),b.fstockqty) as '出货数量',convert(decimal(10,0),b.FAuxQty-b.fstockqty) as '未出货数量'," +
"c2.fname as '海外客户',b.FEntrySelfS0160 as '客户下单日期',b.Fdate as '客户交期', \n\r " +
"e.FName as '业务员',b.fentryid as '订单分录',b.finterid from seorder a \n\r " +
"left join seorderentry b on b.finterid=a.finterid \n\r " +
"left join t_icitem d on d.fitemid=b.fitemid \n\r " +
"left join t_Organization c on c.fitemid=a.fcustid \n\r " +
"left join t_Organization c2 on c2.fitemid=a.FHeadSelfS0151 \n\r " +
"left join t_Emp e on e.fitemid=a.FEmpID where a.FCheckDate >= '" + r1 + "' and a.fcheckdate <= '" + r2 + "' " +
"and a.fbillno like '%" + Sebillno.Text.Trim() + "%'" +
"and d.fnumber like '%" + ItemNo.Text.Trim() + "%'" +
"and c.fname like '%" + CustName.Text.Trim() + "%' and a.fcancellation=0 ";

if (ZT == "全部")
{
yj = yj2;
}
else
{
if (ZT == "关闭")
{
yj = yj2 + " and a.FClosed=1 ";
}
else
{
if (ZT == "未关闭")
{
yj = yj2 + " and a.FClosed=0 ";
}
else
{
yj = yj2;
}
}
}

SqlConnection myconn = new SqlConnection(this.tosql.sqlconn2);
SqlDataAdapter da = new SqlDataAdapter(yj, myconn);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
label1.Text = "共有" + ds.Tables[0].Rows.Count + "条查询记录";
展开
 我来答
阳光的雷咩咩
2014-12-02 · TA获得超过1.4万个赞
知道大有可为答主
回答量:2.3万
采纳率:66%
帮助的人:7576万
展开全部
还是没贴出重点啊。你就把你当前页面所有的事件名都贴出来,里面的具体内容都不用了。
来自:求助得到的回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式