Question

if I do this...

rowNames = _myDB.RowSet.Where(r => (r.RowId >= minId) && (r.RowId <= maxId))
                                                      .Select(r => r.RowName);

it returns an IQueryable, how can I put this into: string[] myStringArray?

Was it helpful?

Solution

Try this:

_myDB.RowSet
    .Where(r => (r.RowId >= minId) && (r.RowId <= maxId))
    .Select(r => r.RowName)
    .ToArray();

This leverages the Enumerable.ToArray extension method.

OTHER TIPS

.ToArray()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top