title: How to save database after SQL query ADO.NET?
body: <p>I have the connection to database</p>
  
  <pre><code>public SqlConnection CreateConnection()
  {
      var con = new SqlConnection(s_connection);
      con.Open();
      return con;
  }
  </code></pre>
  
  <p>I have an <code>INSERT</code> query after this connection:</p>
  
  <pre><code>SqlCommand myCommand = CreateConnection().CreateCommand();
  myCommand.CommandText = "INSERT INTO Departments(Name, Phone) VALUES (@Name, @Phone);";
  myCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 20);
  myCommand.Parameters["@Name"].Value = d.Name;
  myCommand.Parameters.Add("@Phone", SqlDbType.NVarChar, 20);
  myCommand.Parameters["@Phone"].Value = d.Phone;
  myCommand.ExecuteNonQuery();
  </code></pre>
  
  <p>I want to get a date from database using <code>SELECT</code> query, but I don't get any new data that has been added after the query. If I reset the program I see all the data (the <code>INSERT</code> query works!) How I can fix this problem?</p>