Reputation: 161
I am just working with sqlite DB. My DB location is system.environmet.specialfolder.personal So how can access this folder
Upvotes: 0
Views: 743
Reputation: 1582
Here's how you can create a connection to an SQLite DB located in System.Environment.SpecialFolder.Personal
:
public class SQLite_Android : ISQLite
{
public SQLiteConnection GetConnection()
{
string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var path = Path.Combine(documentsPath, "mySQLite.db"); // change mySQLite.db for your SQLite db filename
// Create the connection
var conn = new SQLiteConnection(path);
// Return the database connection
return conn;
}
}
With
public interface ISQLite
{
SQLiteConnection GetConnection();
}
Upvotes: 1