Exemplo n.º 1
0
 public void Execute_Query(string com_str, int connId)
 {
     WorkerResult = new SqlWorkerQueryResult(com_str);
     WorkerResult.Start();
     try
     {
         com             = GetConnection(connId).CreateCommand();
         com.CommandText = com_str;
         int cnt = com.ExecuteNonQuery();
         WorkerResult.Success(cnt);
     }
     catch (Exception ex)
     {
         WorkerResult.Error(ex.Message);
     }
     WorkerResult.End();
 }
Exemplo n.º 2
0
 public DataTable Execute_DataTable(string com_str, int connId)
 {
     WorkerResult = new SqlWorkerQueryResult(com_str);
     WorkerResult.Start();
     try
     {
         da  = new SQLiteDataAdapter(com_str, GetConnection(connId));
         tbl = new DataTable();
         da.Fill(tbl);
         int cnt = tbl != null ? tbl.Rows.Count : 0;
         WorkerResult.Success(cnt);
     }
     catch (Exception ex)
     {
         WorkerResult.Error(ex.Message);
     }
     WorkerResult.End();
     return(tbl);
 }
Exemplo n.º 3
0
        public SQLiteDataReader Execute_DataReader(string com_str, int connId)
        {
            WorkerResult = new SqlWorkerQueryResult(com_str);
            WorkerResult.Start();
            try
            {
                com             = GetConnection(connId).CreateCommand();
                com.CommandText = com_str;
                dr = com.ExecuteReader();
                int cnt = 0;
                WorkerResult.Success(cnt);
            }
            catch (Exception ex)
            {
                WorkerResult.Error(ex.Message);
            }
            WorkerResult.End();

            return(dr);
        }
Exemplo n.º 4
0
 public void Execute_Query(string com_str, int connId, SQLiteParameter[] prm)
 {
     WorkerResult = new SqlWorkerQueryResult(com_str);
     WorkerResult.Start();
     try
     {
         com             = GetConnection(connId).CreateCommand();
         com.CommandText = com_str;
         for (int i = 0; i < prm.Length; i++)
         {
             com.Parameters.Add(prm[i]);
         }
         int cnt = com.ExecuteNonQuery();
         WorkerResult.Success(cnt);
     }
     catch (Exception ex)
     {
         WorkerResult.Error(ex.Message);
     }
     WorkerResult.End();
 }