473,224 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

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 12042
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
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
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
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
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
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
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
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
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
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.