'Handling SQLite Blob with Powershell
I am trying to copy Data from a SQLite DB via Powershell to another SQLite DB, but i have Problems handling a binary Blob from the Database.
The columns of the DB look like this: ID (int), Alive (int), UID (string), Data (Blob)
In the DB, the Blob is Hexadecimal but when i have in Powershell it is decimal.
This is how i geht the Data:
$conSource = New-Object -TypeName System.Data.SQLite.SQLiteConnection
$conSource.ConnectionString = "Data Source=" + $db_source
$conSource.Open()
$sqlSource = $conSource.CreateCommand()
$sqlSource.CommandText = "SELECT * FROM Players WHERE UID = '" + $player_uid + "'"
$adapterSource = New-Object -TypeName System.Data.SQLite.SQLiteDataAdapter $sqlSource
$dataSource = New-Object System.Data.DataSet
[void]$adapterSource.Fill($dataSource)
$dataSource
$sqlSource.Dispose()
$conSource.Close()
I was able to convert it, but then it becomes a string and I have no idea how to get the hexadecimal string as a blob into the other database (via UPDATE).
Output of $dataSource.Tables.Data.GetType():
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
