General questions about databinding, form design in Dot Net 2.0

G

Guest

I've just been assigned my first Winforms development project in Dot Net 2.0.
It is a given in my current company that any Winforms program will have to
easily shift between multiple identical servers. I would like to design this
to take maximum advantage of VS2005's design features. I am probably not as
familiar with them as I would like to be.

To this end I have created a no-brainer demo program using the pubs authors
table and the DataViewGrid (i.e. create a datasource and drag it on the
form).

Assuming that, I have created 2 buttons on the form.
Button1's code:
Me.AuthorsTableAdapter.Connection.ConnectionString = "Data
Source=(local);Initial Catalog=pubs;Integrated Security=True"
Me.AuthorsTableAdapter.Fill(Me.PubsDataSet.authors)

Button2's code:
Me.AuthorsTableAdapter.Connection.ConnectionString = "Data
Source=SomeOtherServerName;Initial Catalog=pubs;Integrated Security=True"
Me.AuthorsTableAdapter.Fill(Me.PubsDataSet.authors)

This seems to do exactly what I need. I can shift between the 2 servers and
edit either without trouble. Are there any 'booby traps' in this approach
that I might be overlooking? (In the actual project I will probably have to
include some code to get connection strings from an external config file on
startup.)
 
K

Kevin Spencer

If, by "identical" you mean the structure of the database, you should have
no problem with this approach.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top