Home

SQL authentication db connection string not working for lprun

I've run into a problem with lprun.exe and SQL authentication. I've created a script in LINQPad that runs just fine using either a db connection with Windows auth or SQL auth. The password for the SQL auth db connection is encrpted and persisted to the connections file. When I run this same query using lprun it runs fine for the Windows auth db connections but when I run for a SQL auth db connection I receive this error:

SqlException: Login failed for user 'MyUserName'.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
etc.

If I run the script in LINQPad and write the SQL auth db connection to the console I see this:

Data Source=MyServer;User ID=MyUserName;Password=MyPassword;Initial Catalog=MyDatabase;app=LINQPad [MyScriptName]

Running that same script in lprun I see this:

Data Source=MyServer;User ID=MyUserName;Password=;Initial Catalog=MyDatabase;app=LINQPad [MyScriptName]

Notice the password is not populated.

I'm running lprun at the cmd prompt using the same user account that was used to encrypt the password in the connections file.

What is going wrong here?

My version of LINQPad and lprun: Version=4.55.03

Thanks. You've got a great tool here Joe!


Sign In or Register to comment.