怎樣把一個字符“324234+2342342//??+'676'”當成一個字符進行查詢? 怎樣把一個字符“324234+2342342//??+'676'”當成一個字符進行查詢?轉換函數怎么寫?爸特殊字符當作一個字符處理. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str=“324234+2342342//??+'676'”;str.IndexOf();试试,没试过~ //@"324234+2342342//??+'676'"string str = "csdn324234+2342342//??+'676'";int index = str.IndexOf(@"324234+2342342//??+'676'");//index=4 string s="324234+2342342//??+'676'"; 就行啊,里面没有需要转义的字符啊. 如果是Sql2000/2005,可以用一个函数CHECKSUM的,转换为一个对于的唯一数字,这样查询就快了。condition to catch stray cases where checksums match, but the values are not the same.*/SELECT * FROM Production.ProductWHERE CHECKSUM(N'Bearing Ball') = cs_Pname Convert.ToString(324234+2342342//??+'676')????? 不行啊。我用這個字符串查詢“Convert.ToString(k+h)”還是查詢不到內容等于“k+h”的資料 不行啊。我用這個字符串查詢“Convert.ToString(k+h)”還是查詢不到內容等于“k+h”的資料 string a=Request.QueryString["WRLOC"].ToString().Trim(); string b=Request.QueryString["WRFAC"].ToString().Trim(); string c=Request.QueryString["WRPROD"].ToString().Trim(); string d=Request.QueryString["WRTOOL"].ToString().Trim(); string e=Request.QueryString["WRRDTE"].ToString().Trim(); string sql="select * from I_CustomOrder where WRLOC = '" + a +"' and WRFAC = '" + b +"'and WRPROD = '" + c +"'and WRTOOL = '" + d +"'and WRRDTE = '" + e +"' "; SqlDataAdapter ada = new SqlDataAdapter(sql,con); 如果字符串中有加號,查詢就有問題。。 菜鸟求救WCF问题 winform 中 textbox如何根据用户输入信息更改显示颜色 string.Fomrat("{0:x},{1:x}",(int)'一',(int)'龥');在线等???一简单问题 指定编辑列 怎么实现网站首页题目自动截取一定长度?(在线等) .net开发的条码控件,要得进来! 客户资金如何建立数据库结构? double变量出问题了 为什么今天突然出现了“无法在 Web 服务器上启动调试”这个错误? 100分,再请教Remoting的问题? 一个小问题,如何在C#中动态改变菜单项的状态 关于关闭一个窗体的程序
str.IndexOf();
试试,没试过~
string str = "csdn324234+2342342//??+'676'";
int index = str.IndexOf(@"324234+2342342//??+'676'");//index=4
condition to catch stray cases where checksums match,
but the values are not the same.*/
SELECT *
FROM Production.Product
WHERE CHECKSUM(N'Bearing Ball') = cs_Pname
string b=Request.QueryString["WRFAC"].ToString().Trim();
string c=Request.QueryString["WRPROD"].ToString().Trim();
string d=Request.QueryString["WRTOOL"].ToString().Trim();
string e=Request.QueryString["WRRDTE"].ToString().Trim();
string sql="select * from I_CustomOrder where WRLOC = '" + a +"' and WRFAC = '" + b +"'and WRPROD = '" + c +"'and WRTOOL = '" + d +"'and WRRDTE = '" + e +"' ";
SqlDataAdapter ada = new SqlDataAdapter(sql,con); 如果字符串中有加號,查詢就有問題。。