johnkosten
New member
- Joined
- Aug 28, 2005
- Messages
- 2
- Programming Experience
- 1-3
Hello,
I'm having trouble in displaying the information based on the combobox selection. Here is my code so far
Private Sub cmbBoxIncidentDate_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbBoxIncidentDate.SelectedIndexChanged
Dim dateValue As String
dateValue = cmbBoxIncidentDate.SelectedValue
Me.txtBoxIncidentType.Text = dateValue
'*------------------------------------------------------------------------------------------------------
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Kasturi\My Documents\Visual Studio Projects\WindowsApplication1\db\test.mdb"
Dim Cmd As OleDbCommand
Dim Reader As OleDbDataReader
Dim SQL As String
Dim Con = New OleDbConnection(connString)
SQL = "SELECT * FROM [Incident] WHERE [Incident_Date] = " & dateValue & ""
Cmd = New OleDbCommand(SQL, Con)
Con.Open()
Con.Close()
End Sub
How do i reference the information needed to display in combo boxes? These are the fields in my database :- Incident_ID, Incident_Date, Incident_Name. Thanks in advance.
I'm having trouble in displaying the information based on the combobox selection. Here is my code so far
Private Sub cmbBoxIncidentDate_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbBoxIncidentDate.SelectedIndexChanged
Dim dateValue As String
dateValue = cmbBoxIncidentDate.SelectedValue
Me.txtBoxIncidentType.Text = dateValue
'*------------------------------------------------------------------------------------------------------
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Kasturi\My Documents\Visual Studio Projects\WindowsApplication1\db\test.mdb"
Dim Cmd As OleDbCommand
Dim Reader As OleDbDataReader
Dim SQL As String
Dim Con = New OleDbConnection(connString)
SQL = "SELECT * FROM [Incident] WHERE [Incident_Date] = " & dateValue & ""
Cmd = New OleDbCommand(SQL, Con)
Con.Open()
Con.Close()
End Sub
How do i reference the information needed to display in combo boxes? These are the fields in my database :- Incident_ID, Incident_Date, Incident_Name. Thanks in advance.