Dim sql As String = "Select stqty,stqty1,stqty2,stunit3,stunit4 From Stock where stcode=" & stname.SelectedValue
stockin = stin.Text
Cmd = New SqlCommand(sql, mySQLConn)
Dr = Cmd.ExecuteReader
Dr.Read()
If Dr.HasRows Then
qty = CInt(Dr.Item("stqty"))
qty1 = CInt(Dr.Item("stqty1"))
qty2 = CInt(Dr.Item("stqty2")) 'ได้ค่าเดิมในสต๊อก
stunit3 = CStr(Dr.Item("stunit3"))
stunit4 = CStr(Dr.Item("stunit4"))
End If
มันขึ้นเออเรอค่ะ
Conversion from type 'DBNull' to type 'String' is not valid.