I am returning one row from the database, and I want to convert the SQLDataReader to a string format, so I can pass it to my webservice.
Dim rdr As SqlDataReader = sqlcmd.ExecuteReader
If rdr.HasRows Then
rdr.Read()
GetInvHeaderValue = Convert.ToString(rdr.Read())
Return GetInvHeaderValue
Else
GetInvHeaderValue = "<ERR>No Records Returned</ERR>"
End If
How would I convert a SQLDataReader to a string?
Is there a better alternative?