Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

SQLite GetConnection: DB creation problem

$
0
0

Hi,

I am using below lines to connect to SQLite DB in my Xamarine Forms application:

SQLite_Android sqLiteAndroid = new SQLite_Android();
SQLiteConnection db = sqLiteAndroid.GetConnection();

after this I am creating tables with this line:
db.CreateTable();

Now, the first time the DB should be created and for the next calls I should connect with the existing DB and can deal with newly created table. But, whenever I am calling .GetConnection(); method, it is creating a new instance of DB and I am not able to get any tables or objects from that DB. It is always creating a new DB.

So, can anyone help me to create a DB first, and then create tables into that and finally working with data inside that table?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>