我把程序也写在ASPX文件里,编译报错了,大家看看是什么错误
<%@ import namespace="QingTian" %>
<%@ import namespace="System.Data" %>
<%@ Page language="c#" Codebehind="FrmInvoice.aspx.cs" AutoEventWireup="false" Inherits="myFile.shipment.FrmInvoice" %>
<TABLE id="Table2" height="239" cellSpacing="0" cellPadding="0" width="696" border="1">
<TR><TD width="79" rowSpan="2">&nbsp; 单价</TD>
<TD width="77" rowSpan="2">&nbsp; 金额</TD>
</TR><%
string strSql = "select team from product";
DataView dv = (DataView)mySQL.ExecuteDataSource(strSql);
 for(int i=0; i<dv.Count; i++)
 {
  %>
<TR><TD height="27"><%#dv[i]["team"].ToString %>
</TD>
<TD>&nbsp;<%#dv[i]["team"].ToString %>
</TD>
<TD>&nbsp;<%#dv[i]["team"].ToString %>
</TD><TD style="WIDTH: 32px">&nbsp;<%#dv[i]["team"].ToString %>
</TD>
<TD>&nbsp;<%#dv[i]["team"].ToString %>
</TD>
<TD>&nbsp;<%#dv[i]["team"].ToString %>
</TD>
</TR>
<% }%>

解决方案 »

  1.   

    我缩短了一点,帮我看看
    <TABLE id="Table2" height="239" cellSpacing="0" cellPadding="0" width="696" border="1">
    <TR><TD width="79" rowSpan="2">&nbsp; 单价</TD>
    <TD width="77" rowSpan="2">&nbsp; 金额</TD>
    </TR><%
    string strSql = "select team from product";
    DataView dv = (DataView)mySQL.ExecuteDataSource(strSql);
     for(int i=0; i<dv.Count; i++)
     {
      %>
    <TR>
    <TD height="27"><%#dv[i]["team"].ToString %></TD><TD><%#dv[i]["team"].ToString %>
    </TD>
    <TD><%#dv[i]["team"].ToString %></TD></TR>
    <% }%>
    <TABLE> 
      

  2.   

    <%#dv[i]["team"].ToString %>可以这么写吗?应该是<%=dv[i]["team"].ToString %> 吧