Esempio n. 1
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);
         }
     }
 }
Esempio n. 2
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);
         }
     }
 }