This question has already been answered:
Problem solved! Answer: When you start from the bin folder, the entered data is saved! So I make changes:
string connStr = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\LitMapPoltavaData.mdf;Integrated Security=True"; SqlConnection conn = new SqlConnection(connStr); try { //пробуем подключится conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Parameters.Clear(); cmd.Connection = conn; cmd.CommandText = "UPDATE Writers SET Id = @Id, Surname = @Surname, Name = @Name, Lived = @Lived, Birthplace = @Birthplace, ShortInfo = @ShortInfo WHERE Id = @Id"; //Добавить параметры ... //Выполнить int recordsAffected = cmd.ExecuteNonQuery(); if (recordsAffected == 0) { cmd.CommandText = "Insert Into Writers (Id, Surname, Name, Lived, Birthplace, ShortInfo)" + "Values(@Id, @Surname, @Name, @Lived, @Birthplace, @ShortInfo)"; cmd.ExecuteNonQuery(); } } finally { conn.Close(); conn.Dispose(); } The data in the database are entered and displayed after normal. It is necessary that after closing and opening a new application, the data in the database remains!