14,752 questions
Tooling
1 vote
1 replies
51 views
Linq2Sql Migration Experience
Is there anyone reading this that has experience of netcore-System.Data.Linq? We are about to embark on a very large code-base migration from Framework 4.8 to .NET8. We have relied on Linq2Sql for all ...
0 votes
1 answer
64 views
Why is my LINQ-to-SQL Tools tool not showing up in Visual Studio 7.14?
I installed LINQ-to-SQL in version 7.9, then noticed it didn't show up when I tried to use it. After doing some research, someone said to update visual studio to the latest, so I did that. I confirmed ...
0 votes
0 answers
48 views
Linq-To-SQL: Retrieve details for an item in query results
In a project that uses Linq2Sql I have the following tables: +-------------+ +-------------+ | Orders | | OrdItems | +-------------+ +-------------+ +------------...
2 votes
1 answer
98 views
get dates exactly 2x years before given date
Currently I fetch all customers that have registered exactly 2 years before a given date. var observationPeriod = DateTime.Today; var observedDate = observationPeriod.AddYears(-2); var customers = ...
0 votes
0 answers
109 views
Linq-to-SQL DBML autogenerates unedited stored procedure in the DBML's designer.cs
Whenever I update my DBML (to include a new view/table), after the DBML auto-generates to included the new table/view, an untouched/unedited stored procedure is altered in the designer.cs file. The ...
1 vote
1 answer
180 views
HierarchyID: Get all descendants for a list of parents using LINQ-to-SQL
I need to find all descendants for a given list of parents. The query (in plain SQL) was easy enough, but I can't translate it into LINQ-to-SQL. SQL Query: select child.id from ...
0 votes
1 answer
170 views
Linq-to-SQL moving to EF Core, there is already an open DataReader associated with this command
UPDATE: This code is used in a server side data export process, so no UI that necessitates paging/chunking and I simply need to 'plow' through (up to) 100's of thousands of rows of data. I'm migrating ...
0 votes
0 answers
85 views
LINQ "SubmitChanges" is very slow
I was trying to insert more than 20,000 records data in database using LINQ. Almost everything is fine until the line of SubmitChanges. It slows down my application. I tried commenting the ...
1 vote
0 answers
74 views
How to solve Linq to SQL: Cast not valid error on designer page
Is anyone aware of the reason why publishing a WPF application with ClickOnce would result in a "Specified cast is not valid." error? When attempting to open the design window for Linq to ...
1 vote
0 answers
87 views
How to update object with Linq-To-SQL but with System.Data.Linq.DataContext
I have the following straightforward case where a client communicates with .NET Web API: Client makes a request for an object to the Web API giving the requested ID. Web API returns the object to the ...
1 vote
0 answers
44 views
Linq to SQL - SQL join statement with specific return [duplicate]
I have the following table entity with my sql-database : using System.Data.Linq.Mapping; [Table(Name = "Users")] class Users { [Column(Name="UserKey", IsPrimaryKey=true)] ...
0 votes
2 answers
102 views
DataContext always ReadOnly, even though a primary key exists
I'm attempting to update a value in my Database, but the IsReadOnly property is always coming back as True. According to Microsoft, that property Gets a value that indicates whether the type of the ...
0 votes
1 answer
371 views
Issue on Mapping inherited class in .Net 4.8 with LINQ to SQL
I am using .Net 4.8 Framework and System.Data.Linq package. I am trying to Map data from database to object (Child). ChildClass inherits ParentClass, so in my thought it should be able to use ...
-2 votes
1 answer
348 views
# System.NullReferenceException: 'Object reference not set to an instance of an object.' [duplicate]
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System....
0 votes
0 answers
53 views
ExecuteCommand in data linq query
I use ExecuteCommand in data context in linq to pass update command like this _context.ExecuteCommand("update tb_ExpList set exp_name = '" & TextBox8.Text & "',exp_desc = '"...