Beispiel #1
0
        public override bool Select(string SQL)
        {
            OracleCommand    command = new OracleCommand(SQL, DataBaseOracle.Get());
            OracleDataReader reader;

            try
            {
                reader = command.ExecuteReader();
            }
            catch (Exception)
            {
                return(false);
            }
            DataRows row;

            Rows = new List <DataRows>();
            while (reader.Read())
            {
                row = new DataRows();
                for (int i = 0; i < reader.FieldCount; i++)
                {
                    row.AddField(new DataField(reader.GetName(i), Convert.ToString(reader.GetValue(i))));
                }
                Rows.Add(row);
            }
            DataBaseOracle.Disconnect();
            return(true);
        }
Beispiel #2
0
 public static void Disconnect()
 {
     if (_instance != null)
     {
         _instance.DisconnectFromBase();
         _instance = null;
     }
 }
Beispiel #3
0
 private static void Create()
 {
     if (_instance == null)
     {
         _instance = new DataBaseOracle();
         _instance.ConnectToBase(ConnectionString);
     }
 }
Beispiel #4
0
 private static void Create()
 {
     if (_instance == null)
     {
         _instance = new DataBaseOracle();
         _instance.ConnectToBase(ConnectionString);
     }
 }
Beispiel #5
0
 public static void Disconnect()
 {
     if (_instance != null)
     {
         _instance.DisconnectFromBase();
         _instance = null;
     }
 }
Beispiel #6
0
        public override bool Execute(string SQL)
        {
            OracleCommand command = new OracleCommand(SQL, DataBaseOracle.Get());

            try
            {
                command.ExecuteNonQuery();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }