Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged If cn.State = ConnectionState.Open Then cn.Close() End If Try cn.Open() cmd = New OleDbCommand("select * from notesheet where notesheetno='" & ListBox1.SelectedItem & "'", cn) dr = cmd.ExecuteReader If dr.HasRows Then While dr.Read Noteshet.lblfileno.Text = (dr.Item(1).ToString) Noteshet.lbluserid.Text = (dr.Item(4).ToString) Noteshet.NDATEDateTimePicker.Text = (dr.Item(2).ToString) Noteshet.RichTextBox1.Text = (dr.Item(3).ToString) Noteshet.NOTESHEETNOTextBox.Text = (dr.Item(0).ToString) Noteshet.ComboBox1.Text = (dr.Item(5).ToString) End While End If Noteshet.ComboBox1.Enabled = False Noteshet.cmdsubmit.Visible = True Noteshet.Button1.Visible = False Noteshet.Show() Catch ex As Exception cn.Close() End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)