社区
C#
帖子详情
为什么结果listBox1中显示的是:System.Data.DataRowView呢?
myskyfeifei
2003-03-03 02:01:20
listBox1.DataSource=dsEp.Tables["Employees"];;
listBox1.DisplayMember="empname"; //empname是表Employees的字段
为什么结果listBox1中显示的是:System.Data.DataRowView呢?
请指教!
...全文
143
1
打赏
收藏
为什么结果listBox1中显示的是:System.Data.DataRowView呢?
listBox1.DataSource=dsEp.Tables["Employees"];; listBox1.DisplayMember="empname"; //empname是表Employees的字段 为什么结果listBox1中显示的是:System.Data.DataRowView呢? 请指教!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
saucer
2003-03-03
打赏
举报
回复
make sure "empname" is indeed Employees的字段, the following works for me
SqlDataAdapter da = new SqlDataAdapter("select * from employees",
"server=localhost;database=northwind;uid=sa;pwd=;");
DataSet ds = new DataSet();
da.Fill(ds,"Employees");
listBox1 = new ListBox();
listBox1.Location = new Point(100,100);
listBox1.DataSource=ds.Tables["Employees"];
listBox1.ValueMember="EmployeeID";
listBox1.DisplayMember="LastName";
Controls.Add(listBox1);
Inside ASP.NET
Scott Worley Publisher: New Riders Publishing First Edition November 15, 2001 ISBN: 0-7357-1135-6, 730 pages Inside ASP.NET Here’s what re
view
ers are saying about Inside ASP.NET: About the Author Contributing Authors About the Technical Re
view
ers Acknowledgments Tell Us What You Think! Introduction Who Is This Book For? Contents of the Book I: Introducing ASP.NET 1. An Over
view
of ASP.NET ASP.NET The .NET Base Class Libraries ASP.NET Web Application Configuration Session and State Management Cache Management ASP.NET Web Application Development Layers Web Forms XML Web Services COM/COM+ Interoperability and Component Services ADO.NET Migration from Classic ASP to ASP.NET Globalization and Localization Enhanced Security 2. Developing Applications with ASP.NET Application Settings Files The Page Syntax Commonly Used Objects and Classes in ASP.NET Tracing ASP.NET Applications ASP.NET Migration Issues Summary 3. Configuring ASP.NET Applications Deploying the web.config Configuration File Using the
Configuration Section Analyzing the system.web Configuration Sections Summary II: Core ASP.NET 4. Web Form-Based Development Introduction to Web Forms Web Form Architecture Separating Code from the User Interface Server Controls Validation Controls Summary 5. State Management in ASP.NET What Is State Management? Using ASP.NET Application State Management Summary III: ASP.NET and
Data
Access 6. Using ADO.NET in ASP.NET Applications
Data
Access from a Web-Based Perspective ADO and ADO.NET Working with the Main ADO.NET Objects Building
Data
-Oriented Web Forms Transaction-Enabled ASP.NET Applications Summary 7. Using XML in ASP.NET Applications XML Document Structure How XML Is Used in ASP.NET Other XML Technologies Using XML in Your Application Real-World Examples Summary IV: Advanced Technologies 8. XML Web Service Development in ASP.NET Introduction to XML Web Services Using the SOAP Toolkit with XML Web Services XML Web Service Discovery—Advertising Your Service Using an XML Web Service in ASP.NET Pages Summary 9. Securing ASP.NET Applications Over
view
of ASP.NET Security Features Applying Security in ASP.NET Applications Inside ASP.NET Security Other Security Considerations Summary 10. Using Component Services with ASP.NET What Are Component Services? Applying Component Services in an ASP.NET Application The business Object Using the business Object Serviced Components Summary 11. Using Messaging Services with ASP.NET Introduction to Messaging Systems Managing MSMQ Message Queues with Windows 2000 Architecture of the .NET Messaging Services Accomplishing Tasks Using MSMQ and .NET Summary 12. Using Directory Services with ASP.NET Introducing Directory Services How Does Active Directory Work? The Benefits of Active Directory Active Directory Technology Summary Summary 13. Localizing and Globalizing ASP.NET Applications What Is Localization? Localizing an ASP.NET Web Application Summary V: Advanced Web Forms 14. Cache Control in ASP.NET ASP.NET Cache Management Page Output Caching Fragment Caching (Partial Page Caching) Request Caching Summary 15. Creating User and Custom Controls for ASP.NET User Controls Introduction to Custom Controls Summary 16. Mobile Device Development with ASP.NET Wireless Application Protocol (WAP) Wireless Markup Language (WML) Enter ASP.NET Summary VI: Putting It All Together 17. Putting It All Together What Is ProjectPal? Installing the ProjectPal Application A Brief Application Walkthrough Application Architecture ProjectPal Service Layers ProjectPal Client Interfaces The ProjectPal
Data
base The ProjectPal Components Inside the ProjectPal Code Summary VII: Appendixes A. An Over
view
of .NET Multiple Development Platforms Multiple Development Languages .NET Base Class Libraries Common Language Runtime (CLR) Common Type System (CTS) .NET Server Products B. ASP.NET Common Object Reference HttpContext Object (Context Intrinsic Control) The HttpApplication Class The HttpApplicationState Class (Application Intrinsic Object) The HttpSessionState Class ( Session Intrinsic Object) The HttpRequest Class (Request Intrinsic Object) The HttpResponse Class (Response Intrinsic Object) The Server Class ( HttpServerUtility ) SMTPMail API C. ADO Common Object Reference
Data
Set Object
Data
Table Object
Data
Column Object
Data
Row
Class
Data
Relation Object
Data
View
Object
Data
Row
View
Class OLEDB
DATA
Objects SQL
Data
… Objects D. HTML Server Control Reference HtmlForm Object— < form> Element HtmlInputText Object— < input> Element HtmlInputHidden Object— < input type=“hidden”> Element HtmlInputCheckbox Object— < input type=”checkbox”> Element HtmlInputRadioButton Object— < input type=“radiobutton”> Element HtmlInputFile Object— < input type=“file”> Element HtmlTextArea Object— < textarea> Element HtmlButton Object— < button> Element HtmlInputButton Object— < input type=“button”> Element HtmlAnchor Object— < a> Element HtmlImage Object— < img> Element HtmlInputImage Object— < input type=“image”> Element HtmlSelect Object— < select> and
Elements HtmlTable Object— < table> Element HtmlTableRow Object— < tr> Element HtmlTableCell Object— < td> Element E. ASP Server Control Reference Common Properties of the Webcontrol Class The Label Control The Image Control The TextBox Control The DropDownList Control The
ListBox
Control The CheckBox Control The CheckBoxList Control The RadioButton Control The RadioButtonList Control The Button Control The LinkButton Control The ImageButton Control The HyperLink Control The Table Control The TableCell Control The TableRow Control The Panel Control The Repeater Control The
Data
List Control The
Data
Grid Control The AdRotator Control The Calendar Control F. Microsoft Mobile Internet Toolkit Control Groups Form and Layout Controls Presentation Controls Navigation Controls
Data
Entry Controls Validation Controls G. .NET Resource List ASP.NET Web Hosting Sites ASP.NET Web Sites C# Web Sites Visual Basic .NET Web Sites .NET Web Sites XML Web Services Microsoft .NET Websites Microsoft .NET Newsgroups .NET Mailing Lists Magazines
winform Combobox出现System.
Data
.
Data
Row
View
的解决办法
当使用Combobox控件时,出现SelectedValue的值为“System.
Data
.
Data
Row
View
”的原因有两个:在Combobox的
Data
Source不为空的情况下,要么是没有为ValueMember赋值,要么是赋值赋错了,这两种情况下系统就会把SelectedValue的默认值输出来(注意红色部分,如果
Data
Source为空,那么SelectedValue的值为null)。但有时即使你对ValueMember赋了正确的值也会出现这个问题,这里有一个赋值时机选择的问题,请看下面的示例:
Listbox
绑定数据
显示
System.
Data
.
Data
Row
View
LIstBox
绑定数据前,需要设置
显示
为那个字段 如下:
ListBox
1.
Data
TextField = "F1";
ListBox
1.
Data
Bind(); 更多相关技术:武汉信息网 游戏攻略:027游戏攻略 转载于:https://www.cnblogs.com/dreamy/archive/2009/08/16/1547432.html...
C#
中
comboBox绑定数据集后事件
中
取值出System.
data
.
data
Row
View
问题
写了一段代码,希望通过comboBox选项自动关联填充另外两项输入框时发现数据获取异常 comboBox绑定数据源代码如下: this.cbKHMC.
Data
Source = dt; this.cbKHMC.DisplayMember = "Name"; this.cbKHMC.ValueMember = "Value"; ...
C# comboBox对象名 'System.
Data
.
Data
Row
View
' 无效。问题
private void cbxFormula_SelectedIndexChanged(object sender, EventArgs e) {
Data
Table
data
Table = new
Data
Table(); SqlConnection connection = new SqlConnection(connstr)...
C#
110,535
社区成员
642,577
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章