You can "print" somewhere the value of

dbPath = Path.Combine (
                        Environment.GetFolderPath
(Environment.SpecialFolder.Personal),
                        FileName);

Then you can see exactly where is the correct path where is the database.
And this folder is read/write, inside the application folder, some another
folders aren't, so it's the recommended place to use on MonoTouch and
MonoDroid.

Karl

From:  vsr28 <shadaur.rah...@harbingergroup.com>
Reply-To:  "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Date:  Wed, 10 Aug 2011 22:31:00 -0700 (PDT)
To:  "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Subject:  Re: [mono-android] How to connect Sqlite Database with Monodroid?

I have created one new folder of name "files" and put database in it. Now i
am able to connect with database but when i tries to select rows from table,
it shows error like SQLite Error:no such table:TBLUNIT. But this table is
present in dadabase. Also tried with SqliteDataAdapter but still got the
same error. Below is code.

using (var contents = connection.CreateCommand())
{
                    contents.CommandText = "SELECT * FROM TBLUNIT";
                    var r = contents.ExecuteReader();
                    while (r.Read())
                        txtVw.Text += string.Format("\n\tKey={0};
Value={1}", r[0].ToString(), r[1].ToString());
                }

Please help.

--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/How-to-connect-Sqlite-Database
-with-Monodroid-tp4686094p4688401.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to