SQL CLR | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

SQL CLR

I created a SVF using VB.Net and I had my function declared like this:<br /><br /><i>&lt;Microsoft.SqlServer.Server.SqlFunction(IsDeterministic:=True, IsPrecise:=True)&gt; _<br /> Public Shared Function MyFunction(ByVal intCodeItem As Int32) As SqlString<br /><br />&lt;some codes&gt;<br />Return New SqlString(&lt;somevalue&gt<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ /><br />End Function</i><br /><br />And i got this error message: System.InvalidOperationException: Data access is not allowed in this context. Either the context is a function or method not marked with DataAccessKind.Read or SystemDataAccessKind.Read, is a callback to obtain data from FillRow method of a Table Valued Function, or is a UDT validation method.<br /><br />I retrieve data inside the function using a datareader, manipulate the result set and return a string.<br /><br />Any help is appreciated.
Better post this in .NET related forums Madhivanan Failing to plan is Planning to fail
maybe you should post <some codes>
to give us a look at why it might generate this error !
]]>