Click here to Skip to main content
15,799,257 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all,

I get a lot of web site assignments in C# to go through, using connections to various flavours of the MS Sql database types (Sql Server, Express, CE, etc). For my basic-level students, setting up Sql server (any edition) is tedious work and often problematic.

I'm thinking that there must be an alternative. For testing, and for low-traffic web sites, I'm thinking of saving tables and their data as XML files (or the like), which could be saved with the project. However, these files should not be connected to via an XMLDataSource, but via an equivalent to the regular SqlDataSource, only that this new datasource translates to and fro an XML document.

In other words, what I am looking for is a way to create, update, delete, and read from tables and sql queries as usual, only that everything is stored as text files (possibly in XML format). This would really help when teaching and also grading assignments (or so I hope). Regardless whether this idea sounds stupid or not, I wonder if anyone knows if there already exists applications or Visual Studio add-ons for this kind of feature, and if not, if this "realtime translator" would at all be possible to code and include in Visual Studio.

Love to all,


1 solution

"Setting up" Sql Server CE can be as simple as providing the DLLs, so I'd recommend that first.

Might it be possible to wrap an XMLDataSource in an SqlDataSource? (I've never used one.)

I would not try to implement a full SQL engine, but I suppose a small subset could be implemented in a weekend -- with VS or otherwise. It could be educational.

I suspect you'd have to master XPath in order to implement WHERE clauses.
Share this answer
petter2012 23-Mar-13 14:41pm    
Hi, Thanks for your reply. Yes, I think as well that this could be done rather quickly (for educational purposes only). What I'd like to be able to do is to, say, display news and perhaps select something from table A where the ID = the ID in another table.

I'm still thinking on how to implement the engine. I guess I could write a class in C# which simply parses the XML-ish text, and hook up methods to the ten (or so) most commonly used SQL statements. Rather interesting, really! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900