Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / January 2005

Tip: Looking for answers? Try searching our database.

Display XML file to a Datagrid?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ish2000 - 28 Jan 2005 11:17 GMT
Hello,

Is it possible to display an existing xml file in a datagrid?

Thanks
Ken Tucker [MVP] - 28 Jan 2005 11:59 GMT
Hi,

       Try something like this.

Dim ds As New DataSet

ds.ReadXml("C:\temp.xml")

DataGrid1.DataSource = ds.Tables(0)

Ken

-----------------------------

Hello,

Is it possible to display an existing xml file in a datagrid?

Thanks
Ish2000 - 29 Jan 2005 21:51 GMT
Hi Ken,

Thanks for you prompt reply, how would i display the same xml file is a
textbox?

Thanks....

> Hi,
>
[quoted text clipped - 15 lines]
>
> Thanks
Ken Tucker [MVP] - 30 Jan 2005 12:08 GMT
Hi,

       Try something like this.

With TextBox1

.Text = ds.GetXml

.Multiline = True

.ScrollBars = ScrollBars.Both

.Height = 200

End With

Ken

--------------------------------

Hi Ken,

Thanks for you prompt reply, how would i display the same xml file is a
textbox?

Thanks....

"Ken Tucker [MVP]" wrote:

> Hi,
>
[quoted text clipped - 15 lines]
>
> Thanks
Ish2000 - 31 Jan 2005 21:29 GMT
Hi Ken,

Thanks, that worked.........

Regards,

Ish.....

> Hi,
>
[quoted text clipped - 44 lines]
> >
> > Thanks
Cor Ligthert - 28 Jan 2005 12:00 GMT
Ish,

That depends of that XML file is a dataset (Or has the same format, that is
easy to see, when there are attributes it is not a normal dataset has only
elements).

Cor
Cor Ligthert - 28 Jan 2005 12:11 GMT
Funny sentence, it can be readed as I not intended.

> That depends of that XML file is a dataset (Or has the same format, that
> is easy to see, when there are attributes it is not a normal dataset has
> only elements).

when there are attributes it is not. A normal dataset has only elements.
Ish2000 - 29 Jan 2005 21:25 GMT
Hi Cor,

I really don't get what you are trying to say.  I am very new to the .Net
environment.

Ish....

> Ish,
>
[quoted text clipped - 3 lines]
>
> Cor
Cor Ligthert - 30 Jan 2005 07:51 GMT
Ish,

Telling that a file is a xml file is says not much, the way that it is used
tells more.

One of the formats is the dataset. When the code from Ken shows your XML
file in a datagrid than it is a dataset.

Than you can use databinding.

textbox1.DataBindings.Add(New Binding("Text", dataset1.Tables(0),
"LastName"))

I hope this helps?

Cor

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.