LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Dataset

Solved!
Go to solution

Hi all,

 

Can anyone tell me how to pull the data from a `Table` within a `Dataset` in .NET (System.Data(4.0.0.0))

 

I can see the data is loaded into the dataset but can`t find a method or property to retrieve it.

 

Thanks.

0 Kudos
Message 1 of 11
(4,990 Views)

Post what you have. Will save everyone precious minutes... 

0 Kudos
Message 2 of 11
(4,970 Views)

Hello wiebe@CARYA,

 

I`ve attached the VI. Its from Labview 2017 64bit.

 

Also, I have just had a bit of success. You will see in the code that i've managed to output the data to an xml file, at least I can see the data now...

 

Just don`t want to save out to file then read back in .....

Message 3 of 11
(4,958 Views)

Hello Nick an Wiebe,

 

Here is example code I am currently working on. It retrieves all information stored in a DataTable that came from an SQL query.

 

LabVIEW_2018-10-09_10-42-31.png

This code is working, however it's work in progress. I am currently installing a new MySQL server to be able to wireshark the connection to verify it is actually doing exactly what I am expecting.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Message 4 of 11
(4,938 Views)

Hmm. IIRC, the ADO .NET  API returns a DbDataReader object, or at least that's what I'm using. So I don't get (or didn't use) a dataset object. So I can't provide a dataset solution OOTB.

 

I went through some effort to avoid the conversion to string. I convert to variants, so the binary data stays valid. This is a huge benefit, as it avoids all those problems with quotes in strings, "," or "." and resolution in floats, and formatting of data\time data. Now we have .vims the VIs will eventually get a type input, so the To Variant phase can be skipped, and the data is returned\entered as intended.

Message 5 of 11
(4,933 Views)

Hi Ingo,

 

Looks very promising, I was originally looking at using Datasets and tables to pull the data in a decoupled fashion for my system. I only ever read data for configuration at start of test, this does not change during test, so i`m not too concerned with having a live data stream. At the end of test the results are collated and passed back to the database in one write.

 

I will also try to use the dataset in my application. Its going to be interesting to update the dataset if required.

 

Cheers,

 

Nick

 

0 Kudos
Message 6 of 11
(4,931 Views)