Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,179 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,015 people online right now. Registration is fast and FREE... Join Now!




Using ComboBox to select records from database

 
Reply to this topicStart new topic

Using ComboBox to select records from database, Quick Question

longr59
2 Oct, 2007 - 12:20 PM
Post #1

New D.I.C Head
*

Joined: 20 Sep, 2007
Posts: 26


My Contributions
hey all

I have my form with a combo box that displays the names of staff members when you drop it down. I want to be able to select the name from the drop down and then click my button and have it return only the records in the DB that have that name in the assigned to field. I have added a data grid view control to the form and want to display the results in that. not really sure how to get it to do this. Any help would be greatly appreciated. I have included the little bit of code I have so far.




CODE


Public Class frmmain

    Private Sub NewRecordToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewRecordToolStripMenuItem.Click
        frmRecord.Show()
    End Sub

    Private Sub QuitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuitToolStripMenuItem.Click
        Environment.Exit(1)
    End Sub

    Private Sub frmmain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'TODO: This line of code loads data into the 'DS_BHIPTrack.DLA_STAFF' table. You can move, or remove it, as needed.
        Me.DLA_STAFF_TA.Fill(Me.DS_BHIPTrack.DLA_STAFF)

    End Sub


    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    End Sub
End Class

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Using ComboBox To Select Records From Database
2 Oct, 2007 - 04:55 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
This is a VB.Net question so I am moving it there.

By the way, what is DLA_STAFF_TA.Fill? Is it a physical object you drug from the ToolBox or is it something you created in code?
User is offlineProfile CardPM
+Quote Post

longr59
RE: Using ComboBox To Select Records From Database
3 Oct, 2007 - 04:17 AM
Post #3

New D.I.C Head
*

Joined: 20 Sep, 2007
Posts: 26


My Contributions
QUOTE(PsychoCoder @ 2 Oct, 2007 - 05:55 PM) *

This is a VB.Net question so I am moving it there.

By the way, what is DLA_STAFF_TA.Fill? Is it a physical object you drug from the ToolBox or is it something you created in code?



it is a physical object I drug from the toolbox
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Using ComboBox To Select Records From Database
3 Oct, 2007 - 04:31 AM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Is it a DataSet, a BindingSource, what kind of Data Object is it?
User is offlineProfile CardPM
+Quote Post

longr59
RE: Using ComboBox To Select Records From Database
3 Oct, 2007 - 05:16 AM
Post #5

New D.I.C Head
*

Joined: 20 Sep, 2007
Posts: 26


My Contributions
QUOTE(PsychoCoder @ 3 Oct, 2007 - 05:31 AM) *

Is it a DataSet, a BindingSource, what kind of Data Object is it?

the fill is from a table adapter

This post has been edited by longr59: 4 Oct, 2007 - 04:27 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 01:05AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month