0

I make sales and procurement system and when I work a query, or search the invoice number, the results appear in palm leaves View, but appears only in a row while the bill by no more than one row And this was used by code i.m used vb.net and database sql and b yway linq to sql

 Try
        Dim data = (From d In DBVariable.Data.masterfatoras 
                    From f In DBVariable.Data.fatoras
                    From na In DBVariable.Data.asnafs 
                    From sup In DBVariable.Data.suppliers
                    Where d.ID = f.mid Where d.num.Contains(txt)
                    Select d, f, na, sup).FirstOrDefault
        TextBoxX1.Text = data.d.num


        nammord.Text = (From supp In DBVariable.Data.suppliers Where data.d.idmord = supp.ID Select supp.Name).Single()
        txtmord.Text = (From supp In DBVariable.Data.suppliers Where data.d.idmord = supp.ID Select supp.Code).Single()
        adrmord.Text = (From supp In DBVariable.Data.suppliers Where data.d.idmord = supp.ID Select supp.Address).Single()
        nodaf.Text = data.d.nodfa
        ' ''نفاصيل الفاتورة


        For p As Integer = 0 To gridshraa.Rows.Count - 1

            gridshraa.Rows(p).Cells(2).Value = (From asna In DBVariable.Data.asnafs Where data.f.idname = asna.ID Select asna.Name).Single()
            gridshraa.Rows(p).Cells(1).Value = (From asna In DBVariable.Data.asnafs Where data.f.idname = asna.ID Select asna.code).Single()
            gridshraa.Rows(p).Cells(3).Value = (From asna In DBVariable.Data.asnafs Where data.f.idname = asna.ID Select asna.unit).Single()
            gridshraa.Rows(p).Cells(4).Value = data.f.qty
            gridshraa.Rows(p).Cells(5).Value = data.f.price
            gridshraa.Rows(p).Cells(6).Value = data.f.totprice
        Next

    Catch

    End Try
OneFineDay
  • 9,004
  • 3
  • 26
  • 37

0 Answers0