private bool LoadData() { bool res; try { AccountForm.CheckPointsTable(cn, null); AccountForm.OrderPoints(cn, null); // TODO: This line of code loads data into the 'dsClimbing.Points' table. You can move, or remove it, as needed. this.pointsTableAdapter.Fill(this.dsClimbing.Points); SqlCommand cmd = new SqlCommand("SELECT pts FROM Points WHERE pos = 0", cn); object oTmp = cmd.ExecuteScalar(); if (oTmp == null || oTmp == DBNull.Value) { tbLastPoints.Text = "0"; } else { tbLastPoints.Text = Convert.ToDouble(oTmp).ToString(); } res = true; } catch (Exception ex) { MessageBox.Show("Ошибка загрузки данных:\r\n" + ex.Message); res = false; } return(res); }