利用代码here,我已将此添加App.xaml.cs:为什么我得到“非静态字段,方法或属性'Photrax.App.DBPath.get'需要对象引用?
sealed partial class App : Application
{
public string DBPath { get; set; }
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
. . .
this.DBPath = Path.Combine(
Windows.Storage.ApplicationData.Current.LocalFolder.Path, "photrax.sqlite");
. . .
...但是这个代码:
internal static List<PhotraxBaseData> SavePhotoset(List<PhotraxExifData> exifData)
{
using (var db = new SQLite.SQLiteConnection(App.DBPath))
. . .
...失败,“对象引用'Photrax.App.DBPath.get'“
Photrax是我的项目的命名空间;但附加的“get”爵士乐有什么用?
我需要做什么来为SQLiteConnection构造函数提供所谓的全局数据库路径?
会尽力搜索错误消息 – user2864740 2014-10-18 00:04:14
http://stackoverflow.com/questions/2051558/an-object-reference-is-required-for-the-non-static-field-method-or-property – user2864740 2014-10-18 00:05:07