473,394 Members | 1,893 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,394 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 12070
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.