473,465 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

listbox.selecteditem to populate datagridview

1 New Member
Sorry for newbie question, but here goes.

ex.
on form1 there is listbox1 and datagridview1

I have tables for dbo.category and dbo.issues.

in listbox1, is the listing from dbo.category.

what I want to do, is this:
click on an item in listbox1, say that is "APPLE"

I want that click event to take the selecteditem,query the dbo.issues and find every record with the category of "APPLE", and populate the datagridview1 with all of those records.

Back in the old days working with Access, it seemed a lot more simple.

Any suggestions on which route I take to accomplish the above task?

Thanks in advance.
Apr 4 '16 #1
1 1219
Luk3r
300 Contributor
You could just add a query to the ListBox1_SelectedIndexChanged to do a SELECT against dbo.issues. Inside of your SELECT statement, after WHERE, just include the ListBox1 selected item name as a variable for your query.
Apr 4 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jax | last post by:
I have a listbox. When the user selects an item i want to to take the text of the item and manipulate it. It wasn't working when autopostback was false, now it's true the event runs but i get an...
1
by: Jax | last post by:
I do this kind of thing all the time in applications but with ASP.NET i have problems with selecting an item in a list box and reading that selected text out when something like a button is...
7
by: Ohad Asor | last post by:
Hello all, I have an ASP.NET page I've written using VS.NET2003, which have a ListBox in it. When I press a button in the form, I try to get the selected item in the list by calling...
3
by: Mark Lauser | last post by:
I have a Windows app (.net v1.1) and I am dragging from a list box. The first drag works fine, but all subsequent drags continue to pull the first item that was dragged. It appears that...
0
by: BenCoo | last post by:
Hello everyone, I'm programming in VB.NET 2005 and I habe not much experience with database programming. I'm in search for some sql for the following : I have 3 database tables:...
2
by: =?Utf-8?B?TmFjaA==?= | last post by:
I am new to .net can someone teranslate the foloowing in .net Ls and Lt will be listboxes. Sub ListCpSelected(Ls As Control, Lt As Control) 'Copies selected items from one list to another Dim I...
4
by: manch | last post by:
I need some help with this, just can't seem to get it straight. I need to write a loop that will add each item of a listbox to get a Sum of the numbers inside. I am using vb.net 2005
1
by: Shimna Thomas | last post by:
In the below code, I am trying to redirect to another page, depending on the value of the selected item in the listbox;but I am getting the error : "Cannot implicitly convert type'string ' to...
1
by: Grok | last post by:
Is this a feature of ListBox that when using a DataSource, the SelectedItem acts different? Added ListBox1 and ListBox2 to a form. ListBox1 is bound to a DataSource where DisplayedMember=name...
0
by: wyzbs | last post by:
I got a problem with ListBox.SelectedItem When I bound a listbox to a database, and try to convert listbox.selecteditem to string, it returns me "System.Data.DataRowView". And later I try to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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,...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.