473,407 Members | 2,315 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,407 software developers and data experts.

Import Excel XML into Dataset

Hi

I'm trying to import some Excel XML into a dataset.
If I use the below code on some standard XML it works fine. If I use
it on XML created from Excel I will get (will xmlread): Specified cast
is not valid.

What do I need to do to my code so it can read Excel XML?

Many thanks

Alex

----->

Dim thisdataset As New DataSet
Dim xmlfilename As String = "filename.xml"
Dim fsReadXml As New System.IO.FileStream _
(xmlfilename, System.IO.FileMode.Open)

Dim myXmlReader As New System.Xml.XmlTextReader(fsReadXml)
thisdataset.ReadXml(myXmlReader)
myXmlReader.Close()
Nov 12 '05 #1
1 3841
Any ideas guys/gals?
I just need a pointer really... many thanks...

Alex

po******@alexshirley.com (Alex Shirley) wrote in message news:<e9**************************@posting.google. com>...
Hi

I'm trying to import some Excel XML into a dataset.
If I use the below code on some standard XML it works fine. If I use
it on XML created from Excel I will get (will xmlread): Specified cast
is not valid.

What do I need to do to my code so it can read Excel XML?

Many thanks

Alex

----->

Dim thisdataset As New DataSet
Dim xmlfilename As String = "filename.xml"
Dim fsReadXml As New System.IO.FileStream _
(xmlfilename, System.IO.FileMode.Open)

Dim myXmlReader As New System.Xml.XmlTextReader(fsReadXml)
thisdataset.ReadXml(myXmlReader)
myXmlReader.Close()

Nov 12 '05 #2

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

Similar topics

3
by: Schultz | last post by:
I would like to know if it is possible to import data from MS Excel 2000 to a dataset using asp.net. The excel file would need to be uploaded to the server from a web page first, before the loaded...
7
by: postings | last post by:
Hi - can you help please? Please review the following straightforward code which works fine with ordinary XML files. ---------------------------------------------------------------- Dim...
0
by: ramnaresh_t yadav via .NET 247 | last post by:
Hi, I am pasting the code to import data from Text/Excel files into Database(Oracle ) Table... I think some one needs this .. they can use.. it... ======================= Dim dsDB As New DataSet...
10
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in...
4
by: jayfeb29 | last post by:
Hi , Any one can guide me in Import the Excel 2002 data into sql server 2000 using ado.net1.1. I have searched all the forums most of the solutions end with a line of suggestion not with any code...
2
by: jainarun | last post by:
Hi All, I have to import the data from MSExcel to Ms Sql Server. First i have created OLEDB Adapter in which i have passed select statement and connection string of MS Excel. Then i...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
1
by: orked | last post by:
i tried to import excel file into gridview but the code made this exception (Failed to map this path''xmlTest.xml") i don't know why my code: public void fillGrid() { DataSet ds =...
4
by: orked | last post by:
i want to import excel file to gridview but there was error(Failed to map this path "/xmltest.xml") and i couldn't handle it my code: public void fillGrid() { DataSet ds = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.