reading sysschobjs does not return rows
Opened this issue · 0 comments
I am trying to read the sysschobjs table using rawdatabase. Using the sample code from http://improve.dk/orcamdf-rawdatabase-a-swiss-army-knife-for-mdf-files.
**var db = new RawDataFile(@"c:\temp\temp.mdf");
var records = db.Pages
.Where(x => x.Header.ObjectID == 34 && x.Header.Type == PageType.Data)
.SelectMany(x => x.Records);
var rows = records.Select(x => RawColumnParser.Parse((RawPrimaryRecord)x, new IRawType[] {
RawType.Int("id"),
RawType.NVarchar("name")
}));
rows.Select(x => x["name"]).Dump();**
I had to use RawDataFile because RawDataBase was not in the code I downloaded from github.
All I get from the Dump command is this:
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[OrcaMDF.RawCore.Records.RawRecord,System.Object]
I added this code to see how many records and rows were returned:
row_count = rows.Count();
record_count = records.Count();
Console.WriteLine($"Rows count = {row_count}");
Console.WriteLine($"Records count = {record_count}");
and it shows this:
Rows count = 4327
Records count = 4327