It is my understanding that System.Core.dll and System.Xml.Linq.dll are supported (or will be) in SQL server 2008.
I am trying to use Linq to Objects in my SQL 2008 CLR project.
How would I go about "adding" / registering those dlls? (I can't add them as references)
Thanks in advance, Orry
You can get same generated SQL query manually by calling ToString: string sql = committeeMember. ToString(); This overridden method internally calls ObjectQuery.
When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back to objects that you can work with in your own programming language.
LINQ to SQL was the first object-relational mapping technology released by Microsoft. It works well in basic scenarios and continues to be supported in Visual Studio, but it's no longer under active development.
SQLCLR projects don't seem to provide the "Add reference" menu item, but Power Commands for Visual Studio at http://code.msdn.microsoft.com/PowerCommands provides an easy workaround.
1) Install the power commands.
2) Create another, non-SQLCLR project, and add those references to it. If you already have a project with those references in the solution, skip this & just use it.
3) Right click on each desired reference from #2, and select Copy reference. Go to the references node of your SQLCLR project and select Paste reference.
Note well that you cannot just reference any old DLL; there's a pretty narrow pre-approved list of allowed dlls. See e.g. http://www.sqlskills.com/blogs/bobb/post/New-SQLCLR-approved-assembly-in-SP1.aspx for more on that.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With