jamshed ahmed 0 Junior Poster in Training

hi and hellow i have very starange problem iam just trying to get the data which i just inserted into the database but datagrid is no loading very faster

my below code there two methods AddDetailItems which will insert record into table and there is an other method GetBillItemDetail wich will return the datatable i mean it will reterive all the record which i have enterd with that receipt number

now what happens after inserting record,record is added in to the database which i chek it in to the database but it can not be loaded very fast in datagrid that's why my grid says sorry no record found even i have used thread to stop for few secods but it is not working please help me out

Dim op As New Operations
            op.AddDetailItems(dtpBillEntry.Text, txtItemName.Text, CInt(txtItemPrice.Text), CInt(txtQty.Text), CInt(txtTotalItemRs.Text), CInt(txtReceiptNo.Text))
            System.Threading.Thread.Sleep(350)

            dtItemDetail = op.GetBillItemDetail(CInt(txtReceiptNo.Text))
            If dtItemDetail.Rows.Count > 0 Then
                DgvBill.DataSource = dtItemDetail
                txtTotal.Text = CInt(op.GetSumBillItems(DgvBill))
                srvsCharges = CInt(txtTotal.Text) * CInt(txtServiceCharges.Text) / 100
                txtGrantTotal.Text = CInt(txtTotal.Text) + (srvsCharges).ToString
            Else
                DgvBill.DataSource = dtItemDetail
                MsgBox("NO RECORD FOUND")
            End If
            Call ItemsClear()
            txtItemCode.Focus()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.