For i = 0 To GridView1.Rows.Count - 1
Dim amt As TextBox = CType(GridView1.Rows(i).FindControl("TextBox1"), TextBox)
Label3.Text = amt.Text
Dim TimeStamp As DateTime = Date.Now
Dim cus As New OrderID()
UsertoID()
cus.OrderID = runid
cus.OrderDate = TimeStamp.ToString("MM-dd-yyyy")
cus.OrderCusID = people
cus.OrderProductID = ItemID
cus.OrderStatus = "InCart"
cus.OrderAmount = Convert.ToInt32(amt.Text) 'ที่มีปัญหา
cus.OrderActivate = "NO"
If cus.OrderAmount <> Nothing Then 'เก็บเฉพาะแถวที่มีค่าใน textbox เท่านั้น
db.OrderIDs.InsertOnSubmit(cus)
db.SubmitChanges()
End If
Next