title: Why do I get the error saying "No value given for one or more required parameters." Vb.net
body: <pre><code>Dim SqlQueryActivity As String = "SELECT * FROM tblActivities WHERE Activity ='" &amp; ActivityCombo.Text &amp; "'AND Sub-Activity = '" &amp; SubActivityCombo.Text &amp; "'"
      Dim DataAdapterActivities As OleDbDataAdapter = New OleDbDataAdapter(SqlQueryActivity, conn)
      Dim DataSetActivities As DataSet = New DataSet
      DataAdapterActivities.Fill(DataSetActivities, "ActivitiesData")
      Dim DataTableActivities As DataTable = DataSetActivities.Tables("ActivitiesData")
  </code></pre>
  
  <p>When running the code, I get the mentioned error, pointing to the 4th line where the DataAdapterActivities is filled. I have checked to see that what is in the comboboxes matches records in the database. This sql statement is running before an insert statement to retrieve the appropriate details. I'm trying to understand whether I need to define activitiesdata somewhere seperately, or is it what's being filled. I have opened the connection just before.</p>