locked
System.NullReferenceException

    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");
                    _navigationService.GoBack();
                }
            }

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

    Wednesday, July 02, 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.

    Wednesday, July 02, 2014 7:35 PM
    Moderator