title: Populating multiple textboxes with data at once
body: <p>I have a form containing 6 groupboxes, each groupbox containing 180 textboxes, along with two combobxes. On selecting a value from the first combobox, the second combobox gets filled with required data from a table. My requirement is that upon selecting a value from the second combobox, filtered data from the same table should fill the remaining textboxes. The code I am using is as follows:</p>
  
  <pre><code>    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
      Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=c:\\users\\brisingr\\documents\\123\database.mdb"
      Dim objConnection As New OleDbConnection(strConnection)
  
      Dim strsql As String
      'strsql = "Select * from '" &amp; ComboBox1.Text &amp; "' where Style = '" &amp; ComboBox2.Text &amp; " '"
      Dim a As String
      Dim b As String
      Dim c As String
      Dim d As String
      a = "Select * from ["
      b = ComboBox1.Text
      c = "] where Style = ["
      d = ComboBox2.Text
      strsql = a &amp; b &amp; c &amp; d &amp; "]"
      Dim objCommand As New OleDbCommand(strsql, objConnection)
  
      Dim objDataAdapter As New OleDbDataAdapter(objCommand)
      Dim objDataTable As New DataTable("Buyers")
      objDataAdapter.Fill(objDataTable)
  
      objConnection.Close()
      objConnection.Dispose()
      objConnection = Nothing
      objCommand.Dispose()
      objCommand = Nothing
      objDataAdapter.Dispose()
      objDataAdapter = Nothing
  
      For i As Integer = 1 To 60
          Me.Controls("L1Ob" &amp; i).Text = objDataTable.Rows(0)("Operation" &amp; i)
      Next
  
  End Sub
  </code></pre>
  
  <p>Here "Operation" &amp; (i) refers to the field name of the database, which have been named like operation1, operation2 and so on... </p>
  
  <p>This code does not seem to be working for me. Please help..</p>