November 6, 2007 at 8:44 am
I have a tSQL function which calculates straight line distances between locations from the UK grid coordinates corresponding to UK post codes. However, I now have a requirement for finding out the distance by road instead. I could do this in .NET easily enough by calling the MapPoint Distance function, but I can't add an object reference to MapPoint (or any other COM object apparently) from a CLR project in VS2005.
Does anyone have any bright ideas on how to solve this dilemma?
Tony
November 6, 2007 at 8:50 am
You can do this if you set the database to trustworthy and the assembly to unsafe:
ALTER DATABASE myDatabase SET TRUSTWORTHY ON
alter/create assembly .... WITH PERMISSION_SET = UNSAFE
(note that both of these are security risks). In the furute SQL Server 2008 will be able to do this natively "well, via internal CLR anyway :)"
Regards,
Andras
November 6, 2007 at 9:09 am
But my problem starts in VS2005, long before I get to the deployment stage.
After creating a new SQL-CLR project, I can't find any way of adding a refernce to MapPoint. There is no COM option in the Add reference dialog, only SQL assemblies and projects. I tried creating a pure .NET solution hoping to be able to refernce that, but it doesn't appear in the solutions tab, and there is no option to browse to a solution or COM object.
Tony
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy