Commit d7b6e85c authored by Medicean's avatar Medicean Committed by Medicean

(Fix: Core/PSWindows/Database): 修正数据库类型转换错误

parent dafb7a30
...@@ -83,7 +83,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -83,7 +83,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
} }
while($reader.Read()){ while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){ for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetString($i))), $columnsep)|Out-Null; if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
} }
$sb.Append($rowsep)|Out-Null; $sb.Append($rowsep)|Out-Null;
} }
......
...@@ -85,7 +85,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -85,7 +85,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
} }
while($reader.Read()){ while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){ for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetString($i))), $columnsep)|Out-Null; if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
} }
$sb.Append($rowsep)|Out-Null; $sb.Append($rowsep)|Out-Null;
} }
......
...@@ -85,7 +85,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -85,7 +85,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
} }
while($reader.Read()){ while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){ for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetString($i))), $columnsep)|Out-Null; if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
} }
$sb.Append($rowsep)|Out-Null; $sb.Append($rowsep)|Out-Null;
} }
......
...@@ -85,7 +85,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -85,7 +85,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
} }
while($reader.Read()){ while($reader.Read()){
for($i=0; $i -lt $reader.FieldCount; $i++){ for($i=0; $i -lt $reader.FieldCount; $i++){
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetString($i))), $columnsep)|Out-Null; if($reader.IsDBNull($i)){
$sb.AppendFormat('TlVMTA=={0}', $columnsep)|Out-Null;
}else{
$sb.AppendFormat('{0}{1}',[System.Convert]::ToBase64String([System.Text.Encoding]::Default.GetBytes($reader.GetValue($i).ToString())), $columnsep)|Out-Null;
}
} }
$sb.Append($rowsep)|Out-Null; $sb.Append($rowsep)|Out-Null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment