我已经从这里尝试了一些解决方案..没有成功!
这是我的代码和下面的错误消息,
SQLite.SQLiteConnection connection = new SQLite.SQLiteConnection(dbPath);
using (var db = new SQLite.SQLiteConnection(dbPath))
{
int i = 0;
var d = from x in db.Table<stations>() select x;
foreach (var sd in d)
{
pushpin[] Tanke = new pushpin[i];
Tanke[i].Titel = sd.name.ToString(); //IndexOutOfRangeException (see below)
Tanke[i].Text = sd.brand.ToString();
Tanke[i].longitude = sd.longitude;
Tanke[i].latitude = sd.latitude;
MapLayer.SetPosition(Tanke[i], new Location(Tanke[i].latitude, Tanke[i].longitude));
pinLayer.Children.Add(Tanke[i]);
ToolTipService.SetToolTip(Tanke[i], Tanke[i].Titel);
i++;
}
db.Dispose();
db.Close();
}