473,412 Members | 3,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Display XML file to a Datagrid?

Hello,

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

Thanks
Nov 21 '05 #1
11 1501
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
Nov 21 '05 #2
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
Nov 21 '05 #3
Hi,

Try something like this.

Dim ds As New DataSet

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

DataGrid1.DataSource = ds.Tables(0)

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Hello,

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

Thanks
Nov 21 '05 #4
Hi,

Try something like this.

Dim ds As New DataSet

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

DataGrid1.DataSource = ds.Tables(0)

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Hello,

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

Thanks
Nov 21 '05 #5
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.

Nov 21 '05 #6
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.

Nov 21 '05 #7
Hi Cor,

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

Ish....

"Cor Ligthert" wrote:
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

Nov 21 '05 #8
Hi Ken,

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

Thanks....

"Ken Tucker [MVP]" wrote:
Hi,

Try something like this.

Dim ds As New DataSet

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

DataGrid1.DataSource = ds.Tables(0)

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Hello,

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

Thanks

Nov 21 '05 #9
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
Nov 21 '05 #10
Hi,

Try something like this.

With TextBox1

..Text = ds.GetXml

..Multiline = True

..ScrollBars = ScrollBars.Both

..Height = 200

End With

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
Hi Ken,

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

Thanks....

"Ken Tucker [MVP]" wrote:
Hi,

Try something like this.

Dim ds As New DataSet

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

DataGrid1.DataSource = ds.Tables(0)

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Hello,

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

Thanks

Nov 21 '05 #11
Hi Ken,

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

Regards,

Ish.....

"Ken Tucker [MVP]" wrote:
Hi,

Try something like this.

With TextBox1

..Text = ds.GetXml

..Multiline = True

..ScrollBars = ScrollBars.Both

..Height = 200

End With

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
Hi Ken,

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

Thanks....

"Ken Tucker [MVP]" wrote:
Hi,

Try something like this.

Dim ds As New DataSet

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

DataGrid1.DataSource = ds.Tables(0)

Ken

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

"Ish2000" <Is*****@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
Hello,

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

Thanks


Nov 21 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
1
by: Paul Wilson | last post by:
How do i display the list of files in a particular directory (only the file name), in a grid or similar control, with hyperlinks to be able to download those files. Regards, Paul
4
by: bep | last post by:
Hello What is the best way to sort an XmlDocument for display in a DataGrig? I can use Xpath with an XpathExpression, and a XpathNavigator. But this XpathNavigator object is of no use to me, I...
1
by: The Colonel | last post by:
I have a database of our company's HTML email templates - name, subject, etc. Well, some are for HTML emails, and the template_text column contains HTML. When I display in a datagrid, it REALLY...
6
by: Leszek | last post by:
I wrote an aspx page. It shows datagrid with values: server | parameter --------------------- server1 | parameter1 server1 | parameter2 server1 | parameter3 server1 | parameter4 server1...
0
by: DC Gringo | last post by:
I am trying to output simply DataGrid of a coutry listing on a web form via a business object and XML web service...I receive no errors but no table HTML either. (I know the service and business...
2
by: hazz | last post by:
With this code, the config file(listed below) opens initially into the datagrid display with only a plus sign '+'. On clicking that, it becomes expanded to; - appsettings add When I click on...
2
by: harry | last post by:
Hi all, I have a datagrid (language C#) populated using a stored procedure. I want one of the column to display complete name instead of abbreviation. Can I change the display dynamically in the...
2
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.