LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the data array from SQL Server Database?

Hi,
I can write a data array(2D)into a table of my SQL Server Database. The data array was writen to a column with image type. I know a data array is transformed a binary string when writing into database, but I dont know how to get the data array when I fetch the binary string from database.

My question is:
How to transform the binary string into data array? which vi's should I use? I have tried unflatten from string but failed.

Any response is appriciated.

Red
0 Kudos
Message 1 of 3
(3,082 Views)
If you are using the Database Connectivity Toolkit, you should look at the Database Variant To Data function and the examples/manual that come with the toolkit. Otherwise, it really depends upon how you wrote the data to the database.
Message 2 of 3
(3,082 Views)
happyxh0518 wrote:

> I can write a data array(2D)into a table of my SQL Server Database.
> The data array was writen to a column with image type. I know a data
> array is transformed a binary string when writing into database, but I
> dont know how to get the data array when I fetch the binary string
> from database.
>
> My question is:
> How to transform the binary string into data array? which vi's should
> I use? I have tried unflatten from string but failed.

In order to use Unflatten from string you first need to Flatten it
before writing it. Also depending on the database driver, the returned
data may actually not be binary but Hexadecimal encoded ASCII which you
would first have to decode to binray.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 3 of 3
(3,082 Views)