コード例 #1
0
 public static void Attend(ParticipationClass At)
 {
     Conn.Open();
     string query = String.Format("Insert into [dbo].[Participations](User_Id,Training_Id) values({0},{1})", At.GetUserId(), At.GetTrainingId());
     command = new SqlCommand(query, Conn);
     command.ExecuteNonQuery();
     Conn.Close();
 }
コード例 #2
0
 public static void LeaveTraining(ParticipationClass Pc)
 {
     Conn.Open();
     string query = String.Format("Delete from [dbo].[Participations] where User_Id={0} and Training_Id={1}",Pc.GetUserId(),Pc.GetTrainingId());
     command = new SqlCommand(query, Conn);
     command.ExecuteNonQuery();
     Conn.Close();
 }