LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert .net datatable datatype to labview array of strings

Is there a better way to convert a dotNet datatable datatype to an array of strings?

Message Edited by darloc on 05-09-2007 11:43 AM

0 Kudos
Message 1 of 7
(4,258 Views)
There's no built-in method to do this, as far as I know, but you might be able to eliminate the inner loop by using the DataRow's "ItemArray" property to get all the row's values.

Also, you don't need to use a shift register to generate your 2D array of strings. Use auto-indexing on the for-loop.

Message Edited by smercurio_fc on 05-09-2007 11:59 AM

0 Kudos
Message 2 of 7
(4,248 Views)

I have a related problem where ToString converts the Unicode Source String to ASCII. nVarChar becomes VarChar.

 

Any Idea how to override the ToString Method to return proper datatype?

0 Kudos
Message 3 of 7
(2,990 Views)

Can you please clarify what you are doing and what problems you are seeing?  What ToString method are you using?

 

Something to keep in mind, Unicode is not really supported in LabVIEW, so this is probably why you are seeing problems with it.  Check out this neat little community document for some pointers on using Unicode in LabVIEW.

 

Finally, I might suggest creating a new thread for this.  The thread you replied to is > 3 years old and not as likely to get responses from others on the forums as a new thread, especially since its a very loosely related problem.

0 Kudos
Message 4 of 7
(2,975 Views)

Has a newer method of reading the .NET DataTable class emerged by now? I am developing a SOAP webservice client. The flat table approach above works on my tables, but sure seems like a workaround to me.

0 Kudos
Message 5 of 7
(2,401 Views)

Hi aartjan!

 

My name is Peter and I am in the Applications Engineering Department at NI.

Unfortunately, there isn't a newer (and better) method of reading the DataTable class than the one mentioned above.

You are welcome to offer this as a suggestion to our developers at our Idea Exchange forum to request this to be added in future releases of LabVIEW.

Peter E
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(2,384 Views)

Thanks. I needed to know. Isn't it so that SOAP webservices are always built with .NET and pretty much always yield this datatable datatype?

0 Kudos
Message 7 of 7
(2,368 Views)