Linq return data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SnVhbiBQdWVibGE=?=

    #1

    Linq return data

    Hi,

    I'm trying to use Linq in a webservice that returns a data from a query. As
    the data return from Linq to Sql is IEnumerable<Tan d it's not possible to
    easily get a Dataset, Which is the best format to return data?



    Thanks
  • ronscottlangham@yahoo.com

    #2
    Re: Linq return data

    On Aug 28, 4:20 pm, Juan Puebla <JuanPue...@dis cussions.micros oft.com>
    wrote:
    Hi,
    >
    I'm trying to use Linq in a webservice that returns a data from a query. As
    the data return from Linq to Sql is IEnumerable<Tan d it's not possible to
    easily get a Dataset, Which is the best format to return data?
    >
    Thanks
    Assuming T is a value that can be serialized and returned from the web
    service, I would recommend that you return T[]. Use Generics List to
    turn the value into a list and then return the values as an array.

    T[] GetValues()
    {
    return new List<T>( .. IEnumerable<T). ToArray();
    }

    Ron

    Comment

    Working...