SqlConnection con = new SqlConnection("Data Source=DESKTOP-JV7URL6;Initial Catalog=COCAhenkroApp;Integrated Security=True"); private void btnSave_Click(object sender, EventArgs e) { con.Open(); SqlCommand command = new SqlCommand("insert into EdificationMembers values('" + txtName.Text + "','" + cmbPosition.Text + "','" + txtContact.Text + "',getdate())", con); command.ExecuteNonQuery(); MessageBox.Show("Successfully Saved"); con.Close(); BindData(); } void BindData() { SqlCommand command = new SqlCommand("select * from EdificationMembers", con); SqlDataAdapter sda = new SqlDataAdapter(command); DataTable dt = new DataTable(); sda.Fill(dt); EdificationMembersdataGridView.DataSource = dt; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)