Mohamad Alhamoud
Mohamad Alhamoud

Reputation: 4929

Working with Database using LINQ to XML

I am Working on a project (C#) in the university and they said that we can't use a DBMS like SQL Server so we decide to use Linq and XML...we learned some basics in Linq to Xml But really we don't know how we can create tables and fields and work with them in Xml.any suggestions ?

Upvotes: 1

Views: 558

Answers (3)

Henk Holterman
Henk Holterman

Reputation: 273711

If you really want to use tables, you can create a Typed DataSet and Save/Load it as (proprietary) XML.

A DataSet can hold multiple tables + relations between them.

Upvotes: 1

SLaks
SLaks

Reputation: 888107

The simplest option would be a Typed Dataset saved to an XML file. (With or without LINQ)

You would use it just like an RDBMS, but it isn't an RDMS, so it should be allowed.

Upvotes: 3

Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 121047

If it's a single user application you can just create a serializable class and use that to store your data. Then when your app is closed the data class is serialized (binarily) to a file, and when the app starts it reads the file and all your data is still there.

Here is a simple example from the docs.

Upvotes: 2

Related Questions