PC Review


Reply
Thread Tools Rate Thread

DAL and Execute AS USER = 'myuser'

 
 
Avi
Guest
Posts: n/a
 
      13th Nov 2007
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


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      13th Nov 2007
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]
- (E-Mail Removed)

"Avi" <(E-Mail Removed)> wrote in message news:fhckpn$en2$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      13th Nov 2007
Avi,
Bob Beauchemin has a post that summarizes:

http://www.sqlskills.com/blogs/bobb/...5-2b894a4aab5e

--Peter
http://www.eggheadcafe.com
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
>
>
>

 
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
How to execute some “lines code” for other user than currently logged user? zoltix Microsoft C# .NET 6 17th Dec 2004 03:48 PM
Execute a script from different user Faisal Microsoft Windows 2000 1 6th Jun 2004 12:01 PM
Re: Execute application as User ?? Jerold Schulman Microsoft Windows 2000 Applications 2 11th Dec 2003 07:46 PM
Docs & Settings/Myuser/UserData ? Windows XP Basics 1 25th Jul 2003 09:02 PM
Pictures for Administrators and MyUser Mayolive Windows XP Embedded 3 10th Jul 2003 04:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:35 PM.