944,198 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 3319
  • VB.NET RSS
Feb 4th, 2006
0

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

Expand Post »
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!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
edmicman is offline Offline
33 posts
since Oct 2005
Feb 9th, 2006
0

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

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.
Reputation Points: 26
Solved Threads: 11
Posting Whiz in Training
f1 fan is offline Offline
275 posts
since Jan 2006
Feb 9th, 2006
0

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

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!
Reputation Points: 10
Solved Threads: 0
Light Poster
edmicman is offline Offline
33 posts
since Oct 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Need help with database linking!
Next Thread in VB.NET Forum Timeline: Exception Data is Null. This method or property cannot be called on Null values.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC