Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 CLR Method Doesn't return Varchar

Author  Topic 

pcplayer
Starting Member

5 Posts

Posted - 2008-04-24 : 16:31:33
I have a written a dll in 2.0 that calls a webservice.
This webservice is used to authenticate users in Active Directory. I created a assembly to that calls this dll because of the diverse languages versions that will use it (from asp,vb6 on up) and all can get values from a stored procedure that calls that assembly. I works great. Until now, I have to add another function to my dll that calls the webservice and returns the Users Full name from Active directory for electronic signitures. Okay I added to the dll then tried to reconstruct my Assembly and stored procedures and recieved the following error. "CREATE PROCEDURE failed because a CLR Procedure may only be defined on CLR methods that return either SqlInt32, System.Int32, void"
I want to keep all these Active directory call all in one place so I can be consistant in all the different applications. I was reading about UDF but that could get messy as I have a config file for the dll that allows the user to dynamically change the url for the webservice. Any suggestions/help will be greatly appreciated

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-24 : 17:25:17
you must use a sproc output parameter for this, since AFAIK sprocs can't return varchars.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

pcplayer
Starting Member

5 Posts

Posted - 2008-04-24 : 17:53:28
Thanks for you response. Could you provide an example?

quote:
Originally posted by spirit1

you must use a sproc output parameter for this, since AFAIK sprocs can't return varchars.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com

Go to Top of Page

pcplayer
Starting Member

5 Posts

Posted - 2008-04-24 : 23:48:16
I solved it by using a function
http://aspnetlibrary.com/articledetails.aspx?article=Using-CLR-to-access-.NET-functions-in-SQL-Server
Go to Top of Page
   

- Advertisement -