0

I have a stand alone application that works great with a Local user account in MS SQL. When I try to use an active directory service account instead I appear to be running into problems.

It appears Microsoft want's the exe to run as the domain user service account which is not an option for me. Looking at alternatives, one person mentioned having main exe launching a second exe that does the work or having a local windows service.. neither of these are an option either. It feels like this is getting more complex then it needs to be.

Here is an example of the piece of code I am working with:

private void MakeConnection(){
    string ServerNM = @"MyServer";
    string Database = @"Test01";
    string Username = @"testdomain\testuser";
    string Password = @"testpass";

    string connection_string = "Server=" + ServerNM 
        + "; Database=" + Database 
        + "; User ID=" + Username 
        + "; Password=" + Password
        + "; Max Pool Size= 1000;";

    try {
        SqlConnection oSqlConnectionTest = new SqlConnection(connection_string);
        oSqlConnectionTest.Open();

    }catch(Exception oException){
        MessageBox.Show("Error: " + oException.ToString());
    }
}

Is this a real limitation or am I missing something?

2
  • Could you be a little more specific about "problems?" Commented Apr 24, 2014 at 15:25
  • You're missing something. Are you sure the service account has permissions to the database? Are you catching an exception? What's the error? Commented Apr 24, 2014 at 16:04

1 Answer 1

1

SQL Server does not accept domain accounts in the connection string for security reasons.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.