troubleshooting Question

Linq help

Avatar of Waterside
Waterside asked on
.NET ProgrammingVisual Basic.NET
3 Comments1 Solution45 ViewsLast Modified:
I'm trying to use this Linq which works well but fails if one of the tables is empty.  Any clues as to how to solve this ?

Dim tabs = dc.Mapping.GetTables().[Select](Function(o) New With { _
                           .TableName = o.TableName, .Type_ = o.RowType.Type, .IsEntity = o.RowType.IsEntity, _
                           .RowCount = dc.GetTable(o.RowType.Type).Cast(Of Object)().Count()}) _
                           .Where(Function(o) o.IsEntity).ToList()
ASKER CERTIFIED SOLUTION
Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros