怎么才能实现模糊查询的记录数啊

string whereClause = (_ResultLayer as IFeatureLayerDefinition).DefinitionExpression;
string tableName = StaticSystemAOClass.AOComm.GetDataSetName(_ResultLayer.FeatureClass);
// string str = txtInfo.Edit.ToString();
string sql = string.Format("select * from {0} where ZLXZ like '%{1}%'", tableName, this.txtInfo.EditValue);
string count=string.Format("select count(*) from {0} where ZLXZ like '%{1}%'", tableName, this.txtInfo.EditValue);

DataTable dt = WFSysParaClass.SysDbCtrl.GetDataTable(sql);
this.gvMain.CollapseAllGroups();
this.gcMain.DataSource = dt;

就像你写的那样就可以。你的问题是什么呢,调试输出下sql

Spl这样就可以了,你试一下