用DataList摸板将标题列绑定后,绑定列可以连接到另一个页面,那个页面用来显示和这个标题有关的文章内容,可是我做的连接到那页后根本就什么也不显示。代码如下:
string name=Request["biaoti"];
string strcon="Provider=Microsoft.Jet.OLEDB.4.0;Data source="+Server.MapPath("db\\database.mdb");
OleDbConnection cn=new OleDbConnection(strcon);
string strsql="select neirong from gonggao where biaoti like'"+name+"'";
OleDbDataAdapter dab=new OleDbDataAdapter(strsql,cn);
DataSet dss=new DataSet();
dab.Fill(dss,"biaoti");
DataList3.DataSource=dss.Tables["biaoti"].DefaultView;
DataList3.DataBind();
紧急求助,请大家多多帮忙,勿以分少而不为。
谢谢。

解决方案 »

  1.   

    把你.aspx中DataList3的内容

    .vb或.cs中DataList3的ItemDataBound事件贴出来
      

  2.   

    <asp:DataList id="DataList1" runat="server">
    <ItemTemplate>
    <TABLE id="Table5" cellSpacing="0" cellPadding="0" width="180" border="0">
    <TR>
    <TD>
    <a href="gonggao.aspx">
    <%# DataBinder.Eval(Container.DataItem,"biaoti")%>
    </a>
    </TD>
    </TR>
    </TABLE>
    </ItemTemplate>
    </asp:DataList>
      

  3.   

    <A href='gonggao.aspx?id=<%# DataBinder.Eval(Container.DataItem, "biaoti")%>'></a>
      

  4.   

    string name=Request.QueryString["biaoti"]
    string strcon="Provider=Microsoft.Jet.OLEDB.4.0;Data source="+Server.MapPath("db\\database.mdb");
    OleDbConnection cn=new OleDbConnection(strcon);
                               cn.Open()
    string strsql="select neirong from gonggao where biaoti like'"+name+"'";
    OleDbDataAdapter dab=new OleDbDataAdapter(strsql,cn);
    DataSet dss=new DataSet();
    dab.Fill(dss,"biaoti");
    DataList3.DataSource=dss.Tables["biaoti"].DefaultView;
    DataList3.DataBind();
                               cn.Close();
    <A href='gonggao.aspx?id=<%# DataBinder.Eval(Container.DataItem, "biaoti")%>'></a>
      

  5.   

    <A href='gonggao.aspx?id=<%# DataBinder.Eval(Container.DataItem, "biaoti")%>'></a>
    这一句我替换了我的语句,可是导致了控件什么也不显示
      

  6.   

    那是因为<A href='gonggao.aspx?id=<%# DataBinder.Eval(Container.DataItem, "biaoti")%>'></a>中间没文字.
    <A href='gonggao.aspx?id=<%# DataBinder.Eval(Container.DataItem, "biaoti")%>'>xxxxxxxxxxxxxxxxxxxxx</a>加几个文字不就行了...