here is the code:
it says that: sqlRead is not declared (the one that after "Finally" was highlighted), please help
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If ModuleUser.frmCRCurTestDetails.SqlConnectionGetRptTitleValues.State = ConnectionState.Closed Then
ModuleUser.frmCRCurTestDetails.SqlConnectionGetRptTitleValues.Open()
End If
ModuleUser.frmCRCurTestDetails.SqlSelectCommandGetRptTitleValues.Parameters("@RID").Value = ModuleUser.curResultID
Dim sqlRead As SqlClient.SqlDataReader
sqlRead = ModuleUser.frmCRCurTestDetails.SqlSelectCommandGetRptTitleValues.ExecuteReader(CommandBehavior.SingleResult)
While sqlRead.Read
MsgBox(sqlRead.GetSqlString(1).Value)
End While
ModuleUser.frmCRCurTestDetails.SqlConnectionGetRptTitleValues.Close()
Catch Exp As SqlClient.SqlException
MsgBox(Exp.Message, MsgBoxStyle.Critical, "SQL Error")
Finally
sqlRead.Close()
End Try
End Sub
it says that: sqlRead is not declared (the one that after "Finally" was highlighted), please help