.Net API 4.1.4 Dataset

I’m trying to fill a dropdownlist with a DataSet using a specific query (for $a in input()/Item where $a/@Tipo=‘Producto’ return $a/). The error is System.EventArgs.

Thanks
Code:
private void Page_Load(object sender, System.EventArgs e)
{
try
{
// create a TaminoDataAdapter object for the specified Tamino url and collection.
TaminoDataAdapter adapter = new TaminoDataAdapter(dbUrl, collection);
adapter.Behavior = TaminoAdapterBehavior.ReadOnly;

dataset1 (adapter);

}
catch (Exception)
{
MsgBox1.alert(“Connection failed”+e.ToString());
}
}
private void dataset1(TaminoDataAdapter adapter)
{
DataSet ds = new DataSet();
TaminoQuery query = new TaminoQuery("for $a in input()/Item where $a/@Tipo=‘Producto’ return $a/
");
int count = adapter.Fill(ds, query);

DropDownList1.DataSource=ds;
DropDownList1.DataMember=“Item”;
DropDownList1.DataTextField=“Nombre”;
DropDownList1.DataValueField=“Descripcion”;
DropDownList1.DataBind();


}

Could you paste the stack trace and full error?

Douglas Kelly,
Sacramento, California

Stack Trace Error Thanks…

The IListSource does not contain a data source named ‘Item’.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The IListSource does not contain a data source named ‘Item’.

Source Error:


Line 64: DropDownList1.DataTextField=“Nombre”;
Line 65: DropDownList1.DataValueField=“Descripcion”;
Line 66: DropDownList1.DataBind();
Line 67: DataGrid1.DataSource=ds;
Line 68:


Source File: c:\inetpub\wwwroot\sendmail\formaprueba3.aspx.cs Line: 66

Stack Trace:


[HttpException (0x80004005): The IListSource does not contain a data source named ‘Item’.]
System.Web.UI.DataSourceHelper.GetResolvedDataSource(Object dataSource, String dataMember)
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e)
System.Web.UI.Control.DataBind()
Sendmail.formaprueba3.dataset1(TaminoDataAdapter adapter) in c:\inetpub\wwwroot\sendmail\formaprueba3.aspx.cs:66
Sendmail.formaprueba3.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\sendmail\formaprueba3.aspx.cs:45
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Have you verified that your query returns any documents? The error is indicating that there is no “table” named “Item” that can be loaded into the dropdownlist.

Maybe you could post the schema for this doctype and some sample data.

Douglas Kelly,
Sacramento, California