i'm trying to connect with exesting sqlite database with Xamarin application
(我正在尝试使用Xamarin应用程序连接大量的sqlite数据库)
var gridview1 = FindViewById<GridView>(Resource.Id.gvd);
var adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleExpandableListItem1);
string path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "dvp.db");
SqliteConnection con = new SqliteConnection(path);
SqliteCommand cmd = new SqliteCommand("select pays from tvp");
con.Open();
cmd.Connection = con;
SqliteDataReader sqlreader = cmd.ExecuteReader();
while (sqlreader.Read())
{
adapter.Add((string)sqlreader[0]);
}
sqlreader.Close();
con.Close();
the error is :
(错误是:)
System.ArgumentException: Invalid ConnectionString format for parameter "/data/user/0/App1.App1/files/dvp.db"
please if any one know where i have to place my database file or any other solution , help me and thanks :)
(如果有人知道我必须在哪里放置数据库文件或任何其他解决方案,请帮助我,谢谢:))
ask by P?liranté ?êll? translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…