Click here to Skip to main content
13,046,773 members (40,873 online)
Rate this:
Please Sign up or sign in to vote.
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,

Posted 22-Mar-13 13:03pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

"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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100