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
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