private void btn_evaluate_Click(object sender, EventArgs e) { try { SqlConnection con = new SqlConnection(conStr); con.Open(); if (con.State == ConnectionState.Open) { String q = "INSERT INTO [ProjectA].[dbo].[GroupProject](ProjectId,GroupId,AssignmentDate)VALUES(('" + Convert.ToInt32(com_prolid.Text) + "'),(select Id from [Group] where [Group].Id = '" + com_gro_id.Text + "'),('" + Convert.ToDateTime(dtp_assign_date.Value) + "'));"; SqlCommand cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); MessageBox.Show("Data Inserted Successfully"); } AllProjectGroups std = new AllProjectGroups(); this.Hide(); std.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public EditProjectGroup(AllProjectGroups all, long id) { InitializeComponent(); this.aadv = all; this.advnum = id; }