这句话什么意思啊strFilter = strFilter.Substring(0,strFilter.Length - 5);括号中的?string strFilter = "";if (txt1.Text.Trim() = "")//设置表的过滤条件strFilter += "物料编号 like '%" + txt1.Text.Trim() + "%' and ";if (strFilter =
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/27 17:07:00
![这句话什么意思啊strFilter = strFilter.Substring(0,strFilter.Length - 5);括号中的?string strFilter =](/uploads/image/z/8957984-32-4.jpg?t=%E8%BF%99%E5%8F%A5%E8%AF%9D%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%E5%95%8AstrFilter+%3D+strFilter.Substring%280%2CstrFilter.Length+-+5%29%3B%E6%8B%AC%E5%8F%B7%E4%B8%AD%E7%9A%84%3Fstring+strFilter+%3D+%22%22%3Bif+%28txt1.Text.Trim%28%29+%3D+%22%22%29%2F%2F%E8%AE%BE%E7%BD%AE%E8%A1%A8%E7%9A%84%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6strFilter+%2B%3D+%22%E7%89%A9%E6%96%99%E7%BC%96%E5%8F%B7+like+%27%25%22+%2B+txt1.Text.Trim%28%29+%2B+%22%25%27+and+%22%3Bif+%28strFilter+%3D)
这句话什么意思啊strFilter = strFilter.Substring(0,strFilter.Length - 5);括号中的?string strFilter = "";if (txt1.Text.Trim() = "")//设置表的过滤条件strFilter += "物料编号 like '%" + txt1.Text.Trim() + "%' and ";if (strFilter =
这句话什么意思啊strFilter = strFilter.Substring(0,strFilter.Length - 5);括号中的?
string strFilter = "";
if (txt1.Text.Trim() = "")//设置表的过滤条件
strFilter += "物料编号 like '%" + txt1.Text.Trim() + "%' and ";
if (strFilter = "") // 存在查询条件
strFilter = strFilter.Substring(0,strFilter.Length - 5);
这句话什么意思啊strFilter = strFilter.Substring(0,strFilter.Length - 5);括号中的?string strFilter = "";if (txt1.Text.Trim() = "")//设置表的过滤条件strFilter += "物料编号 like '%" + txt1.Text.Trim() + "%' and ";if (strFilter =
substring(截取的起始未知,截取的长度);
之所以在最后要接去掉最后5个是因为查询的条件是不定的,你把查询的输出语句在屏幕上打印出来就晓得是怎么回事儿了,在每个条件的最后都有一个“ and ”长度就是5.
例如:最后动态生成的查询条件就是select * from tableName where 物料编号 like '%XXX%' and ;
这样直接执行肯定是不行的,要把”空格and空格“去掉才可以.
还有一个建议就是,数据库的字段怎么用中文呢,这是个不好的习惯哈.
strFilter = strFilter.Substring(0, strFilter.Length - 5);
strFileter=从strFileter截取 (从 0位开始,截取到strFileter的长度少5的字符的位数)