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 applications and haven't had any problems since. (see


    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. 



    Nathan Zaugg

    Friday, July 11, 2008 10:12 PM


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





    Friday, July 11, 2008 11:57 PM