Demo: Dictionary>> 泛型读取XML文件数据作为数据源(DataSource)绑定到DropDownList控件 定义个一个公用类
2008-06-30 19:36
931 查看
1true_suffix_name.DataSource = Common.OptionDictionary["suffix"];
2 true_suffix_name.DataTextField = "key";
3 true_suffix_name.DataValueField = "value";
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using ASPSOFT.Utility;
using System.Collections.Generic;
using System.Collections;
using System.Xml;
public class Common
<?xml version="1.0" ?>
2<collect>
3 <sql item="received_by">
4 select staff_name, staff_id from staff where (staff_type='INVESTIGATOR' or staff_type='AGENT') and flag_delete=0 order by staff_name
5 </sql>
6 <sql item="municipality_code">
7 select description, code from asp_lookup where lookup_id='municipality' and varchar10='DCOUNTY' and display = 'Y' order by description
8 </sql>
9</collect>
2 true_suffix_name.DataTextField = "key";
3 true_suffix_name.DataValueField = "value";
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using ASPSOFT.Utility;
using System.Collections.Generic;
using System.Collections;
using System.Xml;
public class Common
<?xml version="1.0" ?>
2<collect>
3 <sql item="received_by">
4 select staff_name, staff_id from staff where (staff_type='INVESTIGATOR' or staff_type='AGENT') and flag_delete=0 order by staff_name
5 </sql>
6 <sql item="municipality_code">
7 select description, code from asp_lookup where lookup_id='municipality' and varchar10='DCOUNTY' and display = 'Y' order by description
8 </sql>
9</collect>
相关文章推荐
- 一个用ArrayCollection作为数据格式 读取远程XML绑定到DropDownList例子
- 本文介绍了如何从XML文件中读取数据绑定到DropDownList。
- XML文件读取数据绑定到DropDownList
- 转载--从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- 从XML文件中读取数据绑定到DropDownList
- 从xml文件中绑定数据到DropDownList控件上
- WinForm控件复杂数据绑定常用数据源(如:Dictionary)(对Combobox,DataGridView等控件DataSource赋值的多种方法)
- WinForm控件复杂数据绑定常用数据源(如:Dictionary)(对Combobox,DataGridView等控件DataSource赋值的多种方法)
- 数据绑定技术—将 XML 文件做为数据源绑定到控件
- 从XML文件中读取数据绑定到DropDownList-.Net编程教程
- 转载--从XML文件中读取数据绑定到DropDownList
- 如何从XML文件中读取数据绑定到DropDownList
- 数据绑定技术_单值数据绑定示例;将 DataTable,DataSet,DataView,DataReader 绑定到 DataGrid 控件示例;DataBinder.Eval;数组的值赋给ListBox1;Hashtable 绑定到;RadioButtonList;将XML 文件做为数据源绑定到控件
- 控件(三)——TreeView控件以XmlDataSource控件为数据源实现简单的绑定
- 定义一个 GlobalSqlConfigHelper 类,实现读取 XML 文件中的 SQL 语句。
- 如何将枚举类型作为数据源绑定在一个DROPDOWNLIST上,并指定用户可见枚举的真实值是名称
- C# 将Dictionary,StringDictionary等集合数据绑定到如comboBox等控件数据源中将获取健值