你可以这样写: SelectCommand="select * from table where "+ str
可以创建一个全局静态变量,只有这样,这个变量可以保留住你给的值,你可以试下 public static string str; 顺序我忘了,不过程序会给提示,然后给值 str="name='a'" name 是字段, a 是值 SelectCommand="select * from table where" + str
要注意str里内容的格式,数字可以不要引号,字符则需要 SelectCommand="select * from table where ‘" + str + “’”
SelectCommand="select * from table where ‘" + str + “’” 错了,收回,可以参考13楼的,呵呵
str = Request.QueryString["str"] SelectCommand = "select * from table where " + str 另外考虑中文传值的时候, 参数要encode一下。 接的时候显示要decode一下,。 Server.Encode(str); Server.Decode(str);
SelectCommand="select * from table where ‘" + str + “’” 这样操作是可以了,谢谢liuyang1981
如果我要加通配符的话,该如何来加呢? 用like和通配符来查询的时候
终于可以了, strWhere += "字段1 like '%" + ghmc + "%' and ";谢谢大家的帮助! 结了,呵呵
Response.Redirect(xxx.xxx.xxx?str=value)
下一页
str = Request.QueryString["str"]
SelectCommand = "select * from table where " + str
href="www.baidu.com?str="+str;下一页:在Page_Load方法中写
string str = Request.Params["id"];
SqlDataSource对象.SelectCommand="select * from table where str='"+str+"'";
错误验证 (ASP.Net): 此属性名称必须后跟一个等号(=)和一个值。如果用引号将该值括起来,则必须成对使用引号。
string num="123";
Response.Redirect("WebForm2.aspx?str="+num);WebForm2.aspx页面接受:
string thenum=Request.QueryString["str"].ToString();
SelectCommand="select * from table where "+ str
public static string str;
顺序我忘了,不过程序会给提示,然后给值
str="name='a'"
name 是字段, a 是值
SelectCommand="select * from table where" + str
SelectCommand="select * from table where ‘" + str + “’”
SelectCommand = "select * from table where " + str 另外考虑中文传值的时候,
参数要encode一下。
接的时候显示要decode一下,。
Server.Encode(str);
Server.Decode(str);
如果我要加通配符的话,该如何来加呢? 用like和通配符来查询的时候