想飞的鱼丶 2016-05-03 01:39 采纳率: 0%
浏览 1357

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

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;

  • 写回答

2条回答 默认 最新

  • threenewbee 2016-05-03 01:44
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序