exception with Linq to SQL using sdf file

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-03-08T21:48:08Z Indexed on 2010/03/08 21:51 UTC
Read the original article Hit count: 492

Filed under:
|
|
|
|

Hi,
I've set up a project with an SDF local database file and am trying to access it using an LINQ To SQL (".dbml") file. I have used the connection string provided by the sdf file and can instanciate the object with out a problem:

thisDataContext = new MyDataContext(GetConnectionString());

However, whenever i try to access any information from it eg

var collection = (from MyObject p in thisDataContext.MyTable select p);

I get the error -

"The table name is not valid. [ Token line number (if known) = 2,Token line offset (if known) = 14,Table name = Person ]"

I am using Visual Studio 2008 SP1 .Net 3.5 and SQL 2008 CE.

I gather something similar happened for SQL 2005 CE and a Hotfix was released, but i would have thought the fix would have been fixed in this version before release.

Does anyone know the fix for this?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET