471,317 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Attribute on return value, how ??

Hi,

How do you set an attribue on a return value ??

In Microsoft.SqlServer.Server you got SqlFacetAttribute wich I need to use
on my CLR function that should return a SqlString(MAX) - the
SqlFacetAttribute must be set on the static methods return value to do this.

[SqlFunction(Name= "....")]
public static SqlString MyClrFunction(
[SqlFacet(MaxSize = -1)] SqlString ID,
[SqlFacet(MaxSize = -1)] SqlString Name,
)
{
return new SqlString("Some data"};
}

Where do I put the SqlFacetAttribute on my return value ??

In advance, thanx

Soren
Jan 13 '06 #1
2 8168
Arrhhh - just forget it, figured it out :-)

[SqlFunction(Name= "....")]
[return: SqlFacet(MaxSize = -1)]
public static SqlString MyClrFunction(
[SqlFacet(MaxSize = -1)] SqlString ID,
[SqlFacet(MaxSize = -1)] SqlString Name,
)
{
return new SqlString("Some data"};
}

Soren

"Soren S. Jorgensen" <no****@nodomain.com> skrev i en meddelelse
news:uC*************@TK2MSFTNGP14.phx.gbl...
Hi,

How do you set an attribue on a return value ??

In Microsoft.SqlServer.Server you got SqlFacetAttribute wich I need to use
on my CLR function that should return a SqlString(MAX) - the
SqlFacetAttribute must be set on the static methods return value to do
this.

[SqlFunction(Name= "....")]
public static SqlString MyClrFunction(
[SqlFacet(MaxSize = -1)] SqlString ID,
[SqlFacet(MaxSize = -1)] SqlString Name,
)
{
return new SqlString("Some data"};
}

Where do I put the SqlFacetAttribute on my return value ??

In advance, thanx

Soren

Jan 13 '06 #2
Soren S. Jorgensen wrote:
How do you set an attribue on a return value ??


Use [return: SqlFacet(MaxSize=-1)]

Basically it's like "assembly" or "param" attributes.

Jon

Jan 13 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Hans Kesting | last post: by
3 posts views Thread by tshad | last post: by
20 posts views Thread by lovecreatesbeauty | last post: by
6 posts views Thread by Tim Roberts | last post: by
2 posts views Thread by philip | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.