PC Review


Reply
Thread Tools Rate Thread

Code reuse & SQL CLR

 
 
saarcarmi@gmail.com
Guest
Posts: n/a
 
      11th Dec 2005
Hi

How can I determine whether my code is ran from within the sql server
or not?

I want to write a block of code which opens a connection to the DB -
using a context connection if it resides in the SQL process and regualr
if it is not.

How could it be done?

Thanks saar

 
Reply With Quote
 
 
 
 
Nicole Calinoiu
Guest
Posts: n/a
 
      12th Dec 2005
Check the value of Microsoft.SqlServer.Server.SqlContext.IsAvailable. If
it's true, your assembly is running within the SQLCLR host.


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> How can I determine whether my code is ran from within the sql server
> or not?
>
> I want to write a block of code which opens a connection to the DB -
> using a context connection if it resides in the SQL process and regualr
> if it is not.
>
> How could it be done?
>
> Thanks saar
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
code reuse mp Microsoft C# .NET 1 21st Jan 2011 02:47 PM
Code Reuse Bob Weiner Microsoft C# .NET 4 23rd Jun 2006 02:10 AM
Code reuse, code behind, and can't inherit since already inheritsPage Randall Parker Microsoft ASP .NET 2 1st Nov 2005 06:59 PM
Code reuse Simon Microsoft C# .NET 2 23rd May 2004 08:56 PM
Code reuse in C# Frank Oquendo Microsoft C# .NET 6 16th Dec 2003 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:21 AM.