Home All Groups Group Topic Archive Search About

VB2005Express: providing values from table for dropdown combo?

Author
9 May 2006 6:02 AM
planetthoughtful
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,

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

Author
9 May 2006 9:05 AM
Cor Ligthert [MVP]
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

<planetthought***@gmail.com> schreef in bericht
Show quoteHide quote
news:1147154579.185189.72850@v46g2000cwv.googlegroups.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,
>
> planetthoughtful
> ---
> "Lost in thought"
> http://www.planetthoughtful.org
>