Skip to content

Commit

Permalink
Fixed bug: connection string for username/password was incorrect!
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitch-Wheat committed Feb 26, 2013
1 parent e127dfe commit c5ec413
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Binary file modified SQLDiagCmd/SQLDiagRunner.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions SQLDiagRunner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.13051")]
[assembly: AssemblyFileVersion("1.0.3.13051")]
[assembly: AssemblyVersion("1.0.4.13057")]
[assembly: AssemblyFileVersion("1.0.4.13057")]
10 changes: 5 additions & 5 deletions SQLDiagRunner/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ private string GetQueryText(SqlQuery q, string database)

private string GetWorkSheetName(string queryTitle, string worksheetPrefix)
{
string worksheetName = string.IsNullOrEmpty(worksheetPrefix) ? queryTitle : worksheetPrefix + " " + queryTitle;
var worksheetName = string.IsNullOrEmpty(worksheetPrefix) ? queryTitle : worksheetPrefix + " " + queryTitle;

string worksheetNameSanitised = SanitiseWorkSheetName(worksheetName);
var worksheetNameSanitised = SanitiseWorkSheetName(worksheetName);

// Check if name already exists: 31 char limit for worksheet names!
while (_dictWorksheet.Contains(worksheetNameSanitised))
Expand All @@ -149,7 +149,7 @@ private string GetWorkSheetName(string queryTitle, string worksheetPrefix)
return worksheetNameSanitised;
}

private string SanitiseWorkSheetName(string wsname)
private static string SanitiseWorkSheetName(string wsname)
{
var s = wsname.RemoveInvalidExcelChars();

Expand All @@ -166,8 +166,8 @@ bool trusted
)
{
const string applicationName = "SQL Server Diagnostic Script Runner";
const string trustedConnectionStringTemplate = "server={0};database={1};Trusted_Connection=True;Application Name={2}";
const string sqlLoginConnectionStringTemplate = "server={0};database={1};username={2};password={3};Application Name={4}";
const string trustedConnectionStringTemplate = "Server={0};Database={1};Trusted_Connection=True;Application Name={2}";
const string sqlLoginConnectionStringTemplate = "Server={0};Database={1};User Id={2};Password={3};Application Name={4}";

if (trusted)
{
Expand Down
3 changes: 2 additions & 1 deletion SQLDiagRunnerUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ private void BtExecuteClick(object sender, EventArgs e)
var runner = new Runner();
runner.ExecuteQueries(servers, txtUsername.Text, txtPassword.Text,
txtScriptLocation.Text, txtOutputFolder.Text, databases,
chkTrustedConnection.Checked, chkAutoFitExcelColumns.Checked, Int32.Parse(txtTimeout.Text));
chkTrustedConnection.Checked, chkAutoFitExcelColumns.Checked,
Int32.Parse(txtTimeout.Text));
}
finally
{
Expand Down
Binary file modified SQLDiagRunnerUI/SQLDiagRunner.dll
Binary file not shown.

0 comments on commit c5ec413

Please sign in to comment.