473,569 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB2005Express: providing values from table for dropdown combo?

Hi All,

I'm very new to VB.Net, and I've recently downloaded VB 2005 Express.
I've managed to connect a dataset to my installation of SQLExpress2005
and I have a form on which I have fields that display data from my
table as I scroll through the recordset.

I want to have a dropdown combobox on that form that stores the value
selected in the dataset of the other fields on the form, but which
displays the dropdown values from a different SELECT statement.

So, something like "SELECT DISTINCT projname FROM tblProjects ORDER BY
projname ASC".

I've been scanning through the help for hints but can't find anything
that shows me how to use a second recordset on a form.

Can anyone give me any pointers?

Much warmth,

planetthoughtfu l
---
"Lost in thought"
http://www.planetthoughtful.org

May 10 '06 #1
1 948
Hi,

May I assume that you have instead of a recordset a Dataset or a DataTable
and probably code to get that one?

With a recordset you have first to use the conversion to a datatable to let
it work well. (There is an overloaded method from the dataadapter for that).

Cor

<pl************ **@gmail.com> schreef in bericht
news:11******** *************@v 46g2000cwv.goog legroups.com...
Hi All,

I'm very new to VB.Net, and I've recently downloaded VB 2005 Express.
I've managed to connect a dataset to my installation of SQLExpress2005
and I have a form on which I have fields that display data from my
table as I scroll through the recordset.

I want to have a dropdown combobox on that form that stores the value
selected in the dataset of the other fields on the form, but which
displays the dropdown values from a different SELECT statement.

So, something like "SELECT DISTINCT projname FROM tblProjects ORDER BY
projname ASC".

I've been scanning through the help for hints but can't find anything
that shows me how to use a second recordset on a form.

Can anyone give me any pointers?

Much warmth,

planetthoughtfu l
---
"Lost in thought"
http://www.planetthoughtful.org

May 10 '06 #2

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

Similar topics

2
1553
by: Dan Cook | last post by:
Ok... here's the scoop... I've got an unbound form with Serial Number, Building, and Room... all this is in tableA... Now I've got the form setup with building, room and serial number as combo fields... I've got it so that when you click the dropdown on Building it queries the table for all buildings, then the one for room queries for all...
2
1762
by: givlerj | last post by:
I need some help. Here is a little background, I support a MS Access 2k DB (SQL Server 2k backend) that has courses and students. The problem form lets the user pick a course from a drop down and opens a report of the students attending the course in the dropdown. A user can't view on 1 course in the dropdown list. He can view other courses...
7
23522
by: NCrum | last post by:
I want to set the Default value of a Combobox for any changeable record and have got this working but it is totaly unsatisfactory see the code below I loop through the items in the Combo looking for a match between cVal and the selectedValue then stop when I do have a match the obvious problem is that each iteration fires the...
6
4430
by: Sebi | last post by:
Hello all, I'm thinking about overwriting the ListItem, so it can contain x additional values (not only one). Has anybody ever tried this? Has someone got an example (C#)? Can DropDownList handle overwritten Items, or will additional Data be lost? Thanks for any advice.
3
2110
by: Brian Graham | last post by:
I have a combo box with a query for a list of names etc. The table has 250,000 rows. The query returns 250,000 rows. But the list returns only 97,000 rows and then shows blank columns after that, so it appears to be returning 250,000 rows but most of them incomplete. So, I have names from A to D but nothing after that. The table was initially...
2
7521
by: dancole42 | last post by:
So I have a subform that lists the various items on a particular invoice. First, the user selects a product class from the Class dropdown. This is bound to the Class field in the InvioceLines table. The rowsource for the combobox is: ClassName, ClassID, ClassSort from the Class table, with the bound column set to ClassID.
2
7032
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small database I wrote for home, the combo boxes and listboxes no longer display the bound column. For example, on a form I have a combo box based on a...
2
1761
by: ARC | last post by:
I'm testing a user's db that contains a very large number of records. I have an invoice screen, with an invoice select dropdown box that shows all invoices, and the customer's name, etc. With 80,000+ invoices in this particular db, clicking the dropdown is painfully slow accross a network only (I'm testing on a wireless, so it's even slower...
4
2468
by: Karl | last post by:
Using A2000 with 2 tables Table 1 is a reference table with 2 fields Table 2 has 2 fields and 2 combo boxes to lookup date in table 1 Combo1 binds to col 1 in table 1, this works OK Combo 2 is set to bind to col 2 in table 1 but it always binds col 1 Column Count is set to 2 and I can see both columns in the dropdown Bound Column is...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
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...
0
6286
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...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
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...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
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
0
944
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...

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.