Questions tagged [linq-to-dataset]

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.

178 questions
100
votes
3 answers

Why is LINQ JOIN so much faster than linking with WHERE?

I've recently upgraded to VS 2010 and am playing around with LINQ to Dataset. I have a strong typed dataset for Authorization that is in HttpCache of an ASP.NET WebApplication. So i wanted to know what actually is the fastest way to check if a user…
Tim Schmelter
  • 411,418
  • 61
  • 614
  • 859
44
votes
6 answers

DataTable does not contain definition for AsEnumerable

Using linq to query a datatable returns the following error: CS0117: 'DataSet1.map DataTable' does not contain a definition for 'AsEnumerable' Project includes reference for System.Data.Datasetextensions. Here's the code. using System; using…
user1169290
  • 457
  • 1
  • 4
  • 8
23
votes
3 answers

Select single column from dataset with LINQ

Just getting my head around all this LINQ stuff and it seems I'm stuck at the first hurdle. I have a datatable as such: OrderNo LetterGroup Filepath ----------- ----------- -------------------------------------------------- 0 0 …
m.edmondson
  • 28,523
  • 26
  • 113
  • 191
19
votes
3 answers

How I can filter a dataTable with Linq to datatable?

hi how i can filter a datatable with linq to datatable? I have a DropDownList and there I can select the value of the Modul Column. Now I want to filter the DataTable with this Modul Column. here is my datatable structure: User | Host | TimeDiff…
Tarasov
  • 3,282
  • 19
  • 59
  • 123
17
votes
6 answers

Select distinct rows from datatable in Linq

I am trying to get distinct rows based on multiple columns (attribute1_name, attribute2_name) and get datarows from datatable using Linq-to-Dataset. I want results like this attribute1_name attribute2_name -------------- --------------- Age…
James123
  • 9,918
  • 51
  • 172
  • 316
13
votes
2 answers

Linq query to sum by group

I have a data table like this: Category Description CurrentHours CTDHours LC1 Cat One 5 0 LC2 Cat Two 6 0 LC3 Cat Three …
John
  • 784
  • 1
  • 7
  • 19
10
votes
5 answers

LINQ to DataSet, distinct by multiple columns

Just wanted to check if there is way to do distinct by multiple columns. Thanks in advance!!! BTW, I found a great LINQ extension here but need some guidance to use it for multiple columns
Ganesha
  • 1,461
  • 3
  • 16
  • 21
10
votes
2 answers

Binding LINQ query to DataGridView

This is very confusing, I use AsDataView to bind query result to a dgv and it works fine with the following: var query = from c in myDatabaseDataSet.Diamond where c.p_Id == p_Id select c; dataGridView1.DataSource = query.AsDataView(); However, this…
DanSogaard
  • 686
  • 4
  • 13
  • 26
9
votes
6 answers

Linq to SQL or Linq to DataSet?

I am new to Linq world and currently exploring it. I am thinking about using it in my next project that involves database interaction. From whatever I have read, I think there are 2 different ways to interact with databases: Linq to SQL Linq to…
Hemant
  • 18,354
  • 22
  • 87
  • 123
8
votes
1 answer

Update/Insert to a table using SQLCeResultSet

I have a SQL Compact Edition Database that I update periodically (via web services). The part where I write to the database is taking way too long. I am currently doing it with Linq to Datasets (as seen in this question). I have heard that if I do…
Vaccano
  • 70,257
  • 127
  • 405
  • 747
6
votes
3 answers

How to use Field with Type?

I have a method that determines the min and max of a column in a DataTable: public void GetMinMaxRange( DataTable data, string valueColumnName ) { var min = data.AsEnumerable().Min(m => m.Field(valueColumnName)); var max =…
O.O
  • 10,083
  • 18
  • 83
  • 166
6
votes
3 answers

Store an image in a SQL Server CE database

Does any one know of an example on how to store an image in a SQL Server CE database? What data type should the column be? (I am guessing binary.) I use Linq-To-Datasets. Is it possible using that to put the image into the database and pull it out…
Vaccano
  • 70,257
  • 127
  • 405
  • 747
6
votes
2 answers

Is it worth using PLINQ with ASP.NET?

Does anyone have experience using PLINQ with ASP.NET? Is this a good combination, or something to avoid in most situations? I develop an intranet ASP.NET site for a lawfirm (~100 users). Several pages include non-trivial LINQ code, for example, we…
Brad
  • 1,215
  • 3
  • 15
  • 24
6
votes
2 answers

Join in LINQ that avoids explicitly naming properties in "new {}"?

I would like to do something like this: DataTable q = from c in customers join o in orders on c.Key equals o.Key into outer from j in outer.DefaultIfEmpty() select new { c.*, j.* }; The closest I…
Alex
  • 1,172
  • 13
  • 28
5
votes
2 answers

LINQ-Join tables on nullable columns

how to JOIN tables on nullable columns? I have following LINQ-query, RMA.fiCharge can be NULL: Dim query = From charge In Services.dsERP.ERP_Charge _ Join rma In Services.dsRMA.RMA _ On charge.idCharge…
Tim Schmelter
  • 411,418
  • 61
  • 614
  • 859
1
2 3
11 12