private void MainForm_Load(object sender, EventArgs e) { /* string connstring = "Server=192.168.100.78;Username=postgres;Password=postgres;Database=SERENITY_PRODUCTION"; * //string connstring = "Server=localhost;Username=postgres;Password=postgres;Database=SGEEDE"; * // Making connection with Npgsql provider * NpgsqlConnection conn = new NpgsqlConnection(connstring); * conn.Open(); * string sql = "select name_related from hr_employee order by id desc;"; * // data adapter making request from our connection * NpgsqlDataAdapter da = new NpgsqlDataAdapter(sql, conn); * // i always reset DataSet before i do something with it.... i don't know why :-) * ds.Reset(); * // filling DataSet with result from NpgsqlDataAdapter * da.Fill(ds); * // since it C# DataSet can handle multiple tables, we will select first * dt = ds.Tables[0]; * // connect grid to DataTable * //dataGridView1.DataSource = dt; * // since we only showing the result we don't need connection anymore * conn.Close(); * * foreach (DataRow row in dt.Rows) * { * listBox1.Items.Add(row["name_related"].ToString()); * * }*/ EnrollButton.PerformClick(); }
void ReleaseDesignerOutlets() { if (AuthButton != null) { AuthButton.Dispose(); AuthButton = null; } if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (CheckEnrollmentButton != null) { CheckEnrollmentButton.Dispose(); CheckEnrollmentButton = null; } if (DeleteEnrollmentButton != null) { DeleteEnrollmentButton.Dispose(); DeleteEnrollmentButton = null; } if (EnrollButton != null) { EnrollButton.Dispose(); EnrollButton = null; } if (IdentityTextField != null) { IdentityTextField.Dispose(); IdentityTextField = null; } if (VersionLabel != null) { VersionLabel.Dispose(); VersionLabel = null; } }