troubleshooting Question

SQL CLR - Creating UDF with VB.NET 2005 !!

Avatar of kishore_peddi
kishore_peddi asked on
Microsoft SQL Server 2005
1 Comment1 Solution684 ViewsLast Modified:
Hi,
I am using DOT NET CLR in SQL Server 2005. I am creating an UDF in VB.NET 2005. I am getting error in the "FillRow" method (Error in declaration etc...). Can you please modify the code?

Partial Public Class UserDefinedFunctions

    <Microsoft.SqlServer.Server.SqlFunction(TableDefinition:="id Char(2), name varchar(50), sal money", FillRowMethodName:="FillRow", DataAccess:=DataAccessKind.Read)> _
    Public Shared Function GetRowsBySalary(ByVal salary As SqlMoney) As IEnumerable
    'Some code goes here
    End Function

    Public Shared Sub FillRow(ByVal obj As Object, ByRef id As SqlChars, ByRef name As SqlChars, ByRef sal As SqlMoney)
        Dim Row As DataRow = CType(obj, DataRow)
        id = CType(Row("id"), SqlChars)
        name = CType(Row("name"), SqlChars)
        sal = CType(Row("sal"), SqlMoney)
    End Sub

End Class

I have problems (Errors) while deploying this UDF. Can you please modify the code?

Thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros