本文介绍了数据集中的DataSet问题与设置DataSource有关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在另一个数据集的ds列中有samo DataSet。

Hi, i have samo DataSet in "ds" column of another dataset.

for(int i...)
{
    DataSet data=....
    ds.Tables[0].Rows[i]["Datas"] = data;
}

cList.DataSource = ds;
cList.DataBind();



在aspx文件中我有转发器和DropDownList(填充下拉列表,数据集在其他数据集中)


In aspx file i have repeater and DropDownList (fill dropdownlist with dataset which is in other dataset)

<asp:Repeater ID="cList" runat="server">
<asp:DropDownList runat="server" ID="selectFProd" DataSource="<%# Eval("Datas") %>" DataTextField="Col1" DataValueField="Col2ID"></asp:DropDownList>
</asp:Repeater>



当我运行我的asp.net应用程序时,我得到了这个错误


When i run my asp.net application, i get this error

Parser Error Message: The server tag is not well formed.



for line,where is is DropDownList。我做错了什么?谢谢


for line, where is the DropDownList. What im doing wrong? Thanks

推荐答案

<asp:DropDownList runat="server" ID="selectFProd" DataSource="<%# Eval(\"Datas\") %>" 



<asp:dropdownlist runat="server" id="sFP" datasource="<%# fillDataList((string)DataBinder.Eval(Container.DataItem, "C_ID")) %>" datatextfield="Title" xmlns:asp="#unknown"></asp:dropdownlist>



file.aspx.cs


file.aspx.cs

public DataView fillDataList(string id)
{
    DataSet data = DB.GetData("SELECT * FROM … WHERE FK =" + id + ")", false);

    DataView myView = data.Tables[0].DefaultView;

    return myView;
}


这篇关于数据集中的DataSet问题与设置DataSource有关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 14:45