forum

Home / DeveloperSection / Forums / Computing row count in linq?

Computing row count in linq?

Anonymous User 2209 17-Feb-2015

I am exploring a very messy SQL-Database via LINQPAD and I would like to get a list of all tables where at least one column is of type string. Furthermore, I would like to compute the count of distinct values for each column mentioned above.

I have tried to jumble something together, but my LINQ is rusty and anyway I have used it mainly for LINQ to Objects...

foreach(var table in Mapping.GetTables())
{
(
from dm in table.RowType.DataMembers
where dm.Type == typeof(string)
select new { dm.Name , dm.DbType , dm.Type , dm.MappedName, dm.IsPrimaryKey }
)
}


c# c#  linq 
Updated on 17-Feb-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By