Esempio n. 1
0
 public override bool Select(string SQL)
 {
     pErrorMsg  = "No error";
     pErrorCode = 0;
     try
     {
         SqlCeCommand command = new SqlCeCommand(SQL, DataBasePDA.Get());
         RecordSet    Set     = new RecordSet(command.ExecuteReader());
         Set.Next();
         string[] fields = Set.Fileds();
         Rows = new List <DataRows>();
         while (!Set.Eof)
         {
             DataRows row = new DataRows();
             foreach (string fieldname in fields)
             {
                 row.AddField(new DataField(fieldname, Set.FieldByName(fieldname)));
             }
             Rows.Add(row);
             Set.Next();
         }
     }
     catch (Exception ex)
     {
         pErrorMsg  = ex.Message;
         pErrorCode = 1;
         throw;
         //return false;
     }
     return(true);
 }
Esempio n. 2
0
 private static void Create()
 {
     if (_instance == null)
     {
         _instance = new DataBasePDA();
         _instance.ConnectToBase(ConnectionString);
     }
 }
Esempio n. 3
0
 public static void Disconnect()
 {
     if (_instance != null)
     {
         _instance.DisconnectFromBase();
         _instance = null;
     }
 }
Esempio n. 4
0
 public static void Disconnect()
 {
     if (_instance != null)
     {
         _instance.DisconnectFromBase();
         _instance = null;
     }
 }
Esempio n. 5
0
 private static void Create()
 {
     if (_instance == null)
     {
         _instance = new DataBasePDA();
         _instance.ConnectToBase(ConnectionString);
     }
 }
Esempio n. 6
0
        public override bool Execute(string SQL)
        {
            bool         Res     = true;
            SqlCeCommand command = new SqlCeCommand(SQL, DataBasePDA.Get());

            try
            {
                command.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                Res        = false;
                pErrorMsg  = ex.Message;
                pErrorCode = -1;
            }
            return(Res);
        }