.aspx
<asp:datalist id="Datalist1" Width="928px" Runat="server">
<ItemTemplate>
<asp:Label id=classid Runat="server" text='<%#DataBinder.Eval(Container,"DataItem.Id")%>' visible="False">
'建立一个不可见label用来取得父datalist的BoardClassid
</asp:Label>
<TABLE width="99%" border="0">
<TR>
<TD class="title" colSpan="6"><%#DataBinder.Eval(Container,"DataItem.Lname")%></TD>
</TR>
<asp:DataList id="Datalist2" Runat="server">
<ItemTemplate>
<tr>
<td width="2%" height="20"></td>
<td width="53%" height="20"><%#DataBinder.Eval(Container,"DataItem.Pname")%></td>
</tr>
</ItemTemplate>
</asp:DataList></TABLE>
</ItemTemplate>
</asp:datalist>
.csprivate void Page_Load(object sender, System.EventArgs e)
{
langgelila.dal.product_company_lb pro=new langgelila.dal.product_company_lb();
pro.Where.Cid.Value=14;
pro.Query.AddOrderBy(langgelila.dal.product_company_lb.ColumnNames.Lname,WhereParameter.Dir.ASC);
if(pro.Query.Load())
{
Datalist1.DataSource=pro.DefaultView;
Datalist1.DataBind();
} } #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.Datalist1.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.Datalist1_ItemDataBound);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion private void Datalist1_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{

DataList   dl = null;
Label   labTypeID = null;
            
dl = (DataList)e.Item.FindControl("datalist2");
labTypeID = (Label) e.Item.FindControl("classid");
langgelila.dal.product_company_lb pro=new langgelila.dal.product_company_lb();
pro.Where.Cid.Value=14;
pro.Where.Id.Value=labTypeID;
pro.Query.AddOrderBy(langgelila.dal.product_company_lb.ColumnNames.Lname,WhereParameter.Dir.ASC);
if(pro.Query.Load())
{
dl.DataSource=pro.DefaultView;
dl.DataBind();
}
}错误
对象必须实现 IConvertible。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.InvalidCastException: 对象必须实现 IConvertible
请指教