Actually in ACCESS it is a very simple thing to do. But I am coding now in .NET, so as you know there the things are different.
Actually in ACCESS it is a very simple thing to do. But I am coding now in .NET, so as you know there the things are different.
I think I probably was not clear enough. I want to have in the combo box 4 columns: Name, Last name, Born date, and the ID of the person. But normally combo boxes only allow you 2 columns, one for the value to show and other for the value to store. I want to find the way to show all the 4 columns and selecting the one that I do need.
Hello there: This is my issue. I do have one combo box in a form from which I want to select a person, by selecting the ID. In the combo box I want to show sorted name, last name, and date of birth. I wonder this should not be so difficult, but I have no idea about how to do so. Could please anybody out there give me a hand!?
Thanks
Luisofo
Hello there: I have used this code in my application and it works. It is about populating the database with the information within a present form
Dim a As String = Me.ComboBox1.SelectedItem
Dim b As Integer = Me.txtDeel1.Text
Dim c As Integer = Me.txtDeel2.Text
Try
selectStr = "SELECT TbStukIDRegCD,TbStukIDDeel1,TbStukIDDeel2,TbStukCodeAanbieder," + _
"TbStukTijdInschrijving, TbStukCodeRectificatie, TbStukDatumVerlijden,TbStukAardStuk,TbStukDatumDoorhalingStuk," + _
"TbStukIndGeheelVerwerkt,TbStukReferentie,TbStukBedrag,TbStukCodeMeten,TbStukStukTekst FROM TbStuk"
da = New SqlDataAdapter(selectStr, conn)
da.Fill(Ds1, "TbStuk")
Dim TbStukRow As DataRow = Ds1.Tables("TbStuk").NewRow
''TbStukRow("TbStukDatumID") = Me.tdpdatum.Text
TbStukRow("TbStukIDRegCD") = Me.ComboBox1.SelectedItem
TbStukRow("TbStukIDDeel1") = Me.txtDeel1.Text
TbStukRow("TbStukIDDeel2") = Me.txtDeel2.Text
TbStukRow("TbStukCodeAanbieder") = Me.TextBox7.Text
TbStukRow("TbStukTijdInschrijving") = Me.TextBox6.Text
TbStukRow("TbStukCodeRectificatie") = Me.TextBox5.Text
TbStukRow("TbStukDatumVerlijden") = Me.DateTimePicker1.Text
TbStukRow("TbStukAardStuk") = Me.TextBox3.Text
TbStukRow("TbStukDatumDoorhalingStuk") = Me.DateTimePicker2.Text
TbStukRow("TbStukIndGeheelVerwerkt") = Me.TextBox1.Text
TbStukRow("TbStukReferentie") = Me.TextBox11.Text
TbStukRow("TbStukBedrag") = Me.TextBox10.Text
TbStukRow("TbStukCodeMeten") = Me.TextBox9.Text
TbStukRow("TbStukStukTekst") = Me.TextBox2.Text
Ds1.Tables("TbStuk").Rows.Add(TbStukRow)
Dim cmd As New SqlCommandBuilder(da)
da.Update(Ds1, "TbStuk")
'conn.Close()
Catch
Finally
MessageBox.Show("successfully inserted into database", "success info", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
I do hope this can help you.