I have the following function. I realize this isn't a good use of CLR functions but I'm just trying to learn right now. What would the return type for this function be or am I returning the result set incorrectly?
I want to use a function so I can later join to this in another query.
Public Shared Function SelectData(ByVal UserId As Integer) As SqlString
Using cmd As New SqlCommand
cmd.CommandText = "select * from SomeTable where userId = " & UserId
Using dr As SqlDataReader = cmd.ExecuteReader
Return New SqlString("")
When I try and register this function I am told via an error that the return type is not correct.
How do I return a result set from a CLR function? Does anyone have any simple examples that pull data from the same database (not some other second data source like an RSS feed)
Thanks so much for the help.