Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# Database Development - Flexibility plus simplicity?

Status
Not open for further replies.

fweeee

Programmer
Jul 5, 2007
3
AU
Before I ask my question, I will give a little background. I am an experienced developer in a 4GL (which you have probably never heard of). Within this environment there are 2 key features (which are important now)
1) The user is free to choose the SQL server/database they wish to connect to at run time.
2) The development environment is integrated with the SQL backend, so that all tables/fields are available for dragging and dropping in the development environment.

I am starting a C# database application project, and I am finding that it is difficult to replicate this kind of environment in C# (Visual C#).
1) It is possible to soft code the database details (have the user select them), but then most of the drag-and-drop type tools for database access are not available.
2) Visual C# does have tools (drag-and-drop type) to make accessing data easier, but it seems to use these, I have to define the connection at design time.

Is there some way I can have the best of both worlds in C#? User definable connections and easy development? None of the books I have been reading even hint that this might be possible. Maybe I have been reading the wrong books...

Thanks.
 
usually Db connections are stored in the config file. I suppose you can list all the connections in there and let the user choose which one they want. You will have an issue with adding new connections to the config, as whenever you make any changes ot the config, it's likely that the application will reset itself, by loading a modified config.

Or alternatively you have a master database that can store the connection strings, so you can list them out and let users add new ones, and create the new connections to the dbase according to the connection string chosen..

just an idea, not sure if it what you were looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top