2 qq 34418970 qq_34418970 于 2016.04.29 15:55 提问

技术很差,写了好久,怎么才能实现模糊查询
    private void btnSearch_ItemClick(object sender, ItemClickEventArgs e)
    {
        string str = txtInfo.ToString();
        string whereClause = (_ResultLayer as IFeatureLayerDefinition).DefinitionExpression;
        string tableName = StaticSystemAOClass.AOComm.GetDataSetName(_ResultLayer.FeatureClass);
        string sql = string.Format("select  * from {0} where ZLXZ like ",str);
        DataTable dt = WFSysParaClass.SysDbCtrl.GetDataTable(sql);
        this.gvMain.CollapseAllGroups();
        this.gcMain.DataSource = dt;


    }

1个回答

Lu_kenwah
Lu_kenwah   2016.04.29 16:03

string sql = string.Format("select * from {0} where ZLXZ like ?","%"+str+"%");

qq_34418970
qq_34418970 我都不知道这有些是什么意思,好多都是DV上的控件
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!