Hello.
Developing a web site in VS2005, SP1, VB, .NET 2.0, ASP.NET 2.0 on XP Pro,
SP2.
I eventually want to use a gridview table to view xml data, but right now i
can't seem to get my xml data into a dataset so that i can use it.
I have an XML file and can open it in IE. There is no XSD or XSL file to go
with it.
I can't seem to get the XML data into a dataset. I tried using the
following code, but it just does nothing. It doesn't give an error. It
just executes the code and does nothing.
Dim dataSet As DataSet = New DataSet
dataSet.ReadXml("c:\Trips.xml", XmlReadMode.Auto)
I tried the XmlReadMode.InferSchema, XmlReadMode.InferTypedSchema and
XmlReadMode.ReadSchema options.
Any help would be gratefully appreciated.
Thanks,
Tony 7 15099
Your code should be
dataSet.ReadXml(@"c:\Trips.xml", XmlReadMode.Auto)
to account for the slash in the path.
Besides this, the same code works for me. I tested by printing
dataSet.GetXml()
Hello Latish.
My program will not compile with the "@" in there. It says "Character is
not valid".
If i put the "@" inside the quotes like "@C:\Trips.xml", when it runs, it
gives a System.NotSupportedException {"The given path's format is not
supported."}.
Thanks,
Tony
"Latish Sehgal" <la***********@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
Your code should be
dataSet.ReadXml(@"c:\Trips.xml", XmlReadMode.Auto)
to account for the slash in the path.
Besides this, the same code works for me. I tested by printing
dataSet.GetXml()
Sorry about that. Its a C# thing, i didn't realize it.
Have you tried copying the value of dataSet.GetXml() to a string and
checking the value?
Well. Sure enough. The xml data is there. Maybe i need to do something
with the dataset after the ReadXml statement.
Maybe i'm misinterpreting the ReadXML function. Is it supposed to create a
table(s) in the dataset based on what it reads from the xml file?
Thanks,
Tony
"Latish Sehgal" <la***********@gmail.comwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
Sorry about that. Its a C# thing, i didn't realize it.
Have you tried copying the value of dataSet.GetXml() to a string and
checking the value?
Hello Latish.
I tried that sample. It doesn't give any errors, but it doesn't do
anything. It just executes the code.
Also, what is "Console.WriteLine" supposed to do? Where does it write the
output?
I looked in the Output, Immediate, Command and every other window. I can't
find the output.
Thanks,
Tony
"Latish Sehgal" <la***********@gmail.comwrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
It should, but it probably depends on your xml.
Check out http://samples.gotdotnet.com/quickst...apXMLData.aspx
for an example.
Console.WriteLine would work in console apps, you can change it to
Debug.Write() or something for your debugging.
I just pointed out that example so that you can compare it with your
code and see if the tables can be created from the xml in that
example.
Probably you should post your xml here also. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sal |
last post by:
Hello all,
I am working on a project with the following characteristics:
1. Load data from a SQL server table to an xml file
2. Read the xml file into a dataset.
3. Load data from the...
|
by: jaime |
last post by:
1 I load a text file into a dataset, after doing a bit of work..
2 Now I have a dataset full of data that I like to transfer to a data base
3 My problem is that if the rowstate of the row is set to...
|
by: Eric Paul |
last post by:
I have been in search of a better way to handle bulk inserts and
updates into SQL 2000 using c# and while I have found a few different
ways to accomplish this I was wondering what is considered to...
|
by: Peter |
last post by:
I am having a problem reading an Excel file that is XML based. The directory
I am reading contains Excel files that can be of two types. Either generic Microsoft
based or XML based. I am reading...
|
by: ruca |
last post by:
Hi,
Can I read a .TXT File to a DataSet? How can I do that?
I want to read his lines to a DropDownList. This lines are the names of
employees that I export from an application that I have.
I...
|
by: Mits |
last post by:
I am using following connection string to get data from a .csv file using
vb.net
strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" +
System.IO.Path.GetDirectoryName(sFileName) +...
|
by: ntuyen01 |
last post by:
Hi All,
I try to read the data from the excel, but I ran into this problem
I have two excel files.
file one.xls data inside like this:
1234 1234
1234 1234
abc-123 ...
|
by: unsichtbar |
last post by:
Sorry, but I'm pretty new to .NET/XML etc...
I have the current code which I'm trying to output dynamically so it can be read into a flash file. The only issue is, it doesn't seem to actually do...
|
by: Laila2008 |
last post by:
Hi, I'm writing a String containing XML data to my browser. The XML data is well formed and the page opens up correctly but when I try to read this data from another page I get the following error:...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |