About Database.DoesDatabaseExists Method

Jul 20, 2010 at 2:38 AM
Edited Jul 20, 2010 at 2:48 AM


Thanks for this contribution, nice work.

I think that's cool to allow external code to use the Database.DoesDatabaseExists Method to check for database existence before trying to create a new one.

I know that the DatabaseExistsException fill this case but it's pretty nice to use the first way also.

please make it public.




Jul 20, 2010 at 2:43 AM

Very good suggestion, Waleed.

Thanks.  I will try to work on it this weekend.


May 6, 2011 at 10:59 AM
Edited May 6, 2011 at 11:00 AM

When I start my application it checks for creating a database or not:

        If Not Database.DoesDatabaseExists(DatabaseName) Then
            db = Database.CreateDatabase(DatabaseName)
            db = Database.OpenDatabase(DatabaseName, String.Empty, False)
        End If

But I get an IsolatedStorageException when using DatabaseExists:


The application identity of the caller cannot be determined
    System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type appEvidenceType)
    System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type applicationEvidenceType)
    SilverlightPhoneDatabase.Database.DoesDatabaseExists(String databaseName)
Maybe there's something wrong the way I use this method?
May 6, 2011 at 12:06 PM

I am guessing you are making this call too early in the applicaiton lifecycle.  If you post a repro, I can take a closer look for you.  You can always email me the code if you would like.



May 11, 2011 at 11:33 AM

You're right! Thank you Sergey!