用Dataset对象读取XML内容来绑定下拉列表框
|
<img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt=""><span style="color: #008000">// <span style="color: #008000">读配置文件<span style="color: #008000"><img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt=""> <span style="color: #000000">ds<span style="color: #000000">=<span style="color: #000000"><span style="color: #0000ff">new<span style="color: #000000">DataSet();<img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt="">ds.ReadXml(Application.StartupPath <span style="color: #000000">+<span style="color: #000000"><span style="color: #000000">"<span style="color: #000000">CashAcceptType.xml<span style="color: #000000">"<span style="color: #000000">);<img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt=""> <span style="color: #008000">//<span style="color: #008000">将读取到的记录绑定到下拉列表框中<span style="color: #008000"><img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt=""> <span style="color: #000000"><span style="color: #0000ff">foreach<span style="color: #000000">(DataRowViewdr<span style="color: #0000ff">in<span style="color: #000000">ds.Tables[<span style="color: #000000">0<span style="color: #000000">].DefaultView)<img id="Codehighlighter1_406_478_Open_Image" onclick="code_collapse_toggle(this);" src="https://www.jb51.cc/res/2019/03-05/00/2887d91d0594ef8793c1db92b8a1d545.gif" align="top" alt=""><img id="Codehighlighter1_406_478_Closed_Image" style="display: none" onclick="code_collapse_toggle(this);" src="https://www.jb51.cc/res/2019/03-05/00/7a2b9a960ee9a98bfd25d306d55009f8.gif" align="top" alt=""><span id="Codehighlighter1_406_478_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="https://www.jb51.cc/res/2019/03-05/00/a76e9bb6ed00cf1c9c9f4ee2f04b558b.gif" alt=""> <span id="Codehighlighter1_406_478_Open_Text"><span style="color: #000000">{<img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt="">cbxType.Items.Add(dr[ <span style="color: #000000">"<span style="color: #000000">name<span style="color: #000000">"<span style="color: #000000">].ToString());<img src="https://www.jb51.cc/res/2019/03-05/00/105a1e124122b2abcee4ea8e9f5108f3.gif" align="top" alt="">} <span style="color: #000000"><img src="https://www.jb51.cc/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt="">cbxType.SelectedIndex <span style="color: #000000">=<span style="color: #000000"><span style="color: #000000">0<span style="color: #000000">;(编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc-3 – Razor in-line if语句不工作?
- asp.net-mvc – HttpPost和HttpGet属性在MVC:为什么使用Ht
- asp.net – 如何在web.config中读取会话状态信息
- asp.net – 在IIS 7.5上挂在Session模块上的请求
- asp.net 使用驻留在页面中的Cache缓存常用可定时更新的数据
- asp.net – 默认情况下提供静态文件index.html
- 如何以编程方式单击ASP.NET网页上的按钮?
- 在ASP和ASP.Net之间共享登录系统
- asp.net-mvc – 在ASP.NET MVC控制器结果中设置HTTP状态不呈
- asp.net-mvc – 如何处理MVC5中的配置和代码中的404错误?
- asp.net-mvc – 在ASP.NET MVC 2中模板化Html.Di
- asp.net-web-api – 具有Web Api RC的Ninject In
- asp.net – 为什么Web架构松散耦合?
- asp.net-mvc – 在ASP.NET MVC 2中的RadioButton
- asp.net – 如何提取与Outlook正在显示的employe
- asp.net-mvc – 如何确定视图是否为ASP.NET MVC中
- ASP.NET Web应用程序(MVC)部署自动化和Subversio
- asp.net – 优雅地停止fastcgi-mono-server,网站
- iis-7 – 本地语言的布尔值
- 当使用SignalR和传输模式长轮询时,Asp.net会话永
