By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,286 Members | 2,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,286 IT Pros & Developers. It's quick & easy.

Example codes with VB.NET working with XML doc required

P: n/a
Hi,

I'm studying for 70-306 using the book "MCAD/MCSD Visual Basic .NET
Windows Applications" published by McGraw Hill (ISBN: 0-07-212583-7).

I found the book has no programming exercise provided about how VB.NET
work with XML documents (certification objective 15.02). I'm now
searching for some example source codes to assist my study.

Could anyone also suggest me some useful online study resources ?

Tks!

Nov 21 '05 #1
Share this Question
Share on Google+
19 Replies


P: n/a
I recommend starting here:

http://samples.gotdotnet.com/quickst...viewofXML.aspx

This quickstart walks you through the main XML concepts.
"lonelyplanet" wrote:
Hi,

I'm studying for 70-306 using the book "MCAD/MCSD Visual Basic .NET
Windows Applications" published by McGraw Hill (ISBN: 0-07-212583-7).

I found the book has no programming exercise provided about how VB.NET
work with XML documents (certification objective 15.02). I'm now
searching for some example source codes to assist my study.

Could anyone also suggest me some useful online study resources ?

Tks!

Nov 21 '05 #2

P: n/a
Scott Swigart 寫道:
I recommend starting here:

http://samples.gotdotnet.com/quickst...viewofXML.aspx

This quickstart walks you through the main XML concepts.


Tks Scott,

I found one source code at below link showing how to Read XML from a
file.

http://samples.gotdotnet.com/quickst...eadXmlFile.src
From the source code, I expected the .vb file should be compiled as a

console application so I tried to compile it with vbc.exe.

Before calling vbc.exe. I ran below .bat file, too

path "d:\program files\microsoft visual studio .net\frameworksdk\bin";
"d:\windows\microsoft.net\framework\v1.0.3705" %PATH%

However, as I executed below command at DOS prompt, below error
messages was printed out:

================================================== ========

Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.

vbc : error BC30420: 'Sub Main' was not found in 'ReadXmlFileSample'.
D:\VB\XMLDoc\ReadXmlFile.vb(4) : error BC30466: Namespace or type 'Xml'
for the Imports 'System.Xml' cannot be found.

Imports System.Xml
~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(20) : error BC30002: Type 'XmlTextReader'
is not defined.

Dim reader as XmlTextReader = nothing
~~~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(25) : error BC30002: Type 'XmlTextReader'
is not defined.

reader = new XmlTextReader (args)
~~~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(49) : error BC30002: Type 'XmlTextReader'
is not defined.

private shared Sub FormatXml (reader as XmlTextReader, filename as
String)
~~~~~~~~~~~~~

D:\VB\XMLDoc\ReadXmlFile.vb(58) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.XmlDeclaration:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(62) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.ProcessingInstruction:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(66) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.DocumentType:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(70) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Comment:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(74) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Element:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(81) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Text:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(85) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Whitespace:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(106) : error BC30002: Type 'XmlTextReader'
is not defined.

private shared Sub Format(byref reader as XmlTextReader , nodeType
as String)
~~~~~~~~~~~~~


What have I missed ? Do I call vbc correctly ?

Nov 21 '05 #3

P: n/a
I sent you an e-mail with a Visual Studio project that will compile.

"lonelyplanet" wrote:
Scott Swigart 寫道:
I recommend starting here:

http://samples.gotdotnet.com/quickst...viewofXML.aspx

This quickstart walks you through the main XML concepts.


Tks Scott,

I found one source code at below link showing how to Read XML from a
file.

http://samples.gotdotnet.com/quickst...eadXmlFile.src
From the source code, I expected the .vb file should be compiled as a

console application so I tried to compile it with vbc.exe.

Before calling vbc.exe. I ran below .bat file, too

path "d:\program files\microsoft visual studio .net\frameworksdk\bin";
"d:\windows\microsoft.net\framework\v1.0.3705" %PATH%

However, as I executed below command at DOS prompt, below error
messages was printed out:

================================================== ========

Microsoft (R) Visual Basic .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.00.3705
Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.

vbc : error BC30420: 'Sub Main' was not found in 'ReadXmlFileSample'.
D:\VB\XMLDoc\ReadXmlFile.vb(4) : error BC30466: Namespace or type 'Xml'
for the Imports 'System.Xml' cannot be found.

Imports System.Xml
~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(20) : error BC30002: Type 'XmlTextReader'
is not defined.

Dim reader as XmlTextReader = nothing
~~~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(25) : error BC30002: Type 'XmlTextReader'
is not defined.

reader = new XmlTextReader (args)
~~~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(49) : error BC30002: Type 'XmlTextReader'
is not defined.

private shared Sub FormatXml (reader as XmlTextReader, filename as
String)
~~~~~~~~~~~~~

D:\VB\XMLDoc\ReadXmlFile.vb(58) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.XmlDeclaration:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(62) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.ProcessingInstruction:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(66) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.DocumentType:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(70) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Comment:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(74) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Element:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(81) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Text:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(85) : error BC30451: Name 'XmlNodeType' is
not declared.

case XmlNodeType.Whitespace:
~~~~~~~~~~~
D:\VB\XMLDoc\ReadXmlFile.vb(106) : error BC30002: Type 'XmlTextReader'
is not defined.

private shared Sub Format(byref reader as XmlTextReader , nodeType
as String)
~~~~~~~~~~~~~
What have I missed ? Do I call vbc correctly ?

Nov 21 '05 #4

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #5

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #6

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #7

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #8

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #9

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #10

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #11

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #12

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #13

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #14

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #15

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #16

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #17

P: n/a

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #18

P: n/a
Sent.

"lonelyplanet" wrote:

Scott Swigart 寫道:
I sent you an e-mail with a Visual Studio project that will compile.


Scott,

Tks for your help but lo*************@my-deja.com is no longer
reachable as I know my-deja.com no longer exists after google.com
appears.

Could you send the e-mail to lo**************@yahoo.com again please
(note: it's "9999", 4 "9" after word lonelyplanet) ?

Thank You Very Much :)

Nov 21 '05 #19

P: n/a

Scott Swigart 寫道:
Sent.


Scott,

I'm sorry to seek your help again. My Visual Studio NET couldn't read
your sent .sln file again. Probably your Studio NET is more updated
than mine --- I clicked on your supplied ConsoleApplication2.exe. An
error message popped up
"D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msco rwks.dll could not be
loaded. I checked directory D:\WINDOWS\Microsoft.NET\Framework and
found subdirectory "v1.0.3705" only.

Could I solve the problem on my side ? Is using the same version of
Studio .NET as you the only solution ?

FYI, I'm using Visual Studio .NET enterprise architect Version 2002.

Microsoft Development Environment 2002 Version 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705.

Tks:)

Nov 21 '05 #20

This discussion thread is closed

Replies have been disabled for this discussion.