Exemplo n.º 1
0
        private PostgreDao GetDao()
        {
            int        cmdTimeout = Common.Config.CommandTimeout;
            PostgreDao dao        = new PostgreDao(Common.Config.DenshowDbConnection, cmdTimeout);

            dao.Connect();
            return(dao);
        }
Exemplo n.º 2
0
 public DataTable GetResultData(string tableName, string sql)
 {
     using (PostgreDao dao = GetDao())
     {
         using (NpgsqlCommand cmd = dao.CreateCommand())
         {
             cmd.CommandText = sql;
             DataTable dtt = dao.ExecuteResultSet(cmd, tableName, true);
             return(dtt);
         }
     }
 }
Exemplo n.º 3
0
 public NpgTableLayoutInfo GetTableLayout(string tableName)
 {
     using (PostgreDao dao = GetDao())
     {
         using (NpgsqlCommand cmd = dao.CreateCommand())
         {
             cmd.CommandText = Properties.Resources.GetNpgTableLayout;
             cmd.Parameters.AddWithValue("@schema", Common.Config.DenshowDbSchema);
             cmd.Parameters.AddWithValue("@tableName", tableName);
             DataTable          dtt       = dao.ExecuteResultSet(cmd, tableName, false);
             NpgTableLayoutInfo tableInfo = new NpgTableLayoutInfo(tableName, dtt);
             return(tableInfo);
         }
     }
 }