473,396 Members | 1,877 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,396 software developers and data experts.

How to import XML from web into DataTable?

Hi!

My DataSet contains DataTable named as 'CurrencyRates', and it contains
fields: 'Currency' (like 'USD'), 'Rate' (like 1.1983) and 'Updated' (date
when updated). My application contains 'Update Currencies'-button, and
pressing it application should update 'Currencies'- DataTable (or insert if
missing currency) of the link
http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml but how to do this ?
I'm using VB .NET 2003 and Windows Forms Application.

I know basics of the .NET and ADO.NET, but my experience is not good enought
for this - for now I hope :) Probably very useful for many peoples to know.

--
Thanks in advance!

Mika
Nov 20 '05 #1
2 2945
Sorry my writing error earlier, because earlier message (below) contains
mentions about 'CurrencyRates' and 'Currencies' -DataTable. There is only
'CurrencyRates' -DataTable in this case.

"Mika M" <mika.mahonen@nospam_kolumbus.fi> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
Hi!

My DataSet contains DataTable named as 'CurrencyRates', and it contains
fields: 'Currency' (like 'USD'), 'Rate' (like 1.1983) and 'Updated' (date
when updated). My application contains 'Update Currencies'-button, and
pressing it application should update 'Currencies'- DataTable (or insert if missing currency) of the link
http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml but how to do this ? I'm using VB .NET 2003 and Windows Forms Application.

I know basics of the .NET and ADO.NET, but my experience is not good enought for this - for now I hope :) Probably very useful for many peoples to know.
--
Thanks in advance!

Mika

Nov 20 '05 #2
There are different ways to tackle this.Here are some high level ways I can
think of:

1. Create a process that grabs the XML daily and uses the XML features of
SQL Server to insert the data (OPEN XML). You can then run a simple update
command to move the currency rates over into your other table.

2. You can pull the current records into a DataSet and consume it as XML.
You grab the XML from the site and match nodes based on the "currency"
value. It is a simple matter of moving attribute values for the rate from
one XML doc to the other.

Those are two quick methods. A Service to update a table is the quickest. If
you are not using SQL Server, you will have to walk the values and issue
UPDATE commands against the database, but that is not too hard. Performance
should be fine, as you are dealing with a handful of values only.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Mika M" <mika.mahonen@nospam_kolumbus.fi> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
Hi!

My DataSet contains DataTable named as 'CurrencyRates', and it contains
fields: 'Currency' (like 'USD'), 'Rate' (like 1.1983) and 'Updated' (date
when updated). My application contains 'Update Currencies'-button, and
pressing it application should update 'Currencies'- DataTable (or insert if missing currency) of the link
http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml but how to do this ? I'm using VB .NET 2003 and Windows Forms Application.

I know basics of the .NET and ADO.NET, but my experience is not good enought for this - for now I hope :) Probably very useful for many peoples to know.
--
Thanks in advance!

Mika

Nov 20 '05 #3

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

Similar topics

2
by: Eric Caron | last post by:
Hi I try to import file in a dataset. How I can do this ?
4
by: hharry | last post by:
hello all, i have 2 datatables and am trying to transfer rows from datatable a to datatable b i use the datatable.importrow method. the importrow method fails (but does not throw an...
4
by: Rnt6872 | last post by:
I need to import a .csv file into a firebird database. I am able to cnnect tothe databe using: Dim ds1 As New DataSet Dim SQLString As String = "insert into rdstype27...
3
by: vj83 | last post by:
Hi, I have a C#.net application in which i have read the datas from excel sheet and displayed in a datagrid in my Aspx form. The code is here private void Button2_Click(object sender,...
0
by: Anish G | last post by:
I am trying to do Excel Import with Oledb. It is working fine in my local machine. But when i upload it to live server, getting the below given error: E_FAIL(0x80004005) Any help will be...
12
by: joaotsetsemoita | last post by:
Hello everyone, im completly new to vb.net and I was assigned to do a simple piece of software that just had to select from um db in a MS access data base and insert into a SQL server Database....
1
by: Amit | last post by:
Hello , Is there any way i can import data from datagrid to sqlserver. please advise . thanks & Regards
10
by: BostonNole | last post by:
Using Visual Studio 2005, .NET 2.0 and VB.NET: I am looking for the fastest possible way to import a very large fixed width file (over 6 million records and over 1.2 GB file size) into a...
1
by: SteveB | last post by:
Hi All, I am using the SqlBulkCopy for import data into ms sql 2005. I need to import multipe files which could be from 1 to GB each. Is there need to use a garbage collection for this purpose...
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
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
marktang
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,...
0
Oralloy
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,...
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
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.