System.NullReferenceException RRS feed

  • Question

  • universal app sqlite using its show error System.NullReferenceException

    private async void SaveUniversity()
                if (University!= null && !string.IsNullOrEmpty(University.Name))
                    await _dataService.SaveUniversityAsync(University);
                    await this._messageBoxService.ShowAsync("Added university.", "SQLite Sample");

    full code on ondrive http://1drv.ms/1lxKaUK

    Wednesday, July 2, 2014 3:12 AM

All replies

  • App.Connection is null in your SaveUniversityAsync function:

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by luna_luna Thursday, July 3, 2014 3:42 AM
    • Unmarked as answer by luna_luna Thursday, July 3, 2014 3:46 AM
    Wednesday, July 2, 2014 7:35 PM