صادفنى هذه الخطأ اثناء العرض!!!!
Invalid attempt to Read when reader is closed.
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.InvalidOperationException: Invalid attempt to Read when reader is closed.
Source Error:
Line 29: Dim r As SqlDataReader = cmd.ExecuteReader()
Line 30:
Line 31: While r.Read
Line 32: If IsDBNull® = True Then
Line 33: Response.Write("gggggggggggg")
والكود للصفحة هو :
فى ال load
Dim sql_ As String = "SELECT personal.*
sql_ &= " where personal.p_id='" & Request.QueryString("xid") & "'"
Dim cmd As New SqlCommand(sql_, conn)
conn.Open()
Dim r As SqlDataReader = cmd.ExecuteReader()
While r.Read
If IsDBNull® = True Then
Response.Write("gggggggggggg")
Else
Response.Write("sldlokm;lm;")
End If
End If
End If