Tarak
Tarak

Reputation: 1212

Delete file in Windows Store app

How to delete Database file created by Sqlite-net in Windows store application. I tried this

StorageFile sampleFile = await ApplicationData.Current.LocalFolder.GetFileAsync(databaseName);
sampleFile.DeleteAsync(StorageDeleteOption.Default);

but neither getting any exception nor file is getting deleted. What am i missing here ?

Upvotes: 1

Views: 2228

Answers (1)

J.B
J.B

Reputation: 1700

Try awaiting the DeleteAsync as well

StorageFile sampleFile = await ApplicationData.Current.LocalFolder.GetFileAsync(databaseName);
await sampleFile.DeleteAsync(StorageDeleteOption.Default);

Upvotes: 2

Related Questions