提问个关于内容显示问题,老提示匹配的重载方法具有一些无效参数
<script language= "C# " runat= "server ">
void Page_Load(Object Src,EventArgs E){
SqlConnection Conn=new SqlConnection();
Conn.ConnectionString= "server=192.168.0.26;database=xxzx;uid=sa;pwd= ' ' ";
String strSql= "select * from j_date ";
SqlCommand Comm=new SqlCommand(strSql,Conn);
SqlDataAdapter da=new SqlDataAdapter();
da.SelectCommand=Comm;
DataSet ds=new DataSet();
da.Fill(ds, "grade ");
DataView dv=new DataView(ds.Tables[ "grade "]);
string html= " ";
string Name1=Request.QueryString[ "name "];
dv.RowFilter= "hzname= ' "+Name1+ " ' ";
dv.Sort= "hzid desc ";
if (dv.Count==0)
Response.Write( "没有找到! ");
else
Response.Write( 我想在这里显示hzname的值,请问应该如何写呢);
dg.DataSource=dv;
dg.DataBind();
Conn.Close();
}
</script>
我想在这里显示hzname的值,请问应该如何写呢
------解决方案--------------------dv.RowFilter= "hzname= ' "+Name1+ " ' ";
dv.Sort= "hzid desc ";
if (dv.Count==0)
是条件
那么hzname不就等于Name1么