473,765 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not bind to the new display member error

i've got a table in my dataSet that looks like this:

<tblTasks>

<taskID>0</taskID>

<projectID>0</projectID>

<summary>-- Select A Task --</summary>

</tblTasks>

<tblTasks>

<taskID>662</taskID>

<projectID>19 </projectID>

<summary>Additi on - Add Update to MeetComp</summary>

</tblTasks>

when trying to bind to my comboBox as follows:

cboTasks.DataSo urce = oDataSet.Tables["tblTasks"].Select(null, "taskID",
DataViewRowStat e.CurrentRows);

cboTasks.Displa yMember = "summary";

cboTasks.ValueM ember = "taskID";

i get the "Could not bind ot the new display member" error. any ideas why?

tks

Nov 17 '05 #1
2 4694
Dica,

In this, you are binding to an array of data rows. I don't think that
this is a good idea.

Try creating a new DataView and binding to it, like this:

// The data view.
DataView view = new DataView(oDataS et.Tables["tblTasks"], null, "taskID",
DataViewRowStat e.CurrentRows);

// Set the display member before setting the data source.
cboTasks.Displa yMember = "summary";

// Set the data source to the data view.
cboTasks.DataSo urce = view;

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Dica" <ge*****@hotmai l.com> wrote in message
news:IY******** *************** *******@rogers. com...
i've got a table in my dataSet that looks like this:

<tblTasks>

<taskID>0</taskID>

<projectID>0</projectID>

<summary>-- Select A Task --</summary>

</tblTasks>

<tblTasks>

<taskID>662</taskID>

<projectID>19 </projectID>

<summary>Additi on - Add Update to MeetComp</summary>

</tblTasks>

when trying to bind to my comboBox as follows:

cboTasks.DataSo urce = oDataSet.Tables["tblTasks"].Select(null, "taskID",
DataViewRowStat e.CurrentRows);

cboTasks.Displa yMember = "summary";

cboTasks.ValueM ember = "taskID";

i get the "Could not bind ot the new display member" error. any ideas why?

tks

Nov 17 '05 #2

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:u1******** ******@TK2MSFTN GP12.phx.gbl...
Dica,

In this, you are binding to an array of data rows. I don't think that
this is a good idea.

Try creating a new DataView and binding to it, like this:

// The data view.
DataView view = new DataView(oDataS et.Tables["tblTasks"], null, "taskID",
DataViewRowStat e.CurrentRows);

// Set the display member before setting the data source.
cboTasks.Displa yMember = "summary";

// Set the data source to the data view.
cboTasks.DataSo urce = view;
works perfect. tks.

however, i'm curious, why set the display member prior to setting the
dataSource?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Dica" <ge*****@hotmai l.com> wrote in message
news:IY******** *************** *******@rogers. com...
i've got a table in my dataSet that looks like this:

<tblTasks>

<taskID>0</taskID>

<projectID>0</projectID>

<summary>-- Select A Task --</summary>

</tblTasks>

<tblTasks>

<taskID>662</taskID>

<projectID>19 </projectID>

<summary>Additi on - Add Update to MeetComp</summary>

</tblTasks>

when trying to bind to my comboBox as follows:

cboTasks.DataSo urce = oDataSet.Tables["tblTasks"].Select(null, "taskID",
DataViewRowStat e.CurrentRows);

cboTasks.Displa yMember = "summary";

cboTasks.ValueM ember = "taskID";

i get the "Could not bind ot the new display member" error. any ideas why?
tks


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2942
by: P G | last post by:
I hope this is on topic here. I have a problem compiling a simple example of the use of boost::bind. Please take a look at the program below. /**************************************************************************/ #include <boost/function.hpp> #include <boost/bind.hpp> #include <boost/shared_ptr.hpp>
4
2730
by: Arturo Cuebas | last post by:
The program below contains a compile error. Following the program you will find the typical fix then my idea for a library that facilitates a more elegant fix. #include <boost\bind.hpp> using namespace boost; struct C {
7
8974
by: USUN_TO | last post by:
Hi, i got problem when i bind in this way: local_addr.sin_family = AF_INET; local_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); local_addr.sin_port = htons(CLIENT_PORT); i can easly bind port without any SIGSEGV (segmentation fault) but MSDN wrote:
6
3337
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on different rows in the datagrid, the textbox content doesn't change to reflect the change. How can I address this? Also, If the user change the text in the textbox then how do I refesh the display in the datagrid to reflect the changes? ...
11
2499
by: Michael Kellogg | last post by:
I have a collection of custom objects that I am displaying in a Windows Forms Datagrid. To display it, I take the collection and build a DataTable object on the fly, then set the grid's DataSource to the DataTable. The code for this is lengthy and the grid is obviously not editable. I've read it's possible to connect my collection directly, and have it be editable, too. Can anyone point me to a resource that can walk me through this? ...
6
4033
by: Toby Bradshaw | last post by:
Hi, Consider the following: class A { public: virtual bool foo() = 0; };
1
3848
by: Olaf Petzold | last post by:
Hi, at this time I try to combine Qt and boost. Unfortunately I've run into trouble: void QWidget::insertAction ( QAction * before, QAction * action ); class QAction : public QWidget { ... }; class ActionCategory { ...
2
2576
by: =?Utf-8?B?SmFtZXMgTWFydGlu?= | last post by:
I have a table that I dragged onto a form from a dataset. I changed some of the fields to comboboxes and set the data source, display member (text), and value member (int) to another table within the same dataset. I can start the form and cycle through existing records. If I click on one of the comboboxes it will display the text values but then I can no longer click on any other field. I can continue to click on the same combobox and the...
3
3343
by: Giovanni Gherdovich | last post by:
Hello, in the following code I have a pointer (to function), say p, of type double (*)(double, double, void*) and I try to fix the second argument of the function *p to a given value (using boost::bind), but the compiler complains, because of a type mismatch in an assignment which I think should be legal:
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.