LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a NULL string into a .net method

Solved!
Go to solution

Hey everyone,

 

grafik.png

 I am trying to use this method, and it wants a NULL to query all.

grafik.png

What do I wire into workspaceName? Empty String ("") does not work, just a constant with no characters inside does not work. Creating a byte array with 0 and converting to string does not work. With "does not work" i mean i get an empty array of workspaces, just like when i enter a notexisting workspaceName. I do not get an exception.

 

The method is working when entering an existing "workspaceName" into the input.

 

Thx in advance

0 Kudos
Message 1 of 5
(4,024 Views)
Solution
Accepted by topic author Tesla1977

Hi,

 

you cannot send a NULL with LabVIEW directly. If you absolutely need that you would have to create a wrapper DLL, that sends the NULL and you call the wrapper DLL instead of the original .NET DLL.

 

Best regards,
Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
Message 2 of 5
(3,966 Views)

OK, thanks for the answer. As this is an absolute standard .net method from Microsoft, can this be implemented into LV or does any internal data handling prevent that entirely?

0 Kudos
Message 3 of 5
(3,947 Views)

For future use or other users:

 

With System.String (in mscorlib) there is the static property "empty" which works perfectly.

 

 

Message 4 of 5
(3,927 Views)

If it is for database related, you can try with "DB Tools Null" function (Connectivity->Database->Advanced).

Thanks,

Sanad MM

0 Kudos
Message 5 of 5
(2,669 Views)