DataRow   Drow = ds.Tables["notice"].Rows[0];然后我用 <%=Drow["title"]%> 取数据,报错The name 'Drow' does not exist in the class or namespace

解决方案 »

  1.   

    哪应该怎么写,我是参考下载的留言版写的,他也是 <%=Drow["title"]%> 取数据的
      

  2.   

    public DataRow   Drow = ds.Tables["notice"].Rows[0];
    我不知道能不能这样在c#里,在aspx里用到的在codebehind里要用public的。
      

  3.   

    .net下这么写<%# DataBinder.Eval(Container.DataItem, "EXPLAIN")%>
      

  4.   

    呵呵。搞笑。。你要像ASP一样也可以啊。但是要用public
      

  5.   

    public DataRow   Drow = ds.Tables["notice"].Rows[0];
    <%=Drow["title"].ToString()%>
      

  6.   

    如果你是在CodeBehind定义的Drow,那么必须是protected或者public才能在页面引用,不加前缀默认是private的