N
n1patrick
Hey, does anyone know how to bind a datarow generated from a Select on
a dataset to a DDL?
Here's the code:
------
....fill my dstItemList with sql query....
DataRow[] drCollection;
drCollection = dstItemList.Tables[0].Select("ItemName LIKE 'blah%'");
ddlItemName.DataSource = drCollection;
ddlItemName.DataTextField = "ItemName";
ddlItemName.DataValueField = "ItemID";
ddlItemName.DataBind();
--------
I thought that is all I had to do. It works with the dataset, but it
isn't finding my datatextfield or datavaluefield with the datarow. It
seems that the rows the Select method creates doesn't maintain the col
names. So how do I bind it?
Thanks
a dataset to a DDL?
Here's the code:
------
....fill my dstItemList with sql query....
DataRow[] drCollection;
drCollection = dstItemList.Tables[0].Select("ItemName LIKE 'blah%'");
ddlItemName.DataSource = drCollection;
ddlItemName.DataTextField = "ItemName";
ddlItemName.DataValueField = "ItemID";
ddlItemName.DataBind();
--------
I thought that is all I had to do. It works with the dataset, but it
isn't finding my datatextfield or datavaluefield with the datarow. It
seems that the rows the Select method creates doesn't maintain the col
names. So how do I bind it?
Thanks