From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(5,954 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
(5,944 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
(4,686 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
(4,671 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.

------------------------------------------------------------------------------------
Seriously concerned about the Labview subscription model
0 Kudos
Message 5 of 7
(4,097 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
(4,080 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?

------------------------------------------------------------------------------------
Seriously concerned about the Labview subscription model
0 Kudos
Message 7 of 7
(4,064 Views)