Dim TB1 As String
TB1 = TextBox1.Text
Dim DataP As New PTGData
Dim DT As New Data.DataTable
DT = DataP.GetdataTable("select pro_id from products where pro_id = '" & TB1 & "' ")
If DT.Rows.Count > 0 Then
Label17.Text = "มีข้อมูลอยู่แล้ว"
Else
Label17.Text = "เข้าเงื่อนไข"
End If
แต่มึนขึ้น Error แบบนี้ครับ
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 22:
Line 23: Line 24: If DT.Rows.Count > 0 Then
Line 25: Label17.Text = "มีข้อมูลอยู่แล้ว"
Line 26: 'Label17.Text = DT.Rows(0).Item("pro_id")