错误如下:
编译器错误信息: 
CS0246: The type or namespace name 'DataRow' could not be found (are you missing a using directive or an assembly reference?)源错误: 行 39:          for( m=0;m<no2;m++)
行 40:             { 
行 41:          DataRow dr1=rs.Tables["recontent"].Rows[m];
行 42:   %>       
行 43: 
 
---------------------------------------------------------------------------
html代码如下:
<TABLE id="Table4" style="WIDTH: 728px; HEIGHT: 66px" cellSpacing="1" cellPadding="1" width="728"
border="0">

<%
int no2=rs.Tables["recontent"].Rows.Count;
   int m;
    
    if(no2>0)
      {
        for( m=0;m<no2;m++)
           { 
        DataRow dr1=rs.Tables["recontent"].Rows[m];
 %>       

<TR>
<TD width="134" height="20" style="WIDTH: 134px">回复人:<%=rewriter%></TD>
<TD width="647" colspan="2" rowspan="3" vAlign="top">www<%=recontent%></TD>
</TR>
<TR>
<TD height="19" style="WIDTH: 134px">回复时间:<%=retime%></TD>
</TR>
<TR>
<TD style="WIDTH: 134px"></TD>
</TR>

 <%
           }
      }
 %>   
</TABLE>
-----------------------------------------------
aspx代码如下:
string sql3="select rewriter,recontent,retime from recontent where con_id="+id;
                   OleDbDataAdapter myadapter2=new OleDbDataAdapter(sql3,myconn);
                   rs=new DataSet();
       myadapter2.Fill(rs,"recontent");
                   recontent=dr1["recontent"].ToString();
       retime=dr1["retime"].ToString();
       rewriter=dr1["rewriter"].ToString();-----------------------------------------
我只想实现从数据表中读出n条记录
然后再table中显示出来,请问如何解决
谢谢~~

解决方案 »

  1.   

    DataRow dr1=new DataRow();
    dr1=rs.Tables["recontent"].Rows[m];
      

  2.   

    The type or namespace name 'DataRow' could not be found (are you missing a using directive or an assembly reference?)
    楼上的谢谢先,在html代码不行挖~
      

  3.   

    在HTML中也要new 对象的实例出来
      

  4.   

    DataRow dr1=new DataRow();
    dr1=rs.Tables["recontent"].Rows[m];
    recontent首先判断这个字段存在否。最好的方法,是跟踪一下,看DataTable里有些什么内容。
    .net的开发环境(Microsoft Visual Studio .NET 2003)里是最好跟踪的。
    且保证引用了。引用System.Data这个名称空间
      

  5.   

    The type or namespace name 'DataRow' could not be found (are you missing a using directive or an assembly reference?)
    提示类型或命名空间找不到(是否少了引入指令或程序集引用?)
    建议:
    1.在页面的page指令下加<%@ Import Namespace="System.Data" %>
    2.对所有使用的变量包括对象声明先
    smallMage的可以了
      

  6.   

    晕,仔细看了你的代码,你还记得上次你的提问题么?
    考虑对象的作用域没?
    myadapter2.Fill(rs,"recontent");
                       recontent=dr1["recontent"].ToString();
           retime=dr1["retime"].ToString();
           rewriter=dr1["rewriter"].ToString();
    这段中的drl是个对象,你实例化没?要声明一个全局变量就可以了。参考你上次提的问题吧
      

  7.   

    小弟愚钝,,,
    dr1已经在aspx代码页中
    public DataRow dr,dr1;
      

  8.   

    楼主的写法还停在asp啊,强烈建议改成.net的方式。为什么不用一个服务器控件Table呢,然后在后台代码中可以从数据库中读出数据,再用Table.Rows.Add( row )和Row.Cells.Add( cell )添加进Table
      

  9.   

    直接用asp.net吧
    你的sql语句执行的结果返回一条记录,
             for( m=0;m<no2;m++)
               { 
            DataRow dr1=rs.Tables["recontent"].Rows[m];那上面这些又是什么?
      

  10.   

    en en e.....谢谢各位~~~嘻嘻~~偶真是