smeacham

Database_iOS.cs

Jun 7th, 2016
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.IO;
  5.  
  6. using SQLite;
  7. using SQLiteNetPCLVS.iOS;
  8.  
  9. [assembly: Xamarin.Forms.Dependency(typeof(Database_iOS))]
  10. namespace SQLiteNetPCLVS.iOS
  11. {
  12.     class Database_iOS : IDatabase
  13.     {
  14.         public Database_iOS() { }
  15.         public SQLiteConnection DBConnect()
  16.         {
  17.             var filename = "ItemsSQLite.db3";
  18.             string folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
  19.             string libraryFolder = Path.Combine(folder, "..", "Library");
  20.             var path = Path.Combine(libraryFolder, filename);
  21.             var connection = new SQLiteConnection(path);
  22.             return connection;
  23.         }
  24.     }
  25. }
Add Comment
Please, Sign In to add comment