--直接用下面语句试试select 
        xh,rq,dw_cz,cx,jsdh,zynr,fklb,fwzy,wxzf,ssje,bz 
from Tdcw 
where dw_cz like '%谢%'

解决方案 »

  1.   

    select * from ta where patindex('%'+@InfoStr+'%',dw_cz)>0
      

  2.   

    楼主,你的存储过程应该没有问题的!你调试一下这个create table aa(dd varchar(50))
    insert aa select '你好'
    union all select '谢谢你'
    union all select 'wq谢谢你'
    union all select '谢谢你ds'
    union all select '就是你'
    godeclare  @InfoStr nvarchar(20)
    set @InfoStr='谢谢'
    set @InfoStr= '%'+@InfoStr+'%'
    select dd  from aa 
    where dd like @InfoStr
    GO
    drop table aa
      

  3.   

    还是用模糊匹配函数patindex吧~~~~~~~~`
      

  4.   

    终于搞定了  谢谢大家 原来不使存储过程的问题 使我在c#中传递的参数的问题下面使我的查找函数
    把             pmStr.Value = InfoStr;
    改为             pmStr.Value = InfoStr.ToString();  就可以了        //用字符模糊串查找
            public DataSet strGetDataSet(string strComm, string strTable, string InfoStr)
            {
                SqlCommand Comm = new SqlCommand(strComm,Conn);
                Comm.CommandType = CommandType.StoredProcedure;            SqlParameter pmStr = new SqlParameter("@InfoStr", SqlDbType.NVarChar, 20);
                pmStr.Value = InfoStr.ToString();
                Comm.Parameters.Add(pmStr);            SqlDataAdapter ad = new SqlDataAdapter();
                ad.SelectCommand = Comm;
                DataSet ds = new DataSet();
                ad.Fill(ds, strTable);
                return ds;
            }