Monday, March 12, 2012

Requesting a attribute + registering info when availible

I'm working with VB.NET. I have three questions an i hope somone will answer.
I want to reguest this pice ## IC25N040ATMR04-0 ## How can i do that?
<Hard_disks>
<primary_disk size="40007761920"
sernum="MRG257K2EBGTUH">IC25N040ATMR04-0</primary_disk>
<disk name="C:" sys="Ntfs" size="10.0 Gb" freePr="23.5" free="2.35 Gb" />
<disk name="D:" sys="Ntfs" size="28.1 Gb" freePr="32.7" free="9.21 Gb" />
</Hard_disks>
I have tried to do it like this just like otherones i have don but this one
is different. I don't know how to do it?!!!
'-- Harddisk Informatie
node = XMLDocument.SelectSingleNode("report/Hard_disks")
AttrNode = node.Attributes.GetNamedItem("primary_disk")
strGrootte = AttrNode.Value
MsgBox(strSerienummer)
Exit Sub
i get a debug massage that says:
An unhandled exception of type 'System.NullReferenceException' occurred in
WindowsApplication5.exe
Additional information: De objectverwijzing is niet op een exemplaar van een
object ingesteld.
what should i do ? can you show me?
Second Question: image you have this as a XML file:
<Hard_disks>
<primary_disk size="30733516800" sernum="N40W3BRC">Maxtor
33073H4</primary_disk>
<disk name="C:" sys="Ntfs" size="5.00 Gb" freePr="47.6" free="2.38 Gb" />
<disk name="D:" sys="Ntfs" size="12.0 Gb" freePr="26.7" free="3.20 Gb" />
<disk name="E:" sys="Fat32" size="12.3 Gb" freePr="3.3" free="408.9 Mb" />
<secondary_disk size="1083801600" sernum="WD-WM3531743957">WDC
AC21000H</secondary_disk>
<disk name="F:" sys="Fat" size="1.03 Gb" freePr="11.3" free="116.4 Mb" />
</Hard_disks>
How can i make it so that when there is a second HD that it will registere
it and when is not there it don't? Somebody a clue
nodeList = XMLDocument.SelectNodes("/report/ juiste info /juiste info")
For i = 0 To nodeList.Count - 1
node = nodeList.Item(i)
Third Question is:
When i have more than one table where i want to insert information, what is
the correct way to do it. I can insert one table with more values but i can't
insert more table i get a syntaxis wrong!!
this is my SQL line:
strSQL = "INSERT INTO software, operatings (naam, versie, grootte,
datum),(os) VALUES ('" & strNaam & "','" & strVersie & "','" & strGrootte &
"','" & StrDatum & "'),('" & strNaam & "',)"
Beginner Programmer!
Your best bet would be to ask this question in the VB.Net newsgroups.
This newsgroup is for SQL Server XML questions.
Bryant

No comments:

Post a Comment