Duration: 21 minutes
Summary: In this video, we will continue the development of the Windows Inventory Application. After validating the user input in the previous video, we are now ready to insert the data into the database. The user enters the necessary information. We validate one more time that the information (code, color…) is provided. Now we create out statement (sql), connection, and command to do the work. The statement is formatted with the insert command. We set the command with the statement and connection and finally execute the command. We need to validate the affected record is only one (since we are inserting one item at a time). We then fill the dataset of the grid with the latest information. Finally, we invalidate and refresh the grid to show the latest item we have inserted. We have the option of clearing out the data entered in the form so the user can easily enter a new item.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: Windows Applications and Visual Studio 2010
Keyword: Visual Studio 2010, Windows Controls, MessageBox, Show, SelectedIndex, SqlCommand, ConfigurationManager, SqlConnection, Open, Close, Fill, Invalidate, Refresh, Exception.