我在下拉列表綁定數據,如波紋管如何從下拉列表
private void GetallAssociate()
{
var dsAssociate = AdminBL.Ins.selectAllAssociates();
if (dsAssociate.Tables[0].Rows.Count > 0)
{
ddlAssociate.DataSource = dsAssociate;
ddlAssociate.DataTextField = "AssociateName";
ddlAssociate.DataValueField = "Associateid";
ddlAssociate.DataBind();
ddlAssociate.Items.Add("ALL");
ddlAssociate.Items.Insert(0, "Select Associate");
}
}
在此我傳遞參數(INT)值Associateid所以,當我選擇ALL選項時收到錯誤如CAN」傳遞參數t將字符串轉換爲int,所以我在做什麼?