Connection Strings

When instantiating a DataContext, a connection string must be supplied, indicating the location of the database file and an optional password. See the following example:

string connectionString = "Data Source='isostore:/DirectoryName/FileName.sdf';Password='password'";DataContext dataContext = new DataContext(connectionString);

The Data Source parameter defines the location of the database file in isolated storage, and the Password parameter is used to access (or create) an encrypted database.

The isostore prefix of the Data Source value specifies that the file is located in isolated storage. By omitting the isostore prefix, it indicates that the file is located in the XAP file relative to its ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.