I have a Desktop application that uses Linq To SQL
as the DAL. It accesses a local SQL Express DB
.
If I have a SQL CE DB
that has the Exact same schema(table structure) can I re-use the generated dbml
with just giving it a different connection string?
This article on LINQ To SQL on SQL CE from Matt Manela suggests that you could replace your SQL Server Express connection string with a connection string to SQL Server CE without any large issues. If it's just table-level querying that you're interested in, it sounds like you'll be in good shape.
He points out though, that CE handles connections differently than the larger SQL Server editions.
Without having tested it myself, I'd only want to determine if LINQ To SQL would ever generate any TSQL statements using keywords or features that SQL CE didn't support.
Also note, the current release does not support stored procedures or the XML datatype. It uses a subset of TSQL.
Best to visit the official .NET 3.5 SP1 LINQ To SQL for SQL Server Compact page at Microsoft.