Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Bound listbox - valuemember & displaymember


Message #1 by "Malathi" <senthil.malathi@a...> on Wed, 26 Feb 2003 22:19:18 +0400
I have bound listbox as below.

lstWrap.ValueMember = "ItemCode" 'As it is a number field, I tried tostring
also

lstWrap.DisplayMember = "Description"



I get the following err at run time

System.ArgumentException: Could not bind to the new display member.

I can't see anything wrong in the code. Any hlp/suggestions?




Regards,
S.Malathi, IT Project Analyst
ADNOC Distribution
P.O. 4188, Abu Dhabi
Tel : 6959480 (D)
Mob : 050 5316055
Fax : 6742265



DISCLAIMER:
-------------------------------------------------------------------------------------------------------------
 Please note that our domain name is changed from adnoc-fod.co.ae to adnoc-dist.co.ae
 Hence change your email addresses accordingly to reflect these changes.
 This communication may contain confidential information.  If you are not the intended recipient 
 please inform us immediately.
 For complete disclaimer note please visit our website at:
 http://www.adnoc-dist.co.ae/emaildisclaimer.htm
                                                                                                                             
 Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
 Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae

Message #2 by "Brian Smith" <bsmith@l...> on Wed, 26 Feb 2003 20:36:53 -0000
You have to set the DataSource to the DataTable or DataView. Listboxes
can bind to any collection of objects, and ValueMemeber does not have to
be a string...

brian

-----Original Message-----
From: Malathi [mailto:senthil.malathi@a...] 
Sent: Wed, 26 Feb 2003 18:19
To: ADO.NET
Subject: [ado_dotnet] Bound listbox - valuemember & displaymember


I have bound listbox as below.

lstWrap.ValueMember = "ItemCode" 'As it is a number field, I tried
tostring also

lstWrap.DisplayMember = "Description"



I get the following err at run time

System.ArgumentException: Could not bind to the new display member.

I can't see anything wrong in the code. Any hlp/suggestions?




Regards,
S.Malathi, IT Project Analyst
ADNOC Distribution
P.O. 4188, Abu Dhabi
Tel : 6959480 (D)
Mob : 050 5316055
Fax : 6742265



DISCLAIMER:
------------------------------------------------------------------------
-------------------------------------
 Please note that our domain name is changed from adnoc-fod.co.ae to
adnoc-dist.co.ae  Hence change your email addresses accordingly to
reflect these changes.  This communication may contain confidential
information.  If you are not the intended recipient 
 please inform us immediately.
 For complete disclaimer note please visit our website at:
http://www.adnoc-dist.co.ae/emaildisclaimer.htm
 

 Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
 Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae


===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
 

Message #3 by "h@f... on Wed, 26 Feb 2003 18:17:32 -0800 (PST)
aoa.
1) if u want to add values at design time,  then check its items probperty.
2) if u want by code then
for i = 0 tables.rows.count
list.items.add(value)
3) and
list.datasource=viewname or Dataset name.
Hafiz Qasim
Punjab University, Lahore.
 
 Malathi <senthil.malathi@a...> wrote:I have bound listbox as below.

lstWrap.ValueMember = "ItemCode" 'As it is a number field, I tried tostring
also

lstWrap.DisplayMember = "Description"



I get the following err at run time

System.ArgumentException: Could not bind to the new display member.

I can't see anything wrong in the code. Any hlp/suggestions?




Regards,
S.Malathi, IT Project Analyst
ADNOC Distribution
P.O. 4188, Abu Dhabi
Tel : 6959480 (D)
Mob : 050 5316055
Fax : 6742265



DISCLAIMER:
-------------------------------------------------------------------------------------------------------------
Please note that our domain name is changed from adnoc-fod.co.ae to adnoc-dist.co.ae
Hence change your email addresses accordingly to reflect these changes.
This communication may contain confidential information. If you are not the intended recipient 
please inform us immediately.
For complete disclaimer note please visit our website at:
http://www.adnoc-dist.co.ae/emaildisclaimer.htm

Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae


===
Fast Track ADO.NET with C# is a concise introduction to the concepts, techniques, and libraries that you will need in order to start
using ADO.NET in your applications. The book covers DataSets and Typed DataSets, accessing data using DataReaders and DataAdaptors,
the close relationship between ADO.NET and XML, how and where to use ADO.NET in your enterprise applications, and how to use Web
Services and ADO.NET to easily pass data between applications.
http://www.wrox.com/books/1861007604.htm


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
Message #4 by "Malathi" <senthil.malathi@a...> on Fri, 28 Feb 2003 16:51:17 +0400
Hi Brian,
I've already bound the datasource to a dataview.

when I say
lstWrap.ValueMember =3D "Description"

then it works but this will not bind the itemcode to the listbox. My
requirement is a typical listbox of look up vals frm a database.

I even checked on some saple codeon the internet. I had the same code as 
in
the sample. But stiill mine doesn't work. Any suggestions?

Regards,
S.Malathi

-----Original Message-----
From: Brian Smith [mailto:bsmith@l...]
Sent: Thursday, February 27, 2003 12:37 AM
To: ADO.NET
Subject: [ado_dotnet] RE: Bound listbox - valuemember & displaymember


