Hi,
I googled and searched in the newsgroup, but still can't find a way to
follow, can't find any example!
I'd love to use xml as a little database for my c# app, just having 2 tables
and a few records, and I also want to do this as a "proof of concept".
What I want to do is just use select, insert into and update sql statements
on it.
I know I have to use datasets, but I can't start, because the documentation
explains the single functions but not the overview of the exact topic, so I
can't even guess how to start.
Just need a few lines of code.
Let's say i have an xml like
<person>
<name>Matteo</name>
<aka>mdm</aka>
</person>
<person>
<name>John</name>
<aka>jj</aka>
</person>
I'd love to just do a sort of "UPDATE PERSON SET AKA='JJ2' WHERE
NAME='john'"
and "INSERT INTO PERSON VALUES('Elwood', 'eb')"
Is this possible? Am I missing something, or, well, What am I missing?
Thanks for every clue.
--
Matteo Cima,
Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
Dotnet, C# (Csharp) and Compact Framework Expert
Digisoft srl Italy
msn: matteodellamontagna_hotmail_com (you know what to do with those
underscores, don't you?) 4 1285
Matteo,
You aren't going to be able to do this. The reason is that manipulation
of an XML document typically requires a DOM. Also, there is no standard
mapping between SQL and XML either which will allow this kind of lnaguage
construct. Finally, there you would need a query engine which would process
this sort of thing (there is XQuery, but AFAIK, it is only for queries).
I would recommend loading the XML in a data set, and then modifying the
data set, or even modifying the XML through the DOM.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Matteo Cima" <mdm.list is_the_username @digisoft.it is_the_domain> wrote in
message news:OE**************@tk2msftngp13.phx.gbl... Hi, I googled and searched in the newsgroup, but still can't find a way to follow, can't find any example! I'd love to use xml as a little database for my c# app, just having 2
tables and a few records, and I also want to do this as a "proof of concept". What I want to do is just use select, insert into and update sql
statements on it. I know I have to use datasets, but I can't start, because the
documentation explains the single functions but not the overview of the exact topic, so
I can't even guess how to start. Just need a few lines of code.
Let's say i have an xml like
<person> <name>Matteo</name> <aka>mdm</aka> </person> <person> <name>John</name> <aka>jj</aka> </person>
I'd love to just do a sort of "UPDATE PERSON SET AKA='JJ2' WHERE NAME='john'" and "INSERT INTO PERSON VALUES('Elwood', 'eb')"
Is this possible? Am I missing something, or, well, What am I missing?
Thanks for every clue.
-- Matteo Cima, Senior Developer, Mobile Expert, Project Manager, Lead Analyst, Dotnet, C# (Csharp) and Compact Framework Expert Digisoft srl Italy msn: matteodellamontagna_hotmail_com (you know what to do with those underscores, don't you?)
Hi,
You cannot use SQL statements directly on a dataset.
You have to use the methods provded by ADO.NET to Add/Delete/Update
records in a Dataset.
Regards
Benny
Matteo Cima wrote: Hi, I googled and searched in the newsgroup, but still can't find a way to follow, can't find any example! I'd love to use xml as a little database for my c# app, just having 2 tables and a few records, and I also want to do this as a "proof of concept". What I want to do is just use select, insert into and update sql statements on it. I know I have to use datasets, but I can't start, because the documentation explains the single functions but not the overview of the exact topic, so I can't even guess how to start. Just need a few lines of code.
Let's say i have an xml like
<person> <name>Matteo</name> <aka>mdm</aka> </person> <person> <name>John</name> <aka>jj</aka> </person>
I'd love to just do a sort of "UPDATE PERSON SET AKA='JJ2' WHERE NAME='john'" and "INSERT INTO PERSON VALUES('Elwood', 'eb')"
Is this possible? Am I missing something, or, well, What am I missing?
Thanks for every clue.
Where to start with datasets:
A dataset is basically a collection of tables, which you can access
through the Tables property, so "CREATE TABLE KUKU" is
ds.Tables.Add("Kuku"). You'll need to add columns to its Columns property.
"UPDATE PERSON SET AKA='JJ2' WHERE NAME='john'" becomes something like
foreach(DataRow dr in ds.Tables["PERSON"].Select("NAME='john'")
dr["AKA"]="JJ2";
"INSERT INTO PERSON VALUES('Elwood', 'eb')" becomes something like
DataRow dr = ds.Tables["PERSON"].NewRow();
dr["NAME"]="Elwood";
dr["AKA"]= "eb";
ds.Tables["PERSON"].Rows.Add(dr);
I hope this puts some of the pieces in place, enough to continue through
MSDN.
Uri
Matteo Cima wrote: Hi, I googled and searched in the newsgroup, but still can't find a way to follow, can't find any example! I'd love to use xml as a little database for my c# app, just having 2 tables and a few records, and I also want to do this as a "proof of concept". What I want to do is just use select, insert into and update sql statements on it. I know I have to use datasets, but I can't start, because the documentation explains the single functions but not the overview of the exact topic, so I can't even guess how to start. Just need a few lines of code.
Let's say i have an xml like
<person> <name>Matteo</name> <aka>mdm</aka> </person> <person> <name>John</name> <aka>jj</aka> </person>
I'd love to just do a sort of "UPDATE PERSON SET AKA='JJ2' WHERE NAME='john'" and "INSERT INTO PERSON VALUES('Elwood', 'eb')"
Is this possible? Am I missing something, or, well, What am I missing?
Thanks for every clue.
Thank you all!
Matteo
"Uri Dor" <ta****@newsgroups.nospam> ha scritto nel messaggio
news:e1**************@TK2MSFTNGP10.phx.gbl... Where to start with datasets: A dataset is basically a collection of tables, which you can access through the Tables property, so "CREATE TABLE KUKU" is ds.Tables.Add("Kuku"). You'll need to add columns to its Columns property.
"UPDATE PERSON SET AKA='JJ2' WHERE NAME='john'" becomes something like foreach(DataRow dr in ds.Tables["PERSON"].Select("NAME='john'") dr["AKA"]="JJ2";
"INSERT INTO PERSON VALUES('Elwood', 'eb')" becomes something like DataRow dr = ds.Tables["PERSON"].NewRow(); dr["NAME"]="Elwood"; dr["AKA"]= "eb"; ds.Tables["PERSON"].Rows.Add(dr);
I hope this puts some of the pieces in place, enough to continue through MSDN.
Uri
Matteo Cima wrote: Hi, I googled and searched in the newsgroup, but still can't find a way to follow, can't find any example! I'd love to use xml as a little database for my c# app, just having 2
tables and a few records, and I also want to do this as a "proof of concept". What I want to do is just use select, insert into and update sql
statements on it. I know I have to use datasets, but I can't start, because the
documentation explains the single functions but not the overview of the exact topic,
so I can't even guess how to start. Just need a few lines of code.
Let's say i have an xml like
<person> <name>Matteo</name> <aka>mdm</aka> </person> <person> <name>John</name> <aka>jj</aka> </person>
I'd love to just do a sort of "UPDATE PERSON SET AKA='JJ2' WHERE NAME='john'" and "INSERT INTO PERSON VALUES('Elwood', 'eb')"
Is this possible? Am I missing something, or, well, What am I missing?
Thanks for every clue. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Cherrish Vaidiyan |
last post by:
sir,
The following are the steps that i followed in setting up standby
database on Red hat Linux 9. i am using Oracle 9i.
i have followed the steps in this site :
...
|
by: Marvin Libson |
last post by:
Hi All:
I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I
have created a java UDF and trigger. When I update my database I get
the following error:
SQL1224N A database...
|
by: Kamlesh |
last post by:
Hi,
How do I know the physical database path of a database. When I goto
the DB2INSTANCE users's directory (/home/db2inst1), I see following
folders:
/db2inst1/NODE0000/SQL00001...
|
by: pintur |
last post by:
The message is:
SQL1036C Errore di I/O durante l' accesso al
database. SQLSTATE=58030
what is the proble?
what for restore tables?
thanks
|
by: josh.kuo |
last post by:
Sorry about the subject, I can't think of a better one.
I recently wrote some PHP classes that I think might be of interest to
this group. Since I have been reaping the benefits of reading news...
|
by: morleyc |
last post by:
Hi, until recently i was quite happy to add data sources from mssql
database in visual studio and drag the datasets directly onto the form
this creating a directly editable form which worked well....
|
by: Jack |
last post by:
Training Classes for Oracle10g, 9i, 8i
Certification training in Oracle10g and 9i: DBA, Developer,
Discoverer. training conducted at your location worldwide. Courseware
licensing also available....
|
by: Winder |
last post by:
Training Classes for Oracle10g, 9i, 8i
Certification training in Oracle10g and 9i: DBA, Developer,
Discoverer. training conducted at your location worldwide. Courseware
licensing also available....
|
by: Laurynn |
last post by:
# (ebook - pdf) - programming - mysql - php database applicati
# (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal
Report
# (ebook-pdf) E F Codd - Extending the Database Relational...
|
by: Peter Duniho |
last post by:
Is there a straightfoward API in .NET that allows for inspection of a
database? That is, to look at the structure of the database, without
knowing anything in advance about it? For example,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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...
|
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...
|
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: 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...
|
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...
| |