- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
手工绑定combobox的方法(Method of manually binding combobox)
手工绑定combobox的方法(Method of manually binding combobox)
Data binding in Visual Studio C
Five. Data binding of complex components:
In the introduction above, it was learned that data binding to complex components is done by setting certain attributes of the component. Lets begin by introducing the data binding of the ComboBox component
(1) data binding of.ComboBox components:
After you get the data set, you can complete the data binding only by setting the three attributes of the ComboBox component. These three attributes are: DisplayMember, ValueMember. Where DataSource is the data set to display, DisplayMember is the field displayed by the ComboBox component, and ValueMember is the actual value used. As follows:
ComboBox1.DataSource = myDataSet;
ComboBox1.DisplayMember = person.xm;
ComboBox1.ValueMember = person.xm;
Note: at this point, the binding is the XM field of the person table in the Access 2000 database. From this you can get the source code of the ComboBox component data binding (Combo01.cs), and the code operation database is Access 2000:
Public class Form1: Form
{
Private ComboBox ComboBox1;
Private Button button1;
Private System.Data.DataSet myDataSet;
Private, System.ComponentModel.Container, components = null;
Public, Form1 ()
{
File:// opens the data link and gets the data set
GetConnect ();
InitializeComponent ();
}
The resources used in the file:// cleanup program
Protected, override, void, Dispose (bool, disposing)
{
If (disposing)
{
If (components = = null)
{
Components.Dispose ();
}
}
Base.Dispose (disposing);
}
Private, void, GetConnect ()
{
File:// creates a OleDbConnection
String strCon = Provider = Microsoft.Jet.OLEDB.4.0; Data Source = db.mdb;
OleDbConnection myConn = new OleDbConnection (strCon);
String strCom = SELECT * FROM person;
File:// creates a DataSet
MyDataSet = new, DataSet ();
MyConn.Open ();
File:// uses OleDbDataAdapter to get a data set
OleDbDataAdapter myCommand = new OleDbDataAdapter (strCom, myConn);
File:// binds the Dataset
您可能关注的文档
- 微信的商业模式与创业机会(WeChat's business models and entrepreneurial opportunities).doc
- 微博舆论(Micro-blog consensus).doc
- 微商陷入困境,社交电商前途迷茫(Micro quotient into trouble, the future of social electricity supplier confused).doc
- 微信朋友圈,是客厅还是围城(WeChat's circle of friends, living room or besieged city).doc
- 徐淑英中国管理研究企业培训应有本土特征(Xu Shuying China's management research, enterprise training should have local characteristics).doc
- 微机原理_在线作业_b(The principle of microcomputer _ online operation _b).doc
- 微机原理上机考试题库加答案(The principle of microcomputer examination questions with answers).doc
- 微型住宅或主宰楼市未来(Mini house or dominate the future of the property market).doc
- 微机原理考试题目(Examination questions of Microcomputer Principle).doc
- 循环呼吸(Circular Breathing).doc
- 中国国家标准 GB 14287.5-2025电气火灾监控系统 第5部分:测量热解粒子式电气火灾监控探测器.pdf
- 《GB/T 42706.4-2025电子元器件 半导体器件长期贮存 第4部分:贮存》.pdf
- GB/T 42706.4-2025电子元器件 半导体器件长期贮存 第4部分:贮存.pdf
- 中国国家标准 GB/T 42706.4-2025电子元器件 半导体器件长期贮存 第4部分:贮存.pdf
- 中国国家标准 GB/T 19436.2-2025机械电气安全 电敏保护设备 第2部分:使用有源光电保护装置(AOPDs)设备的特殊要求.pdf
- 《GB/T 19436.2-2025机械电气安全 电敏保护设备 第2部分:使用有源光电保护装置(AOPDs)设备的特殊要求》.pdf
- 《GB 27898.4-2025固定消防给水设备 第4部分:消防气体顶压给水设备》.pdf
- GB 27898.4-2025固定消防给水设备 第4部分:消防气体顶压给水设备.pdf
- GB/T 31270.1-2025化学农药环境安全评价试验准则 第1部分:土壤代谢试验.pdf
- 中国国家标准 GB/T 31270.1-2025化学农药环境安全评价试验准则 第1部分:土壤代谢试验.pdf
最近下载
- 2025幼儿园《防拐骗》安全教育ppt完整版.pptx VIP
- 市政工程预算编制与审核指南.docx VIP
- 《脑血管搭桥手术》课件.ppt VIP
- 病理生理学—肝功能不全.ppt VIP
- 输电线路放线紧线课件.pptx VIP
- 2023年太原学院计算机科学与技术专业《计算机网络》科目期末试卷A(有答案).docx VIP
- 沪科安徽版 八年级物理下册 第十一章 综合测试卷(2025年春).pdf VIP
- 统编版七年级语文上册《24.2蚊子和狮子》教学课件.pptx VIP
- 1.最新版历年高考必备高频词汇汇编(完整 800 词版).pdf
- 初中地理:2025年秋新教材八上《地理》必背知识(背诵版+默写版).pdf VIP
原创力文档


文档评论(0)