SQL Server Performance


Discussion in 'SQL Server 2005 CLR' started by JusticeLeague, Oct 10, 2005.

  1. JusticeLeague New Member

    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.
  2. Madhivanan Moderator

    Better post this in .NET related forums


    Failing to plan is Planning to fail
  3. alzdba Member

    maybe you should post <some codes>
    to give us a look at why it might generate this error !

Share This Page