DAL and Execute AS USER = 'myuser'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Avi

    #1

    DAL and Execute AS USER = 'myuser'

    Hi all,



    I'm using DAL auto generated code. Is it possible for me to have the same
    connection string for all my transactions but to execute the command
    "Execute AS USER = 'myuser'" (SQL Server 2005) before each execution. Where
    I control the name of the user.



    Thanks,

    Avi


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: DAL and Execute AS USER = 'myuser'

    Avi,

    To do this, I would issue the command against the database when you
    create and open the command. Then I would issue your other commands, as
    needed.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Avi" <m@m.comwrote in message news:fhckpn$en2 $1@news2.netvis ion.net.il...
    Hi all,
    >
    >
    >
    I'm using DAL auto generated code. Is it possible for me to have the same
    connection string for all my transactions but to execute the command
    "Execute AS USER = 'myuser'" (SQL Server 2005) before each execution.
    Where I control the name of the user.
    >
    >
    >
    Thanks,
    >
    Avi
    >
    >

    Comment

    • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

      #3
      RE: DAL and Execute AS USER = 'myuser'

      Avi,
      Bob Beauchemin has a post that summarizes:



      --Peter

      unBlog: http://petesbloggerama.blogspot.com
      BlogMetaFinder: http://www.blogmetafinder.com



      "Avi" wrote:
      Hi all,
      >
      >
      >
      I'm using DAL auto generated code. Is it possible for me to have the same
      connection string for all my transactions but to execute the command
      "Execute AS USER = 'myuser'" (SQL Server 2005) before each execution. Where
      I control the name of the user.
      >
      >
      >
      Thanks,
      >
      Avi
      >
      >
      >

      Comment

      Working...