4
Reply

Moving from gui created database objects to code based (Newbie)

Glenn Welker

Glenn Welker

Dec 7 2009 8:19 AM
2.7k
Simple question... I hope.

I have a local database, in this case, SQLite that has been bound to a dataviewgrid. All works fine in this case.

My question is: How do I migrate this solution to more of a code based solution. My finished project will have user specific databases.

So the database schema will be the same as the current local database, the only thing that will change is the location of the database which I intend to put in the users appdata area.
So, I believe the only thing I need to do, is change the connection and this is where I run into questions. The connection string seems to be stored in the settings file and this value is read only.

What I have done to this point, is create a new connection to my desired location and then have set the tableadapter.connection with this connection in the initialize method of my class. This just doesn't seem very scalable.

Can anyone recommend a best practice for doing this?

Answers (4)