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.

181 questions
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
  • 450,073
  • 74
  • 686
  • 939
5
votes
2 answers

how to create a pivot table with dynamic column using linq tree expression

I'm writing an asp.net C# web application; i have an in-memory datatable named 'table1' having three columns 'country', 'productId' and 'productQuantity'; i want to pivot that table in order to obtain a new table (suppose 'table2') having the first…
user598956
  • 51
  • 1
  • 3
5
votes
2 answers

Like operator in Linq to DataTable?

I am using Linq to DataTable. How I can apply like operator in where clause. I want to do a search on data just as we have like operator in SQL. I searched and tried the following code but got an error: Method 'Boolean Like(System.String,…
haansi
  • 5,470
  • 21
  • 63
  • 91
5
votes
1 answer

Left Outer Join - LINQ to Datatable

I'm trying to apply a left outer join using LINQ on two data tables. I'm receiving the exception listed below when I try to debug and view data contained in result variable: System.ArgumentException: Value cannot be null. Parameter name:…
Ashish Charan
  • 2,347
  • 4
  • 21
  • 33
4
votes
2 answers

Get duplicates for two columns with LINQ

LINQ drives me crazy. Why does following query not return the duplicates, whereas it works with only one identifier? Where is my error? ' generate some test-data ' Dim source As New DataTable source.Columns.Add(New DataColumn("RowNumber",…
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
4
votes
1 answer

How to join with LinQ to (typed) dataset?

i recently upgraded VS 2005 to 2010 and am fairly new to LinQ. Maybe somebody can put me in the right way. Background: I have a typed dataset and have the standard SQLMembershipProvider extended with a Table AccessRule. So a role can have…
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
4
votes
1 answer

Lambda Expression for Unpivoting DataTable

I am reading data from an Excel sheet in the following format: I need to store the data in the following way: I am trying to do it with the help of Linq lambda expression but I think I'm not getting anywhere with this. DataTable dataTable=…
Aritra B
  • 1,726
  • 6
  • 29
  • 45
4
votes
2 answers

Why doesn't EnumerableRowCollection.Select() compile like this?

This works: from x in table.AsEnumerable() where x.Field("something") == "value" select x.Field("decimalfield"); but, this does not: from x in table.AsEnumerable() .Where(y=>y.Field("something") ==…
David Fox
  • 10,603
  • 9
  • 50
  • 80
4
votes
3 answers

Is LINQ to Dataset subset of LINQ to EF or these two are independent?

Is LINQ to Dataset subset of LINQ to EF or these two are independent?
masoud ramezani
  • 22,228
  • 29
  • 98
  • 151
4
votes
2 answers

Pass type as parameter to LINQ Field method

Below we have a list for a mock database call and a little program that takes that list and converts it do a DataTable. In this example I'm using a variable for the column name to access that column's values and get the average. However, I made a…
wootscootinboogie
  • 8,461
  • 33
  • 112
  • 197
4
votes
1 answer

Can I use a query designer to write Linq Queries against a DataSet

I've got a DataSet created by the xsd.exe tool to import some xml files, and need to denormalize the data within for display purposes. Instead of writing linq to dataset queries by hand is there any way I can access the tables within a query…
3
votes
2 answers

Warning: "Using the iteration variable in a lambda expression may have unexpected results"

Edit: Here is a much more simpler example of this issue (i've deleted my original question): Dim numbers1 As New List(Of Int32)({1, 2, 3}) Dim numbers2 As New List(Of Int32)({3, 4, 5}) For Each n1 In numbers1 ' no warning ' Dim contains =…
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
3
votes
1 answer

Convert Multiple tables to Dataset

My question seems quite simple but became tedious for me. In my project, i have a DBML file which is acting as a Data Access Layer. There one more utility method that is converting the existing result into dataset. Below is my method: #region To…
user240141
3
votes
3 answers

Group inside group linq

I have a datatable like this: I want to group this table For FIELD A and FIELD B, and the third field of my group should be lists of FIELD C, but it must be grouped by ID field. At the end, the result should be like this: First Field | Second Field…
Curious
  • 474
  • 1
  • 8
  • 25
3
votes
1 answer

Are DataSet primary key columns indexed?

I'm writing a quick utility app with out of the box win forms and data sets. private void timer1_Tick(object sender, EventArgs e) { if(_maxTimestamp == null) return; var newRows =…
Aaron Anodide
  • 16,906
  • 15
  • 62
  • 121
1
2
3
12 13