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
specified cast is not valid on linq
I am importing excel file to a DataGridView and I have to get the average of some column. It all works fine when I try it on a sample excel file which is about 300 rows. But when I try it with the actual excel file with 41000 rows, I get the error…

helix
- 1
- 2
0
votes
1 answer
Multiple left joins and combining equals and not equals in Linq
I'm trying to join two DataTables so that the first table is LEFT-joined to the second table twice on the CustID column. The first plant table must match the PlantID from the animal table and the second plant table in the join must NOT match the…

kristianp
- 5,496
- 37
- 56
0
votes
2 answers
Greater than in Joins in Lambda Expression
Query
var res4 = from u in dtEmp.AsEnumerable()
from v in dtDept.AsEnumerable()
let DOJ = u.Field("DOJ")
where u.Field("DepartmentID") ==…

Pearl
- 8,373
- 8
- 40
- 59
0
votes
1 answer
Getting minimum - Min() - for DateTime column in a DataTable using LINQ to DataSets?
I need to get the minimum DateTime value of a column in a DataTable. The DataTable is generated dynamically from a CSV file, therefore I don't know the name of that column until runtime. Here is code I've got that doesn't work...
private DateTime…

Jay Stevens
- 5,863
- 9
- 44
- 67
0
votes
0 answers
Object not filled when making a Left Join
When making a left join the MO object is not filled, I have a composite key where the second datatable these keys may not exist, could someone help me please?
var query = (from GrupoInicial in dtGroupInicial.AsEnumerable()
…

Eduardo Isidoro
- 1
- 1
0
votes
2 answers
LINQ to DataSet DataTable Group By - Syntax
I have a Dataset that contains e.g. id, date, other fields...
I want to retrieve unique rows based on ids and latest date.
I have this query but I can't figure out where to put the date condition.
DataTable dt = ds.Tables[0]
…

Benk
- 1,284
- 6
- 33
- 64
0
votes
2 answers
grouping data from two dataset
i've got a problem with dataset:
I've got two dataset from two different server but they have the same columns.
so it's like that:
First DataSet :
asset description make jobtype jan feb ... dec
0001 mine ik Acc 0 0 10
0002 …

Garcia Julien
- 756
- 2
- 7
- 20
0
votes
1 answer
Remove rows in database by Dataset with relationship in SQLite
i have simple database and dataset, which looks like:
file:
myDb
klasa = class room
nauczyciel = teacher
klasa data:
teacher data:
now i want to remove teacher, which has ID equals 2:
it's whole code:
DataSet2 db = new DataSet2();
…

Marek Woźniak
- 1,766
- 16
- 34
0
votes
3 answers
Sum up every x values in a row
I have a column calendar week and a column amount. Now I want to sum up the amount for every 4 calendar weeks starting from the first calendar week in April. E.g. if I have 52 (rows) calendar weeks in my initial table I would have 13 (rows) weeks in…

ruedi
- 5,365
- 15
- 52
- 88
0
votes
1 answer
Slow Update/insert into SQL Server CE using LinqToDatasets
I have a mobile app that is using LinqToDatasets to update/insert into a SQL Server CE 3.5 File.
My Code looks like this:
// All the MyClass Updates
MyTableAdapter myTableAdapter = new MyTableAdapter();
foreach (MyClassToInsert myClass in…

Vaccano
- 78,325
- 149
- 468
- 850
0
votes
1 answer
LINQ To DataSet from SQL
I am having trouble converting a SQL Join statement into LINQ to DataSet. Also, consider that there will be other tables in the LINQ statement that the Header table will be joined to. Below is my Join statement - any help is appreciated.
FROM…

Mike
- 235
- 2
- 8
- 25
0
votes
3 answers
How can I use a condition based on the queried data in an anonymous class in LINQ to DataSet?
I can do this by looping the result of a simplified query:
var query = from myrecord in dt.AsEnumerable()
where myrecord.Field("field1") == "value1" || myrecord.Field("field1") == "value2"
select myrecord;
foreach(var…

David Fox
- 10,603
- 9
- 50
- 80
0
votes
1 answer
Aggregate datatable with dynamic number of columns
I have a datatable with dynamic set of columns and want to aggregate the numeric based columns and keep the final rows into new datatable.
DataTable Sample:-
PartnerName CreditCol DebitCol AmountCol ....
P1 10 20 30
P2…

Karan
- 3,265
- 9
- 54
- 82
0
votes
1 answer
Left outer join to perform DataTable Comparison using Linq
Well I am trying to compare two DataTables using LINQ statements
The structure of my tables is something like this
EmpId -- FirstName -- LastName -- DOB
with Emp being the unique key (integer ofcourse) and DOB is Date, rest are strings.
There are…

Navyseal
- 891
- 1
- 13
- 36
0
votes
1 answer
Get Specified row index of a column from a data table having values contained in a string
I have a data table having the two columns Select and Value.
Select Value
0 213
0 314
0 282
I have an integer array called Ids={213,314}
If the values of Ids occur in the data table column "values" then update the "select"
column…

Intruder
- 147
- 1
- 12