title: Inserting Data in sql database vb.net is not getting stored
body: <p>I have a weird problem: I'm trying to do some basic procedure to insert data in a database and I don't know what it's happening, but it does not work.</p>
  
  <p>The thing is that I have a database called <code>prova3</code> that is a SQL Server 2012 database created with vb.net 2013 with a table called <code>tabela</code>. I created a dataset to see the connection string that is stored in <code>app.config</code>. The string is the same below. I'm not getting an error, but the data is not inserted. When I go to the Server explorer to see the data in the table, it's empty.</p>
  
  <p>I think the data it's been saved in elsewhere, but I don't know how to fix it, because I think I'm coding this right. This is for vb.net, but I did the same code for asp.net and it works. Weird.</p>
  
  <p>Could you help me?</p>
  
  <p>In the form it's only a textbox1 and a button1 controls. There is no more code.</p>
  
  <pre><code> Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Dim ImageUrlSt As String
      Dim command1 As New SqlCommand
      Dim con As New SqlConnection
      ImageUrlSt = TextBox1.Text
      Try
          con.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Prova3.mdf;Integrated Security=True"
          con.Open()
          command1.Connection = con
          command1.CommandText = "INSERT INTO Tabela (imageurl) VALUES (@imageurlst)"
          command1.Parameters.Add(New SqlParameter("@imageurlst", ImageUrlSt))
          command1.ExecuteNonQuery()
          MsgBox("News Saved Succesfully")
      Catch ex As Exception
          MsgBox(ex.Message)
      Finally
          con.Close()
      End Try
  End Sub
  </code></pre>