title: Changes not being saved to local database VB.net
body: <p>I have a problem in my VB.net (VS 2012) project : I'm working with local DB (<code>SQL Server</code>) but the problem is when I modify data in table (query <code>UPDATE</code>) in my local DB and after the I display data in DB (query <code>SELECT</code> ...) modification is well done BUT the problem is when I close my application and I re-run it and when I display data modifications are lost I find the old data (the first one loaded in DB) !!! I don't know what is the problem ? Help plz </p>
  
  <p>This is the update code :</p>
  
  <pre><code>If Not arraySize.ToString.Equals("0") Then
      If Not TextBoxSN.Text.Equals("") Then
          Try
              For i As Integer = arraySize - 1 To arraySize - 5 Step -1
                  sysconErrorString += sysconErrorArrayList(i).ErrorValue.ToString() + "|"
              Next
              sysconErrorString = sysconErrorString.Remove(sysconErrorString.Length - 1)
  
              MsgBox(sysconErrorString)
  
              Dim sqlStatmentSave As String = "  UPDATE device_data SET SysconError='" &amp; sysconErrorString &amp;
                      "' WHERE SN ='" &amp; TextBoxSN.Text &amp; "';"
              cmd = New SqlCommand(sqlStatmentSave, cn)
              If cn.State = ConnectionState.Closed Then cn.Open()
              cmd.ExecuteNonQuery()
          Catch ex As Exception
          End Try
      Else
          MsgBox("Set an SN please.")
      End If
  Else
      MsgBox("No error to save")
  End If
  </code></pre>