Last post Jun 01, 2018 10:07 PM by Maurice Osborn
May 31, 2018 05:32 AM|Maurice Osborn|LINK
I just transferred website code that I created with VS 2008 for use with VS 2017. I also used VS 2017 to create a new version of the 2008 database. But when I tried to execute the Default page, an error was generated that stated: Severity Code Description
Project File Line Suppression State Error CS0246. The type or namespace name 'DataClassesDataContext' could not be found. So, how do I connect DataClassesDataContext to my SEAdb.mdf database?
May 31, 2018 07:15 AM|oned_gk|LINK
The error is not related to sql connection
Try read below detailed error and how to fix
Compiler Error CS0246
May 31, 2018 05:25 PM|Maurice Osborn|LINK
I am surprised by your response that my error is not related to an sql connection. There are actually 3 errors that refer to the following lines of code:
DataClassesDataContext db = new DataClassesDataContext();
LanguageTable languagetable = db.LanguageTables...
The errors obviously refer to the inability to access my SEAdb.mdf database and the LanguageTable defined in it. There is no connection string in the web.config file. So, how do I make it possible for my website to access my database?
Jun 01, 2018 01:32 AM|Deepak Panchal|LINK
It looks like you are trying to use LINQ in your code.
Did you add a reference for LINQ in your project?
If you did not then that can cause this error.
You can try to add reference to "System.Data.Linq"
Add > Reference> .NET > System.Data.Linq
Your error is not about SQL. It is about LINQ.
so if above suggestion not work then try to post your issue in forum below which is best suitable and correct forum for your issue.
MSDN LINQ to SQL Forum
I suggest you to close this thread before creating a new thread on above forum.
Thanks for your understanding.
Jun 01, 2018 02:14 AM|Maurice Osborn|LINK
I have the following code at the top of my Default page:
<%@ Page Language="C#" Title="Default" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
I assume that this is a good reference to "System.Data.Linq". Am I wrong?
Jun 01, 2018 10:07 PM|Maurice Osborn|LINK
Oh my God! I am able to open the 2008 project using VS 2017. I can’t believe it. I expected that I needed to recreate everything on VS 2017. Thank you any way.