title: How can I have 2 gridviews in one form with same dataset, but other population?
body: <p>Here you see my code of a form with 2 gridviews. Both have the same dataset, bindingsource. The dataset which is made out of a datasource, has 2 different sql queries.
  filld() and fillauswahl() filld shows in the gridview a "select distinct" query.
  When the user hits the button1, the selected item from that gridview is saved in "verzeichnis1"  this var gets pasted to fillauswahl() which is
   <code>select* from mytable where columnx = verzeichnis1 </code></p>
  
  <p>The problem I have is that both gridviews get filled during formload with filld() and by clicking the button with fillverzeichnis() i dont know how to seperate that!? i guess it´s very easy. Cheers and thanks</p>
  
  <p><code> Public Class Importverzeichnis</p>
  
  <pre><code>Public verzeichnis1 As String
  
  
  Private Sub Importverzeichnis_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  
      Try
          Me.SKM2TableAdapter.Filld(Me.SLXADRIUMDEVDataSet.SKM2)
  
      Catch ex As System.Exception
          System.Windows.Forms.MessageBox.Show(ex.Message)
      End Try
  End Sub
  
  
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  
      For Each cell As DataGridViewCell In DataGridView1.SelectedCells
  
          verzeichnis1 = cell.Value
  
  
      Next
  
      Me.SKM2TableAdapter.Fillauswahl(Me.SLXADRIUMDEVDataSet.SKM2, verzeichnis1)
  
  
  End Sub
  End Class 
  </code></pre>
  
  <p></code></p>
  
  <p>Edit: I created a new connection a new datset and new dataadapter and now it works:</p>
  
  <pre><code>    Dim connectionString As String = My.Settings.SLXADRIUMDEVConnectionString
      Dim sql As String = "SELECT * FROM SKM2 where 
      Benutzerdefiniert_10 ='" &amp; verzeichnis1 &amp; "' "
      Dim connection As New SqlConnection(connectionString)
  
  
      Dim dataadapter As New SqlDataAdapter(sql, connection)
  
      Dim ds As New DataSet()
  
      connection.Open()
      dataadapter.Fill(ds, "verzeichnis")
      connection.Close()
  
  
      datagridview2.DataSource = ds
      datagridview2.DataMember = "verzeichnis"
  </code></pre>
  
  <p>but I would be more happy if can use my first dataset and my first adapter. If anyobdy knows how I can do this, I would be happy for the answer</p>