Quick VB2005 help....how do I get this basic app started?

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2005
Posts: 33
Reputation: edmicman is an unknown quantity at this point 
Solved Threads: 0
edmicman's Avatar
edmicman edmicman is offline Offline
Light Poster

Quick VB2005 help....how do I get this basic app started?

 
0
  #1
Feb 4th, 2006
I'm working on a side project/consulting job for my former employer...basically I want to recreate an app I did in VB6 using VB2005. It's a simple app, but it was built when I was less experienced, and while I've got the business logic, I'm having troubles getting to a point where I can actually start working with the business logic . Anyway.....can anyone point me to a tutorial or something or give some pointers on where to start to do the following?

I want the app to start, prompt for a username and password, then try and connect to a SQL Server db using that username and password. If it successfully connects, I want to then display the main form, otherwise I want to quit the app (probably with some feedback or something).

What I have envisioned, which I've started but am stuck, is loading the Main form first, and from that, calling a Login form. The Login form then tries to connect to the db, and if successful, returns back to the Main form, with the db connection info. If it won't connect, then the Login form closes and the Main form closes.

Right now I'm just trying to get one form to call the other and open and close based on the logic above (but without the db check) and am stuck.

Additionally, I'd like to eventually have the DB servername and database name in a app.config file, but I haven't even got that far as to figure out how to do that. I'm pretty comfortable with ASP.NET and C#, but I haven't worked with VB at all in awhile, let alone a windows forms app. Any help, please? Thanks!
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 275
Reputation: f1 fan is an unknown quantity at this point 
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Quick VB2005 help....how do I get this basic app started?

 
0
  #2
Feb 9th, 2006
They are pretty similar. Rule 1 of logins though.. never present anything to a user until authenticated so dont call your main form and then the login form.
In your app startup you could load (but not show) the main form. I prefer to use the MVC pattern and so i instantiate a controller... the constructor of the controller initializes the login and db connection. If login is successful then the controller will create the main form and away we go. If login is not successful then show a message box (or give them a couple of goes at it) and then close it all down. As you havent hit Application.Run yet the app will shutdown smoothly.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 33
Reputation: edmicman is an unknown quantity at this point 
Solved Threads: 0
edmicman's Avatar
edmicman edmicman is offline Offline
Light Poster

Re: Quick VB2005 help....how do I get this basic app started?

 
0
  #3
Feb 9th, 2006
Thank you for the reply! It's starting to come back to me, and that's pretty much how I set things up - the login form starts, tries to connect, and if successful it loads the main form, otherwise it gives an error message. WOohoo! I just got a couple of books from Amazon today, and am excited about digging into those soon, too. Thanks again!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC