Duration: 21 minutes
Summary: In this video, we are continuing the discussion of the inventory windows application. The first thing the user sees when running the application is the credentials form. User needs to provide valid username/password in order to proceed to the main form. When the user enters the credentials, they are validated against the database. So in this part then, we need to concentrate on creating the SQL statement, connection, command, and reader and being able to validate the user. We have the connection string already available in app.config. So we read the connection, create the SQL statement and execute the command. If the credentials are not valid, then we give the user an error message and ask him/her to try again. If the credentials are valid, then we proceed to the main form. You can add a feature that gives the user three attempts to login. If the attempts are not successful, you can exit the application. This is left as an exercise.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: Windows Application and Visual Studio 2010
Keyword: Visual Studio 2010, Application, SqlCommand, SqlConnection, SqlDataReader, ConfigurationManager, Show, ConnectionString, MessageBox, try-catch-finally.