linq-to-dataset

Specifying return rows in LINQ2DataSet

I have a requirement to extract a distinct subset of rows from a DataTable, and thought LINQ2DataSets may be a useful and clean way to do this, however it appears that it is not possible to simply identify return rows from a LINQ2DS query as follows var result = from r in fips.AsEnumerable() select r.Field<string>("FACILITY_PROCESS_SUB_...

How can I use Linq with Dataset.xsd files?

How can I use Linq with Dataset.xsd files? I've looked at Linq-to-Datasets and Linq-to-XSD but they don't really seem to work directly with the Visual Studio DataSet.xsd files. EDIT: I actually found a great link for this: link text but I can't seem to figure out what to do if I want to query on related tables. Dim taFields As N...

LINQ to DATASET update with a stored procedure

I have used LINQ to SQL with a update stored procedure to update databases in the past. I wanted to know if there is anything similar in LINQ to Dataset An example of the LINQ to SQL Update: Dim lqUpdate = lqUpdate.sprocUpdate(ColumnName, NewValue, ID) ...

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 DataSet Now the product that I am to work on, cannot rely on the type of database. For ex...

LINQ to DataSets for MySQL Interop

I'm building an application that must support MSSQL and MySQL databases. To avoid duplication of stored procedures etc., I'm considering using the Data Access Application Block to retrieve broadly scoped, very general datasets from either database, and then use DB agnostic LINQ code for more specific data access. My other option is to ...

LINQ to Dataset - Handle NULL in WHERE clause

I have 2 tables as the primary data; **Table - Agent** aid name ------------- 1 a 2 b 3 c 4 d 5 e **Table - Event** eid event ------------- 1 aaaa 2 bbbb 5 NULL SELECT * FROM Agent a LEFT JOIN Event e ON a.aid = e.eid aid name eid event ----------------------------- 1 a 1 aaaa 2 b 2 bbbb 3 c NULL NULL 4 d NUL...

join between two tables with linq to datasets

i want to create a join between two tables and that the result will include all the two tables columns. i want to do this without specifying the specific column names, just do select all, because i won't know how many columns will the two tables include and won't know their names. I JUST WANT TO CREATE JOIN BETWEEN TWO TABLES AND THAT T...

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 NorthWindDataSet.Products Where (product.UnitsOnOrder > CInt(txtUnitsOnOrde...

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 tell me the best way to set the precision so that it retains two decimal places? I have tr...

select column from dataset using LINQ

Hi, I am absolutely new to linq query, please help with this query, dataset has fields: Name Value Client_owner. I want to select Value if name == "searchtext" DataTable results = (from d in ((DataSet)_MyDataset).Tables["Records"].AsEnumerable() orderby d.Field<string>("Name") ascending ...

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? Write my own DataRowComparer? I don't want - because the default must works. ...

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 expose the DataSet to ADO.NET Data Services: namespace NewTechnologyDemo { public class ...

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 builder wizard? ...

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 files and display it in a DataGridView. Is there a way to merge the data from multiple file...

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 value from a single table, but when I tried to change my query to follow it I was unable to do...

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 have a bank rec page that compares thousands of financial transactions between our accou...

LINQ to Dataset - UPDATE'ing a datatable.

Hi, I know one can use LINQ to query a datatable, & then populate/load a 2nd datatable with the results of said query, but... Can you use LINQ to update a datatable in-memory (i.e. without creating a 2nd datatable..?) ...

LINQ to DataSet Dataclass assignment question

Hi all, I'm working on a Silverlight project trying to access a database using LINQ To DataSet and then sending data over to Silverlight via .ASMX web service. I've defined my DataSet using the Server Explorer tool (dragging and dropping all the different tables that I'm interested in). The DataSet is able to access the server and dat...

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<string>("field1") == "value1" || myrecord.Field<string>("field1") == "value2" select myrecord; foreach(var myrecord in query) { //if value1, then "X" //sum += field2 } But, I want to know if i...

How can I sum a field from a grandchild table in a LINQ to DataSet where clause?

I think I need to do exactly this, but instead using LINQ to DataSets because the "Transactions" table is in DB2 and there is no data context. http://stackoverflow.com/questions/1813285/linq-query-across-three-levels-of-tables-to-generate-sum I setup two DataRelations on the DataSet: 1. relate Categories (ds.tables[0] in my example) to...