.NETGURU
XmlNodeList to DataSet, DataGrid, DataBind, etc.
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdata' list.


Walter Quesada
-- Moved from [aspngfreeforall] to [aspngdata] by Michiel van Otegem <Click here to reveal e-mail address> --

I had such as hard time looking for a good XmlNodeList to DataBind sample that I decided to publish my findings in case anyone runs into the same problem I did, here ya go ;)

Dim xNodeList As XmlNodeList = "Your XmlNodeList Here!"
Dim ds As DataSet = New DataSet()
Dim xReader As XmlTextReader
For x = 0 To xNodeList.Count-1
xReader = New XmlTextReader(xNodeList.item(x).OuterXml, XmlNodeType.Element, new XmlParserContext(Nothing, Nothing, Nothing, XmlSpace.None))
ds.ReadXml(xReader, XmlReadMode.InferSchema)
Next x
DataGrid1.DataSource = ds
DataGrid1.DataBind()

The following "for" loop works as well, it's the first script that actually worked for me, but I think the top one is more efficient, if you think otherwise please advise:

For x = 0 To xNodeList.Count-1
Dim sr1 As StringReader = New StringReader(xNodeList.item(x).OuterXml)
Dim ds1 As DataSet = New DataSet()
ds1.ReadXml(sr1,XmlReadMode.Auto)
ds.Merge(ds1)
Next x

...

Walter

Reply to this message...
 
    
Sachidanandam E K

http://www.fawcette.com/xmlmag/2002_06/magazine/columns/net/

I hope this would help you
Also try Sysyem.data under the url.
http://www.xmlforasp.net/content.aspx?content=codebank&codeType=xml
This might give some pointers.

Cheers!

Sachidanandam.E.K
Member Techinical Staff

HCLT KT-ODC
Click here to reveal e-mail address
<mailto:Click here to reveal e-mail address>

-----Original Message-----
From: Mike Campbell [mailto:Click here to reveal e-mail address]
Sent: Wednesday, July 10, 2002 8:02 PM
To: aspngdata
Subject: [aspngdata] Re: Can't connect to remote SQLServer FROM .NET?

Another nice tool to help you debug this issue is the use of a *.udl.

Right click on your desktop, select new>text document
Change the extension of the document to .udl (you'll need to have the
view file extensions for know file types checked (windows
explorer>tools> folder options > view))

Then, just zip through to the first tab of the new .udl document and
configure the connection as needed and test it...

If you've verified that pc1 is listening on TCP/IP and that your
authentication method is correct, you may need to install a later
version of MDAC on pc2 (a quick way to do this is to just pop in your
sqlserver2k disk and install just the client connection tools... This
will ensure that the client machine can connect to the server -- I've
actually run into this problem before).

HTH,

--Mike

-----Original Message-----
From: John R. O'Brien [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 6:00 PM
To: aspngdata
Subject: [aspngdata] Re: Can't connect to remote SQLServer FROM .NET?

Does the machine ping by name? If not, try the ip as suggested before.

Does the sql server PC1 have tcp/ip sockets enabled for listening? This
is default during install, check the server network utility in the sql
server program group to see what is enabled on the server. If not
enable tcp/ip.

Is the server security set to mixed mode? If not, enable the mixed
mode, check this from the EM properties of the sql server pc1 security
tab.

Is it still unable to connect?

John R. O'Brien
Home 410 352 3614
Cell 443 497 2017
FAX 801 849 7589

-----Original Message-----
From: Tim Curtin [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 7:03 PM
To: aspngdata
Subject: [aspngdata] Re: Can't connect to remote SQLServer FROM .NET?

try the IP of the machine...

[Original message clipped]

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

-

-

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Data.DataSet
System.Data.XmlReadMode
System.IO.StringReader
System.Xml.XmlNodeList
System.Xml.XmlNodeType
System.Xml.XmlParserContext
System.Xml.XmlSpace
System.Xml.XmlTextReader




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification