Dim cn As New SqlConnection("Data Source=.\INSTANCE;initial catalog=stamp;user=sa;password=gariahat")
Dim cmd As New SqlCommand
Dim ds As New DataSet
Dim dt As DataTable
cmd.Connection = cn
cn.Open()
Dim da As New SqlDataAdapter("select * from item where broker_id = " + ComboBox1.SelectedItem, cn)
dt = New DataTable
ds = New DataSet
da.Fill(ds, "item")
Dim sumAmount As Double = 0
For Each row As DataRow In ds.Tables("item").Rows
TextBox1.Text = DirectCast(row, System.Data.DataRow)("name").ToString()
TextBox2.Text = DirectCast(row, System.Data.DataRow)("place").ToString()
TextBox3.Text = DirectCast(row, System.Data.DataRow)("date").ToString()
TextBox4.Text = DirectCast(row, System.Data.DataRow)("year").ToString()
ListBox1.Items.Add(DirectCast(row, System.Data.DataRow)("lot_no").ToString())
ListBox2.Items.Add(DirectCast(row, System.Data.DataRow)("amt").ToString())
sumAmount = sumAmount + Convert.ToDouble(DirectCast(row, System.Data.DataRow)("amt"))
Next
TextBox6.Text = sumAmount.ToString()
TextBox7.Text = (0.175 * sumAmount).ToString()
cn.Close()