Visual C # 2008 EE SP1 - Linq to SQL - Connecting Data to Remote Server?

After upgrading my Visual C # 2008 Express Edition to .NET3.5, SP1, I was unable to create new LINQ to SQL classes using the remote database. I used to be able to do it well.

I open the project (windows forms, class library, same behavior) and either use the class method New -> Linq To SQL, or go directly to add the data connection that I need later, i.e. open the database explorer and right click Mouse Data Connections for "Add Connection".

This leaves me with only 3 options, however MS Access Database Fiel, SQL Server Compact 3.5 (which also talks about db file in description) and Microsoft SQL Server database file.

What I am missing when I expect there is a way to connect to f.ex. SQL Server 2005/2008 on my network or over the internet?

Thank,

+1


source to share


1 answer


You cannot connect to SQL server using express versions of VS, but what you can do is use sqlMetal.exe tool to generate dbml from your SQL server, then you can just add this dbml to the project and pass the string connections to the data file it created.

To use the Open Visual Studio command line and type "Sqlmetal" and it will show you how to use it, you can find more details here .



The only problem is that you cannot drag and drop n folders into the dbml after they have been generated as you cannot connect to the server in the database explorer.

+1


source







All Articles