views:

49

answers:

1

A while ago, I wrote a program that outputs any localhost or network database to a series of protobuf-net marked up template generated classes that I then use for all my communications architecture for my web services.

I want to put this application available online for myself so I don't have to run it locally on my machine any more, and so that eventually my colleagues can make use of it in the future too.

I'm pretty certain I can port over all my existing winforms code to ASP.Net with no issues, but I need a way of telling my dll the structure of the database.

Now, there's obviously no way that my application can talk back to the user's machine to read from their SQL Server, so what options are available for my users to pass their database details to my application?

The only idea I've got so far is for the user to script the database out, copy and paste it into a textbox, and then write a parsing engine to go through the scripts and build up the classes from the passed script.

I'm aware this may be conceived as on the cusp of programming related or not, but I need the opinion of a developer as to how they would perceive this working.

+1  A: 

So opening a connection and reading from your users' system tables is out?

How sophisticated are your users? You could write a script to output the system catalogs to XML, ask your users to run it, and consume it that way. Probably easier than parsing DDL statements, but YMMV.

Peter
I suppose I could read the users IP address and then ask them for the instance name (if any) of their SQL server, but that relies on them exposing their instance to the outside world. I like the script to XML idea. You're right, it'd be far easier than parsing the entire script.
GenericTypeTea