473,808 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Complex Bind Combo Box VB.Net

I am new to VB.NET and I am trying to use a complex bind for a combo
box. I have successfully created a data set, I have set my DataSource
value to the dataset and the DisplayMember value to the field in the
dataset I wish to utilize. When I run the form the combo box has no
information. What am I doing wrong?

Thanks!!
Travis
Nov 20 '05 #1
2 6954
Hi,

You should use a datasource of dataset.table.

Here is an example Assumes you import system.data.ole db

Dim conn As OleDbConnection

Dim strConn As String

Dim strSQL As String

Dim da As OleDbDataAdapte r

strConn = "Provider = Microsoft.Jet.O LEDB.4.0;"

strConn += "Data Source = Northwind.mdb;"

conn = New OleDbConnection (strConn)

da = New OleDbDataAdapte r("Select * From Categories", conn)

da.Fill(ds, "Categories ")

ComboBox1.DataS ource = ds.Tables("Cate gories")

ComboBox1.Displ ayMember = "CategoryNa me"

Ken
--------------------
"Travis" <su*****@dekate chnologies.com> wrote in message
news:15******** *************** ***@posting.goo gle.com...
I am new to VB.NET and I am trying to use a complex bind for a combo
box. I have successfully created a data set, I have set my DataSource
value to the dataset and the DisplayMember value to the field in the
dataset I wish to utilize. When I run the form the combo box has no
information. What am I doing wrong?

Thanks!!
Travis

Nov 20 '05 #2
Cor
Hi Travis,

You have to set the datasource to a dataset table when you use a dataset not
the dataset itself.
something as
\\\
combobox1.datas ource = dataset.tables( "mytable")
///

I hope this helps,

Cor
I am new to VB.NET and I am trying to use a complex bind for a combo
box. I have successfully created a data set, I have set my DataSource
value to the dataset and the DisplayMember value to the field in the
dataset I wish to utilize. When I run the form the combo box has no
information. What am I doing wrong?

Nov 20 '05 #3

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

Similar topics

34
6476
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment operator. Here's what I'm trying to do. I've defined class Complex as class Complex { friend ostream &operator<<( ostream &, Complex & ); public: Complex( float = 0.0, float = 0.0 );
2
2491
by: Ken Powers | last post by:
Hello everyone, I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! Private Sub Get_Data() Try Dim sqlcmd = New SqlCommand("Select * from Utility order by Utility", sqlConn)
0
1671
by: Ken Powers | last post by:
Hello everyone, Sorry about the repost, my second VB.NET App is done with the exception of this error. I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! Private Sub Get_Data() Try Dim sqlcmd = New SqlCommand("Select * from Utility order by
4
2489
by: Steve | last post by:
C# I have some combo boxes, full of lookup descriptions. When I retrieve a dataset for my record, the values that need binding to the combos are the actual record IDs that relate to these lookup descriptions. How do I bind them up in this case? Thanks Steve
0
1226
by: Kobe | last post by:
I am trying to bind data in a collection to a combo box in a windows application. I am able to retrieve records from the collection but when I bind it to the combo box, nothing is displayed cmbo.DataSource = amap.Streets cmbo.DisplayMember = "StreetName" cmbo.ValueMember = "MSN_ID" This same code has worked before on an older machine. I just rebuilt the source on a new laptop and noticed this problem. Could this have anything to
2
2142
by: Random | last post by:
I have a very full and complex object that contains objects as properties and a few collections, and I'm working to databind it to a page. A lot of textbox and dropdowns on the page, a few grids. I'll need to be able to easily read back edits on a postback, so I'm looking at different scenarios that people have had to implement aside from the simple objectdatasource and gridview examples. Some suggestions I've seen involve using the...
1
1300
by: svchosthunter | last post by:
I want to bind a gridview with data table but I need one field as combo box as DataGridviewComboBoxColumn I want that when I bind my grid there should be a combo box in grid which will be binded to another datatable .I want all fields on grid as databound to datatable please help me hyder_master
0
1029
by: dudeja.rajat | last post by:
Hi, I'm using Tkinter and Tix. I've created a combo box which I am able to fill it up. I'm want to call a function as soon as user selects some thing from the combo box. More precisely, I want to know how can i bind my function to this selection event. What this event is technically called?
0
876
by: dudeja.rajat | last post by:
Hi, I'm a newbie and created a new combo box with Tix. The combo box is filled with the required items. I've used Tkinter's listbox and used the <ListboxSelectevent and bind that with a callback. Now, I want to do the same stuff with the Tix combo box. Please suggest how can I do the same in Tix combo box.
0
9721
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
9600
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
10113
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
9195
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...
1
7651
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5547
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
4331
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
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.