samedi 19 décembre 2015

Extract parts of variable into textbox C# UWP app

I'm creating a Windows app and the following code retrieves the chosen record from a list in the previous page into 'MyName'. Then with an SQL query I retrieve the record details equal to MyName. I can retrieve all these details for the record into the query variable but I want to add each element to a textbox and im not sure how to do this. For example [query.Name] = textbox1.Text. I hope my problem is clear and i'd appreciate any help. Thanks. :

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
        MyName = e.Parameter as string;
        var query = GetItemsNotDone();
    }

public IEnumerable<AddRecipe> GetItemsNotDone()
    {
        return conn.Query<AddRecipe>("SELECT * FROM [AddRecipe] WHERE [ID] = " + MyName);
    }

Aucun commentaire:

Enregistrer un commentaire