Avatar of kishore_peddi
kishore_peddi

asked on 

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

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
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
Éric Moreau
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft SQL Server 2005
Microsoft SQL Server 2005

Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.

72K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo