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
2
votes
1 answer

Query a Datagridview.Rows or Dataset using Linq

I have some problem. Since I'm not so experienced with Linq I couldn't figure out how to query my datagridview (or directly to dataset preferably) and show results on another datagridview. This is where I fill my full datagridview and…
Mustafa
  • 825
  • 3
  • 14
  • 37
2
votes
1 answer

Where can I get information on the ! operator used by VB.Net in Linq to DataSet?

The Sample Queries application uses a ! operator to reference a field in the DataRow. Option Strict Off Imports System.Data Imports System.Linq Module Program Public Sub Main() Dim numbers() As Integer = {5, 4, 1, 3, 9, 8, 6, 7, 2,…
JJS
  • 6,431
  • 1
  • 54
  • 70
2
votes
2 answers

LINQ query for getting row with max date in grouped table

I have following datatable structure ID Date Vendor Grade 1 20-nov-2013 xyz A 2 26-Apr-2013 abc B 1 21-nov-2013 pqr D 1 10-nov-2013 abc C 2 15-dec-2013 pqr A 2 …
Rajeev Kumar
  • 4,901
  • 8
  • 48
  • 83
2
votes
3 answers

Load result of Linq-to-DataSet query with join into datatable

I have a Linq to dataset query that joins two tables and extracts the desired parameters from each. I need to get them into a DataTable to bind to a DataGridView. The example I found for doing this on MSDN is a trivial example taking a single…
2
votes
0 answers

LINQ-To-DataSet Anonymous types - Double converted to integer - why?

Below is my simplified class. I have 2 methods that are getting some data from dataset through LINQ. Then I have GetTotalSales() method that unions and sums all data. Before final union statement I am checking data in For Each r In O1 Dim t…
2
votes
4 answers

Fill Datatable from linq query

i am using the below code IEnumerable query = from c in at.appointmentcalendars.AsEnumerable() select c; DataTable dt = query.CopyToDataTable(); But i am getting the below error Cannot implicitly convert …
Shantanu Sen
  • 221
  • 3
  • 4
  • 18
2
votes
1 answer

convert generic list to datatable using linq..?

List objEmpList = new List(); for (int i = 0; i < 5; i++) { objEmpList.Add(new Employee(){ID=i, Name="aa" + i}); } I want to create table with generic list items as rows using linq or lambda…
siva
  • 61
  • 1
  • 3
  • 10
2
votes
1 answer

Chaining databound LINQ queries in LINQ to DataSet

I am trying to perform a query on a query result, but I am getting an error: “The method or operation is not implemented”. Can I chain queries in this way? For example, I have a Northwind typed DataSet. I do: queryResult = From product In…
Dan
  • 11,077
  • 20
  • 84
  • 119
2
votes
5 answers

Simplify my C# Linq statement?

class : class Foo { public int Id { get; set; } public string Name { get; set; } } List List lst = new List(); Datatable : DataTable dt = GetFromDb ().... I want to fill lst with records from dt. I've managed doing :…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
2
votes
1 answer

linq as dataset issue with column names

How can I avoid using magic strings in a LINQ query against a datatable? This works: public IEnumerable getDisplayNames() { IEnumerable nameQry = from row in displayTable.AsEnumerable() select row.Field("display"); return…
user1345223
1
vote
3 answers

query dataset using LINQ

Possible Duplicate: Not displaying data in gridview when applying filter to a dataset I am having a Dataset ds with contents of table emp with ename , pass , status as attributes . I want to query the Dataset uing LINQ such that it returns…
Vinod
  • 4,672
  • 4
  • 19
  • 26
1
vote
2 answers

Using var anonymous object getting InvalidCastException for LINQ

I am getting error while trying to loop through query object using var variable in foreach construct. I am loading xml in to dataset and performing Dataset to Linq for explicit reasons. Please correct my mistake. This is my…
user1061293
  • 167
  • 1
  • 4
  • 14
1
vote
2 answers

Case sensitive LINQ to DataSet

I am having an issue with a strongly typed DataSet exhibiting case-sensitivity using LINQ to DataSet to retrieve and filter data. In my example project, I have created a strongly typed DataSet called DataSet1. It contains a single DataTable called…
1
vote
2 answers

c# LINQ to dataset IN clause contains, group, min

I am new to LINQ but am trying to tackle a tough one right off the bat. I am trying to do LINQ to dataset and emulate the following query... SELECT smID, MIN(entID) FROM table WHERE exID = :exID AND smID IN (1,2,3,4,5,6,7,8, etc) GROUP BY smID…
John
  • 47
  • 1
  • 7
1
vote
2 answers

LINQ query with SELECT and two GROUP-BY condition

What's the equivalent LINQ instruction for a Datatable of the following SQL query: SELECT code_direction, count(TP) AS CN FROM table1 WHERE cod_time = 'A011' GROUP BY TP,code_direction; and how to get the result into a new datatable? I tried to…
Alessandro
  • 55
  • 1
  • 7