数据绑定到带有数据集的下拉列表 [英] data binding to drop down list with dataset

查看:77
本文介绍了数据绑定到带有数据集的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解决以下错误的方法吗?

Type ''System.Web.UI.WebControls.ListItem'' in Assembly ''System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'' is not marked as serializable

我在这里描述了我的数据绑定代码

设计页面

i need the solution for following error is any one can give?

Type ''System.Web.UI.WebControls.ListItem'' in Assembly ''System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'' is not marked as serializable

i described here my code of databinding

design page

<asp:DropDownList ID="DdlDealerName" runat="server"                                                    onselectedindexchanged="DdlDealerName_SelectedIndexChanged1">


后面的代码


code behind

dsDM = objBusInfoBAl.GetDealerMasterInfoDetails("MS", OrgId, BusId, FrmType);
            if (dsDM != null)
            {
                if (dsDM.Tables[0].Rows.Count > 0)
                {
                    DdlDealerName.DataSource = dsDM.Tables[0].DefaultView;
                    DdlDealerName.DataTextField = "BUSINESS_NAME";
                    DdlDealerName.DataValueField = "BUSINESS_ID";
                    dlDealerName.DataBind()
                 }
             }

推荐答案

This[^] may help.


这篇关于数据绑定到带有数据集的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