Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my testing environment, I have a local sql express (2008R) server instance. I've created a domain group and given it a login in the database.

But now, how do I consctruct the connection string for my web-application? Do I give it the username and password of one of the members of the group?

And, what do I put for a "user" in the Database security section? The group itself doesn't have a password.

Do I have to add the service account from the application pool to the AD group?

Here is what I have for a connection string; but this allows all connections, it seems:

<add name="development" connectionString="server=myserver\sqlexpress;
    database=mydatabase;Persist Security Info=True;Integrated Security=SSPI;
    Trusted_Connection=True; Pooling=True" providerName="System.Data.SqlClient"
share|improve this question

closed as off topic by Max Vernon, Jon Seigel, Marian, RolandoMySQLDBA, Mat Apr 22 '13 at 9:56

Questions on Database Administrators Stack Exchange are expected to relate to database administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I just edited the connection string so that it doesn't have horizontal scroll bars. Just easier to read that way. – Max Vernon Apr 19 '13 at 21:36
How did you do that? – bgmCoder Apr 19 '13 at 21:38
I just pressed <Enter> wherever I wanted a new line, then indented the next line by 4 spaces. Creates a code block... – Max Vernon Apr 19 '13 at 21:43
I'm going to recommend moving this question to the main StackOverflow site since it is more programming related; this site is for database administration. – Max Vernon Apr 19 '13 at 21:46
No problem, don't worry about posting here if you are unsure! We welcome everyone! – Max Vernon Apr 19 '13 at 21:50

You need to configure the IIS Application Pool to use the identity (domain user) you created.

My example below shows the default, out-of-the-box configuration. You'd need to choose 'Configurable' and specify the username and password there.

Then you need to configure the site to use the AppPool.

enter image description here

The connection string would then be:

server=myserver\sqlexpress;database=mydatabase;Persist Security Info=True;
Integrated Security=SSPI;Trusted_Connection=True; Pooling=True

Just like you have it.

share|improve this answer
Hi, Mr. Vernon; what if, on my dev machine, the service is the VS virtual server - it's not in iis? – bgmCoder Apr 19 '13 at 21:34
Good question. There must a similar way to do this. Perhaps you need to start Visual Studio as the user that has access to the database. I'm not certain. – Max Vernon Apr 19 '13 at 21:35
I just fired up VS... will see if there is a way to do. – Max Vernon Apr 19 '13 at 21:37
I understand what you mean, though for the application pool - that will probably work on the server. I'll try and see if I can get VS to run in IIS on my dev machine instead of using the virtual server - and see what happens. – bgmCoder Apr 19 '13 at 21:37
Problem is that I can't add a local service account (VS) to a domain group... – bgmCoder Apr 19 '13 at 21:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.