LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create .NET DataSet

Hello All,

I'm a total newbie to .NET and .NET through LabVIEW.  I am attempting to insert some firmware revision data into an SQL database through a .NET web service.  I have created a .NET assembly dll and invoked the node for the function that I want, UpdateRevision().  This function has the following input format:

    <UpdateRevision xmlns="http://tempuri.org/">
      <modelnum>string</modelnum>
      <serialnum>string</serialnum>
      <objDS>
        <xsd:schema>schema</xsd:schema>xml</objDS>
      <user>string</user>
    </UpdateRevision>

The XML portion, objDS, should be a table consisting of the 4 column names that I want to store and the data that I want to insert, arranged like this:

MICRO   CPLD   DSP1   DSP2
1.1          2.2        3.3        4.4

I have what I think is working correctly for everything except the XML table, I can't for the life of me figure out how to create this table in the format the the format the .NET assembly wants (XML I think).

I have played around using the "to .NET object.vi" with a "flattten to XML.vi" in front with a table control as an input with no success.  I know this cant be too difficult, I'm just inexperienced to find the answer.  Can anyone throw me a bone?

Thanks,
Adam
0 Kudos
Message 1 of 9
(2,906 Views)
I've been trying to learn up on this, but I'm still falling a little short.  I think that the line:

<objDS>
        <xsd:schema>schema</xsd:schema>xml</objDS>

is looking for an XML schema (XSD) and the xml.  So in other words, it wants me to tell it how to parse the data, then provide the data to parse.  I was given this description by the guy who provided me the web service:

"you'll need to pass the modelnum, and serialnum as strings, followed by a dataset that contains 4 columns titled micro, cpld, dsp1, dsp2, and then finally another string field containing the username"

So, I'm thinking something similar to this would be close to correct:

<ColumnName>Column Contents</ColumnName>

<micro>1.1</micro>
<cpld>2.2</cpld>
<dsp1>3.3</dsp1>
<dsp2>4.4</dsp2>



I think the issue is that I need to define the column names with an xsd, then provide the data in xml.

Anyone?  I want to leave the office today with a little hair left 🙂
0 Kudos
Message 2 of 9
(2,896 Views)
Ok, after alot of reading and more code, I have this attachment.  The LabVIEW web service vi dll seems to be happy with the DataSet that I am feeding it, just not the web service, I get this string returned from the ionService dll:

"Object reference not set to an instance of an object."

I found this MSN article about the message:

http://support.microsoft.com/kb/810098

Does anyone know if this message is truly coming back from the webservice, or from the LabVIEW framework?

Come on guys, I'm learning here, but I sure would love anyone with some experience to step forward with a little advice 😉


0 Kudos
Message 3 of 9
(2,867 Views)
I've never tried what you're doing, but just looking at the code I think your problem is sequencing. You should not call the web service "UpdateRevision" method until after you've populated the dataset. As you have it now, the method gets called with an empty dataset. Use the error clusters to ensure the method gets executed after you've populated the dataset.
0 Kudos
Message 4 of 9
(2,862 Views)


Message Edited by ajckson on 05-22-2008 04:41 PM
Download All
0 Kudos
Message 5 of 9
(2,856 Views)
Yes, that's what I meant. Too bad it didn't make a difference. How did you create the web service DLL? Did you use the procedure discussed here? Do you have a way of verifying that the web server DLL works in a pure .NET environment, such as a C# of VB.NET app?
0 Kudos
Message 6 of 9
(2,847 Views)
I attempted to use this method, but I had some issues with it, I described those here.  I was successful getting some simple services to work with this method, and this is the same method that I used to create my ionService.dll file.

I have not been able to test the service with a .NET or C app, I'm not experienced at all with these.  I have attempted to test the service with this tool, but am unsure of how to correctly pass the DataSet.

Thanks again for your help, maybe I can get one of my .NET coworkers to write me a simple .NET app to poke things in with the WebService to test it.
0 Kudos
Message 7 of 9
(2,843 Views)
I'm pleased to announce that my code is working, the "Object reference not set to an instance of an object." was server side, I passed the DataSet correctly.

This code is working!  DataSet (with Error Flow).PNG

I found the attached NI .NET example very helpful.

It's Miller time!  🙂
0 Kudos
Message 8 of 9
(2,823 Views)
Good to hear you got it working, and you can safely blame IT for your problem. That's always fun. Of course, here at work I am the IT department. Smiley Very Happy
0 Kudos
Message 9 of 9
(2,808 Views)