用Dataset对象读取XML内容来绑定下拉列表框
? <img src="https://www.52php.cn/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.52php.cn/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.52php.cn/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.52php.cn/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.52php.cn/res/2019/03-05/00/33d02437d135341f0800e3d415312ae8.gif" align="top" alt=""> <span style="color: #000000">????????????<span style="color: #0000ff">foreach<span style="color: #000000">?(DataRowView?dr?<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.52php.cn/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.52php.cn/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.52php.cn/res/2019/03-05/00/a76e9bb6ed00cf1c9c9f4ee2f04b558b.gif" alt=""> <span id="Codehighlighter1_406_478_Open_Text"><span style="color: #000000">{<img src="https://www.52php.cn/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.52php.cn/res/2019/03-05/00/105a1e124122b2abcee4ea8e9f5108f3.gif" align="top" alt="">????????????} <span style="color: #000000"><img src="https://www.52php.cn/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 – 如果ModelState中不存在某个键,我该如何添加
- razor – ASP.NET MVC 4 – for循环帖子模型集合属性,但for
- asp.net-mvc – 在ASP.NET MVC中执行原始SQL查询,数据库优先
- asp.net-mvc-3 – ASP.Net MVC 3 ViewModel数据注释
- 使用Asp.net路由的IRouteHandler.GetHttpHandler中的会话为
- asp.net-mvc – 使用源代码的Real World ASP.NET MVC应用程
- asp.net-mvc – MVC模型绑定到集合不以0索引开头的集合
- asp.net-core – ASP.Net 5类库中的EntityFramework命令?
- ASP.NET – ERR_EMPTY_RESPONSE /重置连接/无法显示页面
- asp.net – Visual Studio开发服务器(2010)和NTLM授权
- ASP与PHP的编译
- asp.net – “值不能为null或为空.当ModelState出
- [ASP.NET] iTextSharp产生PDF档...Part_1(把Grid
- asp.net-mvc – VS2013不编译ASP.NET MVC5视图
- 如何将文件从ASP.NET上载到另一个Web应用程序
- asp.net-web-api – 在Webapi中使用Url.Link与属
- asp.net – 在FileUpload Control中获取文件的扩
- 在viewstate(或其他想法)中的asp.net商店对象类
- asp.net – Mono和IHttpHandler
- asp.net-mvc – Elmah日志文件删除,手动还是有设