Linq and change Label text

DeviC3DeviC3 Member ✭✭

Hi I'm trying to write code to change Label text after succesful barcode scanning. Code below:

    void SearchBarcodeFromDB()
    {
        using (SQLiteConnection conn = new SQLiteConnection(App.dbPath))
        {
            conn.CreateTable<Products>();
            var dbList = conn.Table<Products>().ToList();

            var row = from x in dbList
                      where x.Barcode == barcodeResult
                      select x.Product;

            resultDB_LBL.Text = row;

        }
    }

I used SingleOrDefault(), Single(), ToString() with no result
Can someone help me with this?

Tagged:

Best Answer

Answers

  • DeviC3DeviC3 Member ✭✭
    edited July 15

    Ok, I modified code and it works.
    Thanks @LandLu

Sign In or Register to comment.