/* Заполняет ТекстБоксы на форме редактирования * Комбобокс с выбором ID и Текстбоксы*/ internal void SelectDataForEdit(ITableAdapter TableAdapter, string id, TextBox[] textBoxes) { try { sqlConnection.Open(); sqlCommand = TableAdapter.Select(sqlConnection); sqlCommand.Parameters.Add(new SqlParameter("@param1", id)); sqlDataReader = sqlCommand.ExecuteReader(); sqlDataReader.GetValues(textBoxes); } catch (Exception) { ErrorMessage(); throw; } finally { sqlDataReader.Close(); sqlConnection.Close(); } }