mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 01:25:40 -05:00
Fixed correct value types when saving columns to a json file (#691)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user