LINQ to DataSet is a component of Language Integrated Query (LINQ) that provides SQL-style query capabilities against ADO.NET DataSet objects from .NET languages.
Questions tagged [linq-to-dataset]
181 questions
0
votes
1 answer
DataRow need to be casted before linq operations . Why?
DataRowCollection : InternalDataCollectionBase
InternalDataCollectionBase : ICollection, IEnumerable
So , DataRowCollection indirectly inherites IEnumerable.
Generally , If a class inherites IEnumerable we can apply linq operations .
But in …

Dhinesh
- 45
- 5
0
votes
2 answers
how to perform sum on distinct different then the group field
bellow is the C# code.
the problem is the calculated SumCustomerDebt.
i need to group according to the CustomerLocation, but the CustomerDebt repeat multiple times in the table (for each customer). i need to calculate SumCustomerDebt - as sum of…

user2455595
- 67
- 1
- 2
- 9
0
votes
2 answers
C# Linq-SQL query result returning nothing
I'm fairly new to LINQ (and SQL at that). When trying to query my SQL Database in C# "Supervisors" (which contains only one column "Names" made of nvarchar(50) variables, none of which are Null), supvName ends up being an empty list. If I don't cast…

PRX
- 137
- 10
0
votes
1 answer
Combine Data from multiple DataSets
I'm loading data from multiple xml files with different schemas into DataSets. I do have foreign key style relationships between the tables in each xml file but to date they're only enforced by code. I need to access data coming from multiple…

Dan Is Fiddling By Firelight
- 5,981
- 17
- 77
- 128
0
votes
1 answer
use linq to query a cell from datatable
I want to write a function "getCount" to return a result of int for different usernames from a datatable, as follows:
static void Main(string[] args)
{
DataTable table = new DataTable();
table.Columns.Add("username", typeof(string));
…

Eric Cheung
- 297
- 3
- 6
- 10
0
votes
1 answer
Can I use ADO.NET Data Services with a LINQ-to-DataSet data source?
We have an existing application that relies heavily on stored procedures and untyped DataSets. I'd like to maintain that flexibility, but leverage the REST capabilities of ADO.NET Data Services. However, when I attempt to use the following code to…

GuyBehindtheGuy
- 1,368
- 2
- 17
- 36
0
votes
2 answers
DataTable.AsEnumerable().Distinct() doesn't work because of primary key column
I want to remove duplicates from my DataTable so I'm using DataTable.AsEnumerable().Distinct(DataRowComparer.Default) but it doesn't do what I need. I think because each duplicate row has it's unique primary key column.
How can I do what I need?…

abatishchev
- 98,240
- 88
- 296
- 433
0
votes
1 answer
Passing a Null date value in LINQ
Private m_ExpirationDate As Nullable(Of DateTime)
Public Property ExpirationDate() As Nullable(Of DateTime)
Get
Return m_ExpirationDate
End Get
Set(ByVal value As Nullable(Of DateTime))
m_ExpirationDate = value
…

Tom S
- 227
- 1
- 6
- 19
0
votes
1 answer
Precision problem with LINQ to dataset in VB.Net -- Double invalid cast exception
I am having some trouble with a LINQ to dataset query. I have the problem that data is returned to the dataset as a double and could be null. When I get the data into my LINQ query it truncates to one decimal place. I am wondering if anyone can…

Brian
- 3
- 2
0
votes
2 answers
Linq for sum of distinct addresses
I have a DataTable of Products. Each product has a weight and a return address.
The return address is comprised of 7 fields.
I need to cycle through the distinct addresses and sum up the total weight of product.
Example table would look like…

Stuart
- 1,544
- 5
- 29
- 45
0
votes
4 answers
Linq query "specific cast is not valid"
Following Linq to datatable query gives me error Specific cast is not valid.
decimal[] temp = dt.AsEnumerable()
.Select(r => new
{
totLen = r.Field("Quantity")
* (r.Field("Breath")
…

Sagar Upadhyay
- 819
- 2
- 11
- 31
0
votes
0 answers
Split Datatable with large column into Child Datatables columnwise with one column fixed
I have large datatable with atleast 50 columns.
first column contains the description of row data
i.e In 1st column, row data is the header for the rows so
i want to keep the 1st column
Large Datatable must be split into child datatable after…

kevin159
- 69
- 2
- 11
0
votes
1 answer
Linq To DataSet getting error
In my WinForm project, I try to access to the table in DataSet with help of LINQ.
DSObjectData lDataSetObject; // DSObjectData -Strongly typed DataSet
var q = from contour in lDataSetObject.Contour
select contour;
But…

Michael
- 13,950
- 57
- 145
- 288
0
votes
2 answers
Linq Query to find min and max in a datatable
I am fetching the attendance details of employees in a datatable .
It looks like this
Day SwipeTime
12/31/2012 11AM
12/31/2012 1PM
12/31/2012 7PM
12/31/2012 8PM
1/1/2012 2PM
1/1/2012 7PM
1/1/2012 8PM
1/2/2012 10AM
1/2/2012 …

sajad
- 923
- 2
- 10
- 25
0
votes
1 answer
how to copy one column data to another column with in the same table using linq?
any one please clarify, how to copy one column data to another column with in the same table using linq.
Thank you,
Siva Kumar goru.

Siva kumar Goru
- 13
- 1
- 1
- 8