Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

General questions about databinding, form design in Dot Net 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
B. Chernick - 19 Jun 2007 19:42 GMT
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.)
Kevin Spencer - 20 Jun 2007 12:32 GMT
If, by "identical" you mean the structure of the database, you should have
no problem with this approach.

Signature

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

> I've just been assigned my first Winforms development project in Dot Net
> 2.0.
[quoted text clipped - 29 lines]
> on
> startup.)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.