none
Linq to SQL 'Execute As' RRS feed

  • Question

  • Hello All,

     

    I have a question regarding the 'Execute As' statement in SQL server as it relates to LINQ to SQL.  Basically we want to run the 'EXECUTE AS USER = nzaugg' before any other statement runs on a data context.  All of our users will exists as users without logins.  We had issues with connection pooling (each user was connecting with their own credentials) but we implemented the 'execute as' with our ado.net applications and haven't had any problems since. (see http://interactiveasp.net/blogs/natesstuff/archive/2008/06/26/connection-pooling-vs-audit-logging.aspx)

     

    We want to use LINQ to SQL for our newer apps but I can't figure out how to do this type of thing.  Our ADO.NET is simply a class that we use, but for LINQ to SQL the DataContext class is generated using the designer. 

     

    Thanks!

    Nathan Zaugg

    Friday, July 11, 2008 10:12 PM

Answers

  • You can set a DbConnection on the DataContext, which you can manage yourself.

     

    Thanks,

    --Samir

     

    Friday, July 11, 2008 11:57 PM