I tried to connect my project to a database, using LINQ to SQL, following a few online guides. I created a simple database Library
, added new LINQ to SQL Classes
item in the project, named SimpleLibraryDatabase
, connected to the server and dragged the required tables. So far no problems, but when i tried to build the solution, it failed. Source of the problem appears to be in the auto-generated file SimpleLibraryDatabase.designer.cs
, where it gives me over 70 errors, most of them saying:
The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
What is also weird for me, in this generated context class, there is no constructor, that takes 0 arguments, unlike in all the tutorials I've watched.
This is my first time playing with databases in C#.
CodePudding user response:
LINQ to SQL is a component of .NET Framework version 3.5, It's just available on .NET Framework 3.5 ~ 4.8 and not accessible to classes in the .Net core.
LINQ to SQL is a component of .NET Framework version 3.5 that provides a run-time infrastructure for managing relational data as objects.