473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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<Tand it's not possible to
easily get a Dataset, Which is the best format to return data?

Thanks
Aug 28 '07 #1
1 3039
On Aug 28, 4:20 pm, Juan Puebla <JuanPue...@discussions.microsoft.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<Tand 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

Aug 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: =?Utf-8?B?Tmljaw==?= | last post by:
Hello, I'm using LINQ to access a SQL Server database. The user needs to be able to duplicate a record. Is there an easy way to do this? I rather not have to set each property from one to the...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
2
by: timor.super | last post by:
Hi group, In my database, I have a table with fields like this : id | title | xml ------------------------------------ 1 | title1 | <datas><data><item...
6
by: Plissskin | last post by:
I need to create an "ad-hoc" filtering page in a web app we are building. The page would display a number of drop down lists, text boxes, and radio lists and allow the user to select (enter) some...
0
by: =?Utf-8?B?SHlwZXJjb2Rlcg==?= | last post by:
I'm encountering some strange behavior after deploying a ASP.net 3.5 website to production, i'm unable to reproduce these in my dev environment. This error seems to occur very randomly but it's...
21
by: hrishy | last post by:
Hi Will LINQ be ported to Python ? regards Hrishy
1
by: psycho | last post by:
How do we return a single value from a stored procedure. Suppose I have a stored procedure like this: create proc dbo.spInsertGroup @ID uniqueidentifier @GroupName varchar(100), @IsActive...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.