Fixed correct value types when saving columns to a json file (#691)

This commit is contained in:
AlexFsmn
2018-09-25 23:24:39 +02:00
committed by Karl Burtram
parent d31ce985ce
commit 41d0ef1814
3 changed files with 104 additions and 1 deletions

View File

@@ -70,7 +70,17 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
}
else
{
jsonWriter.WriteValue(row[i].DisplayValue);
// Try converting to column type
try
{
var value = Convert.ChangeType(row[i].DisplayValue, columns[i].DataType);
jsonWriter.WriteValue(value);
}
// Default column type as string
catch
{
jsonWriter.WriteValue(row[i].DisplayValue);
}
}
}