Hi all,
this code did work so i am a bit confused as to why all of a sudden it doesnt, can anyone see anything that i am missing. The error is with the while loop for the dataReader!
thanks,
Rob
---------------------------------------
this code did work so i am a bit confused as to why all of a sudden it doesnt, can anyone see anything that i am missing. The error is with the while loop for the dataReader!
Code:
Public Function GetQuotes(ByVal Customer As String) As GetQuotesResponse
Dim quote As QuoteInfo
Dim quoteCol As New QuoteInfoCollection
Dim gqr As New GetQuotesResponse
Dim reader As SqlDataReader
'Grab Quotes
reader = SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings("ConnectionString"), _
"CERULEAN_GetQuotes", Customer)
While reader.Read
quote = New QuoteInfo
With quote
.CustomerCode = IIf(reader("Customer Code") Is DBNull.Value, String.Empty, reader("Customer Code"))
.Project = IIf(reader("Project") Is DBNull.Value, String.Empty, reader("Project"))
.ProjectDetail = IIf(reader("Project Detail") Is DBNull.Value, String.Empty, reader("Project Detail"))
.ProspectCode = IIf(reader("Prospect Code") Is DBNull.Value, String.Empty, reader("Prospect Code"))
.QuoteNo = IIf(reader("Quote No") Is DBNull.Value, String.Empty, reader("Quote No"))
.ProjectStatus = IIf(reader("Project Status") Is DBNull.Value, String.Empty, reader("Project Status"))
.RepCode = IIf(reader("Rep Code") Is DBNull.Value, String.Empty, reader("Rep Code"))
.YourRef = IIf(reader("Your Ref") Is DBNull.Value, String.Empty, reader("Your Ref"))
.EnteredBy = IIf(reader("Entered By") Is DBNull.Value, String.Empty, reader("Entered By"))
End With
quoteCol.Add(quote)
End While
reader.Close()
gqr.Quotes = quoteCol
Return gqr
End Function
thanks,
Rob
---------------------------------------