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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.