I have been using LINQPad to prototype some queries against a SQL 2000 database, and thought that since I am using LINQPad’s built in LINQ to SQL provider, I would be able to generate the same typed data context in a Visual Studio project.
I added a new data connection to Visual Studio Server Explorer in VS2010. It forced me to use “Microsoft SQL Server (OLE DB)” because “Microsoft SQL Server (SqlClient)” only works with SQL 2005 and above. Then I tried to drag tables onto my dbml surface, but I get the following message:
The selected object(s) use an unsupported data provider
I have found a very hacky workaround by copying the TypedDataContext dll that LINQPad itself builds into the Temp folder, and also referencing LINQPad.exe itself (which is needed for the typed data context base class). But really I would rather get LINQ to SQL working properly in my project.
Am I doing something wrong or stupid (this is my first time using LINQ to SQL)? Is there a way of me generating the same typed data classes that LINQPad can? This answer indicates that it ought to be possible.
It seems that this is a limitation of Visual Studio 2010. If you create the dbml in Visual Studio 2008 it connects to SQL Server 2000 with no problems and can create the LINQ to SQL typed DataContext.