title: Using TableAdapter to insert rows into a dataset does not do anything
body: <p>I have a question similar to <a href="https://stackoverflow.com/questions/4550437/insert-method-of-tableadapter-not-working">this one</a>, but reading the (accepted) answer didn't give me much insight, so I'm hoping to state it more clearly and get a clearer response back.</p>
  
  <p>I'm attempting to insert a data row into a table. I'm using <code>TableAdapter</code>'s custom "insert nonQuery" that I wrote (it works, I tested) to accept some parameters. I'm fairly new to this business of communication with a database via .NET and what I'm doing is probably wrong by design. My questions are <em>why is it wrong</em> and <em>what's the right way to do it</em>? Both are equally important, IMO.</p>
  
  <p>Here's some sample VB code I wrote:</p>
  
  <pre><code>Dim arraysTableAdapter As New UnitTestsDataSetTableAdapters.ArraysTableAdapter
  
  Try
      arraysTableAdapter.InsertArray("Test Array", 2, 1, 2, "Test user")
  Catch ex As SqlException
      MsgBox("Error occured when trying to add new array." _
            &amp; vbNewLine &amp; vbNewLine _
            &amp; ex.Message)
  End Try
  </code></pre>
  
  <p>...and that's pretty much it. There is no exception raised, my table does not get a new row inserted. Everything is just the way it was before I called the <code>InsertArray</code> method. When I test my query in the QueryBuilder with the same parameters, a new row gets added to the database.</p>
  
  <p>Now, I do understand some of the reasons this would not work. I understand that I need to create and select a row in my <code>DataSet</code> (no idea how to do it) in order to tell the <code>TableAdapter</code> what it's adding the data to. Or at least I got that impression from reading the vast abyss of forums.</p>
  
  <p>I would really like to use <code>TableAdapter</code> at some point, because it knows that <code>.InsertArray</code> exists and it knows which parameters it likes. I could try and do it using</p>
  
  <pre><code>    Dim con As New SqlConnection
      Dim cmd As New SqlCommand
  
      con.ConnectionString = connString
      con.Open()
  
      cmd.CommandText = "INSERT ...... all that jazz"
  </code></pre>
  
  <p>but it's not nearly clean enough for how clean I like my code to be. So, is there any way to do what I'm trying to do the way I'm doing it? In other words, how do I use the neat structure of a <code>TableAdapter</code> to communicate to my <code>DataSet</code> and put a new row in it?</p>
  
  <p>Thanks in advance!</p>