Skip to content

Commit

Permalink
Fixes #175 corrects handling of quoting null strings in csv export
Browse files Browse the repository at this point in the history
  • Loading branch information
dgosbell committed Apr 23, 2019
1 parent 09da752 commit c9b134f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[assembly: AssemblyCopyright("Copyright © DAX Studio 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion( "2.8.4.119")]
[assembly: AssemblyFileVersion("2.8.4.119")]
[assembly: AssemblyVersion( "2.8.5.120")]
[assembly: AssemblyFileVersion("2.8.5.120")]


6 changes: 5 additions & 1 deletion src/DaxStudio.UI/ResultsTargets/ResultsTargetTextFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,13 @@ public Task OutputResultsAsync(IQueryRunner runner)
for (int iCol = 0; iCol < reader.FieldCount; iCol++)
{
var fieldValue = reader[iCol];
// quote all string fields
if (reader.GetFieldType(iCol) == typeof(string))
csvWriter.WriteField(fieldValue.ToString(), true);
if (reader.IsDBNull(iCol))
csvWriter.WriteField("", true);
else
csvWriter.WriteField(fieldValue.ToString(), true);
else
csvWriter.WriteField(fieldValue);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DaxStudio.UI/ViewModels/ExportDataDialogViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void EnsureSQLTableExists(SqlConnection conn, string sqlTableName, Adomd
{
colName = regEx.Groups[1].Value;
}

colName.Replace('|', '_');
var sqlType = ConvertDotNetToSQLType(row);

strColumns.AppendLine($",[{colName}] {sqlType} NULL");
Expand Down

0 comments on commit c9b134f

Please sign in to comment.