Example #1
0
        public void UpdatePlanItemData(PlanDataItem data)
        {
            try
            {
                OpenConnection();
                SqlCeCommand cmd = new SqlCeCommand(@"UPDATE [PlanData] 
                   SET [PlanID] = @PlanID
                      ,[PlanDataName] = @PlanDataName
                      ,[PlanSql] = @PlanSql
                      ,[FailMode] = @FailMode
                      ,[Index] = @Index
                 WHERE [PlanDataID]=@PlanDataID;", con);
                cmd.Parameters.AddWithValue("PlanDataID", data.PlanDataID);
                cmd.Parameters.AddWithValue("PlanID", data.PlanID);
                cmd.Parameters.AddWithValue("PlanDataName", data.PlanDataName);
                cmd.Parameters.AddWithValue("PlanSql", data.PlanSql);
                cmd.Parameters.AddWithValue("FailMode", (int)data.FailMode);
                cmd.Parameters.AddWithValue("Index", data.Index);

                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                //Suppress All Exceptions
            }
            finally
            {
                CloseConnection();
            }
        }
Example #2
0
 public void AddPlanItemData(PlanDataItem data)
 {
     try
     {
         OpenConnection();
         SqlCeCommand cmd = new SqlCeCommand(@"INSERT INTO [PlanData]
         ([PlanID],[PlanDataName],[PlanSql],[FailMode],[Index])
         VALUES(@PlanID,@PlanDataName,@PlanSql,@FailMode,@Index);", con);
         cmd.Parameters.AddWithValue("PlanID", data.PlanID);
         cmd.Parameters.AddWithValue("PlanDataName", data.PlanDataName);
         cmd.Parameters.AddWithValue("PlanSql", data.PlanSql);
         cmd.Parameters.AddWithValue("FailMode", (int)data.FailMode);
         cmd.Parameters.AddWithValue("Index", data.Index);
         cmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         //Suppress All Exceptions
     }
     finally
     {
         CloseConnection();
     }
 }