04-03-22, 01:14 AM
كود :
Try
Me.FlowLayoutPanel1.Controls.Clear()
If conn.State = ConnectionState.Closed Then conn.Open()
Dim SqlStr As String = "Select * From Tbl_all_store where ID_STORE=" & Label2.Text & ""
Dim Cmd As New SqlCommand(SqlStr, conn)
Dim DR As SqlDataReader
DR = Cmd.ExecuteReader
If DR.HasRows Then
While DR.Read
'Dim clrs() As Color = {Color.LightCoral, Color.DarkKhaki, Color.DarkViolet, Color.Crimson, Color.Tomato}
Dim uc As New uc_cart_store_inve
uc.Label3.Text = DR("ItemName").ToString
uc.Label6.Text = DR("ExpirationDate").ToString
uc.Label1.Text = DR("PurchasePrice").ToString
uc.Label2.Text = DR("SalePrice").ToString
uc.Label4.Text = DR("SalePrice2").ToString
uc.Label5.Text = DR("Quantitys").ToString
Me.FlowLayoutPanel1.Controls.Add(uc)
End While
End If
DR.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try