473,486 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Import XML in SQLCE table

Hello,

I'm looking for a generic way to import XML documents into a local
SQLCE database (on Pocket PC).

To complicate, the local SQLCE database has more fields in the tables
than the XML document has nodes, and I would like to have a generic
tool (I need to import about 35 tables).

I'm trying something below:

// Create a local dataset from the XML file
DataSet ds = new DataSet();
ds.ReadXml("customer.xml");
ds.Tables[0].TableName = "CUSTOMER";

// Create a data adapter
SqlCeDataAdapter da = new SqlCeDataAdapter("SELECT * FROM CUSTOMER",
m_con);

// And the command builder
SqlCeCommandBuilder cb = new SqlCeCommandBuilder(da);
da.InsertCommand = cb.GetInsertCommand();
da.Update(ds, "CUSTOMER");

The problem that I have above, is that the DataAdapter has too many
rows for the provided data, and the XML document is not imported
(Missing SourceTable mapping), but to be honest, I'm not very sure
whether this is good code...

Any help for this junior programmer is greatly appriciated...

Cheers,
Locusta

Nov 20 '05 #1
0 2354

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

Similar topics

2
3100
by: Paul Aspinall | last post by:
Hi Does anyone know if SQLHelper (Application Blocks) for SQLCE is available? Thanks
4
2703
by: Enver A | last post by:
Hey ppl, I am having trouble in building a smart device application. I cant create a table on SQLCE server using this line. Anyone can tell me what the problem is? I am able to create another 3...
0
3477
by: Rod | last post by:
I orginally posted this to microsoft.public.sqlserver.ce but had not received any responses. I have a CF.NET application (C#) with a SqlCE database. We had originally planned to use SQL...
5
4738
by: Titeuf | last post by:
ok I start programming mobile application with VB.NET (VS 2005) I am interested work with Sqlce Also I look for add reference in my project I search "System.Data.SqlServerCe" but not found....
0
1079
by: jamie | last post by:
I'm sure this is probably really easy and I'm just not knowing the correct thing to search on to find it. I have a SQLCE database and I need to get the data out of it into an XML file that...
0
3876
by: Johnny | last post by:
I have a PocketPC mobile application that gets its data from the Sql Server database via a web service. The web service returns a dataset that I need to load into the SqlCe database on the mobile...
0
1118
by: drgoon | last post by:
I have a mobile app using sqlce 2.0 connecting to an sql 2000 server db. I am able to push, pull and execute sql statements no problem. I would like to be able to "sniff" messages and data going...
0
1063
by: dariosalvi78 | last post by:
Hi, I am trying to use MyGeneration with a SQLCe database in the Compact Framework 2 environment. My first problem now is that MyGeneration (its latest version) has no template for the SqlCe...
0
2910
by: dipalipatel | last post by:
Hi, I have a very hard time to insert Image into Sqlce Database. Table : Test Column : mypic Datatype : image below the code while i am inserting
0
7094
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
7173
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...
1
6839
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
7305
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
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.