You have to set the DataSource to the DataTable or DataView. Listboxes
can bind to any collection of objects, and ValueMemeber does not have to
be a string...

brian

-----Original Message-----
From: Malathi [mailto:senthil.malathi@a...]
Sent: Wed, 26 Feb 2003 18:19
To: ADO.NET
Subject: [ado_dotnet] Bound listbox - valuemember & displaymember


I have bound listbox as below.

lstWrap.ValueMember =3D "ItemCode" 'As it is a number field, I tried
tostring also

lstWrap.DisplayMember =3D "Description"



I get the following err at run time

System.ArgumentException: Could not bind to the new display member.

I can't see anything wrong in the code. Any hlp/suggestions?




Regards,
S.Malathi, IT Project Analyst
ADNOC Distribution
P.O. 4188, Abu Dhabi
Tel : 6959480 (D)
Mob : 050 5316055
Fax : 6742265



DISCLAIMER:
------------------------------------------------------------------------
-------------------------------------
 Please note that our domain name is changed from adnoc-fod.co.ae to
adnoc-dist.co.ae  Hence change your email addresses accordingly to
reflect these changes.  This communication may contain confidential
information.  If you are not the intended recipient
 please inform us immediately.
 For complete disclaimer note please visit our website at:
http://www.adnoc-dist.co.ae/emaildisclaimer.htm


 Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
 Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae


=3D=3D=3D
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003



=3D=3D=3D
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using 
ADO.NET
in your applications. The book covers DataSets and Typed DataSets, 
accessing
data using DataReaders and DataAdaptors, the close relationship between
ADO.NET and XML, how and where to use ADO.NET in your enterprise
applications, and how to use Web Services and ADO.NET to easily pass 
data
between applications.
http://www.wrox.com/books/1861007604.htm



DISCLAIMER:
-------------------------------------------------------------------------
------------------------------------
 Please note that our domain name is changed from adnoc-fod.co.ae to 
adnoc-dist.co.ae
 Hence change your email addresses accordingly to reflect these changes.
 This communication may contain confidential information.  If you are 
not the intended recipient
 please inform us immediately.
 For complete disclaimer note please visit our website at:
 http://www.adnoc-dist.co.ae/emaildisclaimer.htm
                                                                         
                                                   
 Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
 Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae
Message #5 by "Brian Smith" <bsmith@l...> on Fri, 28 Feb 2003 13:48:41 -0000
Are you sure you've spelt it correctly - it's case-sensitive?

brian

-----Original Message-----
From: Malathi [mailto:senthil.malathi@a...] 
Sent: Fri, 28 Feb 2003 12:51
To: ADO.NET
Subject: [ado_dotnet] RE: Bound listbox - valuemember & displaymember


Hi Brian,
I've already bound the datasource to a dataview.

when I say
lstWrap.ValueMember = "Description"

then it works but this will not bind the itemcode to the listbox. My
requirement is a typical listbox of look up vals frm a database.

I even checked on some saple codeon the internet. I had the same code as
in the sample. But stiill mine doesn't work. Any suggestions?

Regards,
S.Malathi

-----Original Message-----
From: Brian Smith [mailto:bsmith@l...]
Sent: Thursday, February 27, 2003 12:37 AM
To: ADO.NET
Subject: [ado_dotnet] RE: Bound listbox - valuemember & displaymember


You have to set the DataSource to the DataTable or DataView. Listboxes
can bind to any collection of objects, and ValueMemeber does not have to
be a string...

brian

-----Original Message-----
From: Malathi [mailto:senthil.malathi@a...]
Sent: Wed, 26 Feb 2003 18:19
To: ADO.NET
Subject: [ado_dotnet] Bound listbox - valuemember & displaymember


I have bound listbox as below.

lstWrap.ValueMember = "ItemCode" 'As it is a number field, I tried
tostring also

lstWrap.DisplayMember = "Description"



I get the following err at run time

System.ArgumentException: Could not bind to the new display member.

I can't see anything wrong in the code. Any hlp/suggestions?




Regards,
S.Malathi, IT Project Analyst
ADNOC Distribution
P.O. 4188, Abu Dhabi
Tel : 6959480 (D)
Mob : 050 5316055
Fax : 6742265



DISCLAIMER:
------------------------------------------------------------------------
-------------------------------------
 Please note that our domain name is changed from adnoc-fod.co.ae to
adnoc-dist.co.ae  Hence change your email addresses accordingly to
reflect these changes.  This communication may contain confidential
information.  If you are not the intended recipient  please inform us
immediately.  For complete disclaimer note please visit our website at:
http://www.adnoc-dist.co.ae/emaildisclaimer.htm


 Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
 Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae


===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003



===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 



DISCLAIMER:
------------------------------------------------------------------------
-------------------------------------
 Please note that our domain name is changed from adnoc-fod.co.ae to
adnoc-dist.co.ae  Hence change your email addresses accordingly to
reflect these changes.  This communication may contain confidential
information.  If you are not the intended recipient 
 please inform us immediately.
 For complete disclaimer note please visit our website at:
http://www.adnoc-dist.co.ae/emaildisclaimer.htm
 

 Adnoc Distribution-Tel:02-6771300;Fax:02-6722322;
 Email:webmaster@a...;Website:http://www.adnoc-dist.co.ae

===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
 


  Return to Index