I have checked this and I have hooked up Profiler to see if my query is
working. Not sure how to check for the data being returned. I assume it is
since I am checking for present data in a Sqldatareader.
Here is my code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
get_data()
Populate_Fields()
End Sub
Sub get_data()
myConnection = New SqlConnection("x")
myConnection.Open()
myCommand = New SqlCommand("select
BLASTNAME,BFIRSTNAME,BSOCSECNO,loan.LOANNUM,APPLTYPE,LOANSTAT,PROPADDR1 from
borrower, propchar, loan where loan.loanid = borrower.loanid and loan.loanid
= propchar.loanid and borrower.borrowercount = 1 and BSOCSECNO = '" &
Trim(Request.QueryString("SSN")) & "'", myConnection)
myDatareader = myCommand.ExecuteReader()
End Sub
Sub Populate_Fields()
If myDatareader.Read Then
myDataGrid.DataSource = myDatareader
myDataGrid.DataBind()
Else
Label1.Text = "No data found corresponding to an SSN of " &
Request.QueryString("ssn")
End If
myDatareader.Close()
myConnection.Close()
myDatareader = Nothing
myConnection = Nothing
myCommand = Nothing
End Sub