Click here to Skip to main content
15,901,122 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: registry for dummies Pin
John Kuhn5-Feb-04 6:57
John Kuhn5-Feb-04 6:57 
GeneralRe: registry for dummies Pin
Dave Kreskowiak5-Feb-04 8:27
mveDave Kreskowiak5-Feb-04 8:27 
GeneralRe: registry for dummies Pin
LokmanHakim5-Feb-04 12:00
LokmanHakim5-Feb-04 12:00 
Generalerror BC30652: Reference required to assembly Pin
Jonathan de Halleux4-Feb-04 6:47
Jonathan de Halleux4-Feb-04 6:47 
GeneralRe: error BC30652: Reference required to assembly Pin
Dave Kreskowiak4-Feb-04 8:35
mveDave Kreskowiak4-Feb-04 8:35 
QuestionHow to change ethernet transfer settings Pin
Ranson4-Feb-04 5:32
Ranson4-Feb-04 5:32 
GeneralCombobox and Database Pin
gls2ro4-Feb-04 2:14
gls2ro4-Feb-04 2:14 
GeneralRe: Combobox and Database Pin
Pugman8124-Feb-04 13:49
Pugman8124-Feb-04 13:49 
Create two data adapters. One with just the displayed and key field or unique field selected. And another with all the fields selected and in the key field or unique field under criteria put a "=?" no quotes. Then create datasets for both. Then you need to create Functions either in a component module or just in your forms code. They could look something like this. This is from a component
***************************************************************************
Public Function getdataset(ByVal strValue As String) As DataSet
'fill the dataset

DsGuests1.Clear()
daGuests.SelectCommand.Parameters("Phone").Value = strValue
NOTE:The "Phone" parameter will just be your unique field
daGuests.Fill(DsGuests1)
Return DsGuests1
End Function
Public Function GetNames() As DataView
'fill the dataset

daNames.Fill(DsNames1)
Return dvNames
End Function
***************************************************************************
Then you are going to have to set up the combo box to get the displayed names by calling your dataset and putting it into a dataview object with just the displayed field as the Display Member and the Unique key field as data member when the form loads. Could look something like this.
***************************************************************************
Dim dvnames As DataView
dvnames = mobjguests.GetNames

With Combobox1
.DataSource = dvnames
.DisplayMember = "FullName"
.ValueMember = "Phone"
.SelectedIndex = -1
End With

NOTE: mobjguests was the name of my component it would be just a procedure of
getnames if you were using the form and would just be

dvnames = GetNames
***************************************************************************
After the names are filled in the list and you then need to set up a Combobox indexChanged event. This will call the dataset with all of the fields in it and will send the data member part of your combobox to the function. After this you are going to have to bind each of you data fields to a textbox or whatever you choice and all of this will looks something like this.
***************************************************************************
Private Sub cboNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboNames.SelectedIndexChanged
Dim dsguests As DataSet
Static fieldsbound As Boolean = False

NOTE:The static fieldsbound is so that the below code only executes one time because the fields only need to be bound one time. Other wise will throw and error. The only code that you want to execute everytime is the getdataset function. When the dataset changes all of the bound fields will change.
dsguests = mobjguests.getdataset(cboNames.SelectedValue.ToString())
If Not fieldsbound Then
binddata(dsguests)
NOTE:You are sending the dataset with parameter meet to be bound and this dataset only contains the data for that record.
fieldsbound = True
End If
End Sub


Private Sub binddata(ByVal dsguests As DataSet)
'binds the fields

txtRoom.DataBindings.Add("text", dsguests.Table("Guest"), "Room")

The Guests will be your Table that your are accessing and the room will be the field that you are binding. Just do the same for each of your fields.
End Sub

I hope this helps if you need any more help with this you can contact me on a way to get a programming example at Pugman812@aol.com
QuestionHow to sort the listview on the basis of the clicked column Pin
Tasnim4-Feb-04 1:22
Tasnim4-Feb-04 1:22 
AnswerRe: How to sort the listview on the basis of the clicked column Pin
Vi24-Feb-04 4:26
Vi24-Feb-04 4:26 
GeneralBut I want it in Vb.net Pin
Tasnim4-Feb-04 23:19
Tasnim4-Feb-04 23:19 
GeneralRe: But I want it in Vb.net Pin
Dave Kreskowiak5-Feb-04 9:32
mveDave Kreskowiak5-Feb-04 9:32 
GeneralCouldnt find it!!! Pin
Tasnim5-Feb-04 23:20
Tasnim5-Feb-04 23:20 
GeneralRe: Couldnt find it!!! Pin
Dave Kreskowiak6-Feb-04 3:24
mveDave Kreskowiak6-Feb-04 3:24 
GeneralThx Pin
Tasnim6-Feb-04 19:20
Tasnim6-Feb-04 19:20 
GeneralBut ... Pin
Tasnim8-Feb-04 21:16
Tasnim8-Feb-04 21:16 
GeneralHelp Help Help Me in Combo,,Anyone Pin
Het21093-Feb-04 23:41
Het21093-Feb-04 23:41 
GeneralRe: Help Help Help Me in Combo,,Anyone Pin
John Kuhn4-Feb-04 8:05
John Kuhn4-Feb-04 8:05 
GeneralI am working in VB.Net Pin
Het21095-Feb-04 1:34
Het21095-Feb-04 1:34 
GeneralRe: Help Help Help Me in Combo,,Anyone Pin
John Kuhn5-Feb-04 7:19
John Kuhn5-Feb-04 7:19 
GeneralRuntime error Pin
GSekar3-Feb-04 20:12
GSekar3-Feb-04 20:12 
GeneralRe: Runtime error Pin
Matthew Hazlett3-Feb-04 20:40
Matthew Hazlett3-Feb-04 20:40 
GeneralRe: Runtime error Pin
Matthew Hazlett3-Feb-04 20:47
Matthew Hazlett3-Feb-04 20:47 
GeneralRe: Runtime error Pin
GSekar4-Feb-04 0:06
GSekar4-Feb-04 0:06 
GeneralSimple Problem With ListBoxes Pin
Pugman8123-Feb-04 18:04
Pugman8123-Feb-04 18:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.