| | |
Quick VB2005 help....how do I get this basic app started?
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
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!
. 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!
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
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.
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.
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!
![]() |
Similar Threads
- quick launch disappears each reboot (xp) (Windows NT / 2000 / XP)
- GUI with calculator. (Python)
- VB3 to .net? (VB.NET)
- Rate my very first VB app (Website Reviews)
- Computer Support (Windows NT / 2000 / XP)
- Running a program before loading Windows Explorer during booting (Visual Basic 4 / 5 / 6)
- Where to begin (IT Professionals' Lounge)
Other Threads in the VB.NET Forum
- Previous Thread: Need help with database linking!
- Next Thread: Exception Data is Null. This method or property cannot be called on Null values.
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic beginner bing browser button buttons center check code combobox crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter forms ftp generatetags hardcopy html images input insert intel internet mobile monitor ms net networking objects open output panel passingparameters pdf picturebox picturebox1 port position printing problem project save searchvb.net select serial settings shutdown soap sqlserver survey tcp temperature text textbox timer timespan toolbox transparency trim update updown user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet view visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





