473,507 Members | 4,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combobox datasource

Why this does not work???

cb1 - combobox
DataProvider.DataProvider.DS_BringRacks() - DataSet
cb1.DataSource=DataProvider.DataProvider.DS_BringR acks().Tables[0];

cb1.DisplayMember = "id";

cb1.ValueMember = cb1.DisplayMember;

it diplays in combobox : "System.Data.DataRowView" instead of real values.
in debug view I can see that the dataset contants 1 column, named "id" with
3 rows, which have values.

So why this do not working???
Nov 15 '05 #1
3 12078
Does this work??

dvExample = new DataView
(DataProvider.DataProvider.DS_BringRacks().Tables
[0], "", "id ASC", DataViewRowState.OriginalRows);

cb1.DataSource = dvExample;
cb1.DisplayMember = "id";
cb1.ValueMember = cb1.DisplayMember;
Jerry Negrelli
Senior Software Engineer
Data Scientific Corporation
-----Original Message-----
Why this does not work???

cb1 - combobox
DataProvider.DataProvider.DS_BringRacks() - DataSet
cb1.DataSource=DataProvider.DataProvider.DS_Bring Racks ().Tables[0];
cb1.DisplayMember = "id";

cb1.ValueMember = cb1.DisplayMember;

it diplays in combobox : "System.Data.DataRowView" instead of real values.in debug view I can see that the dataset contants 1 column, named "id" with3 rows, which have values.

So why this do not working???
.

Nov 15 '05 #2
Nop, tried as well to create absolute new dataset - nothing...
I'm afraid it's because of event looker (I have event onindexchage on this
combobox for some reason it fired event BEFORE the application fully up on
dataload...)

What do you think?
"Jerry Negrelli" <je************@nospamdatascientific.com> wrote in message
news:01****************************@phx.gbl...
Does this work??

dvExample = new DataView
(DataProvider.DataProvider.DS_BringRacks().Tables
[0], "", "id ASC", DataViewRowState.OriginalRows);

cb1.DataSource = dvExample;
cb1.DisplayMember = "id";
cb1.ValueMember = cb1.DisplayMember;
Jerry Negrelli
Senior Software Engineer
Data Scientific Corporation
-----Original Message-----
Why this does not work???

cb1 - combobox
DataProvider.DataProvider.DS_BringRacks() - DataSet
cb1.DataSource=DataProvider.DataProvider.DS_Bring Racks

().Tables[0];

cb1.DisplayMember = "id";

cb1.ValueMember = cb1.DisplayMember;

it diplays in combobox : "System.Data.DataRowView"

instead of real values.
in debug view I can see that the dataset contants 1

column, named "id" with
3 rows, which have values.

So why this do not working???
.

Nov 15 '05 #3

Hi Tamir,

Based on my understanding, in your
DataProvider.DataProvider.DS_BringRacks(), it means that DataProvider
namespace contains a DataProvider class whoes DS_BringRacks() method
returns a dataset.

I think you should check if your dataset is generated correctly.
If it is generated well, I think your problem must be the DisplayMember. I
think the "id" field you assign to DisplayMember is not the correctly field
name in the dataset.

Sample listed below, this works well:(I use the default sql server database
to generate the dataset then bind it to combobox)

SqlDataAdapter adapter=new SqlDataAdapter("select * from
jobs","server=localhost;database=pubs;user=sa;pwd= ");
DataSet ds=new DataSet();
adapter.Fill (ds);
comboBox1.DataSource=ds.Tables[0];
comboBox1.DisplayMember="job_desc";
comboBox1.ValueMember =comboBox1.DisplayMember ;

While I change the "job_desc" to "job_des"(Lost one character), then the
combobox will display "System.Data.DataRowView".

If you have anything unclear, please feel free to let me know

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <ta**********@tcon-NOSPAM.co.il>
| References: <uk**************@TK2MSFTNGP09.phx.gbl>
<01****************************@phx.gbl>
| Subject: Re: combobox datasource
| Date: Mon, 10 Nov 2003 19:17:06 +0200
| Lines: 50
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <Oz**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:198111
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Nop, tried as well to create absolute new dataset - nothing...
| I'm afraid it's because of event looker (I have event onindexchage on this
| combobox for some reason it fired event BEFORE the application fully up on
| dataload...)
|
| What do you think?
|
|
| "Jerry Negrelli" <je************@nospamdatascientific.com> wrote in
message
| news:01****************************@phx.gbl...
| > Does this work??
| >
| > dvExample = new DataView
| > (DataProvider.DataProvider.DS_BringRacks().Tables
| > [0], "", "id ASC", DataViewRowState.OriginalRows);
| >
| > cb1.DataSource = dvExample;
| > cb1.DisplayMember = "id";
| > cb1.ValueMember = cb1.DisplayMember;
| >
| >
| > Jerry Negrelli
| > Senior Software Engineer
| > Data Scientific Corporation
| >
| > >-----Original Message-----
| > >Why this does not work???
| > >
| > >cb1 - combobox
| > >DataProvider.DataProvider.DS_BringRacks() - DataSet
| > >cb1.DataSource=DataProvider.DataProvider.DS_Bring Racks
| > ().Tables[0];
| > >
| > >cb1.DisplayMember = "id";
| > >
| > >cb1.ValueMember = cb1.DisplayMember;
| > >
| > >it diplays in combobox : "System.Data.DataRowView"
| > instead of real values.
| > >in debug view I can see that the dataset contants 1
| > column, named "id" with
| > >3 rows, which have values.
| > >
| > >So why this do not working???
| > >
| > >
| > >.
| > >
|
|
|

Nov 15 '05 #4

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

Similar topics

0
1481
by: CalPARK InterNetStation | last post by:
Could anyone explain why the difference of behavior betweein Case1 and Case2 occurs? Microsoft Visual C#.NET 55607-652-0000007-18218 Windows Forms Application 1. put a TabControl on a Form...
3
3016
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
2
4316
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
8
1955
by: Steve B. | last post by:
My Program: a local C# ADO.Net application using VS 2003 Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection,...
2
1779
by: jobi | last post by:
Hi, I have this combobox which has a table from a dataset as datasource. When I click an item on the combobox-list , I would like to display (in textfield) the value from an other column that...
2
12495
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of...
4
4602
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
6
2842
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
2
15558
by: samueltilden | last post by:
This problem should be simple. I am using Visual Studio 2003, Version 1.1 I am writing a desktop application in which I am binding a DataTable to the DataSource of a ComboBox. // I have...
0
7105
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...
0
7371
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...
0
7479
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...
0
5617
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,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
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...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
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 ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.