Duration: 16 minutes
Summary: In some cases, the user might need to delete an item from the inventory (maybe this item was added by mistake and needs to be removed). To do so, we added a menu item to do just that. When the user clicks on that option, he/she will be warned that the selected item from the list will be permanently deleted. If the user selects "yes", the item is deleted from the database. As we did with the add and update item, we will fill the dataset, invalidate the grid and refresh it to reflect the removed item. One option that can be implemented is that the delete menu will be hidden from standard users and shown to managers if you need to support the rule that only managers can delete items.
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, EventArgs, SelectedRows, DialogResult, MessageBox, MessageBoxButtons, SqlCommand, SqlConnection, ConfigurationManager, ExecuteNonQuery, Fill, Connection, Invalidate, Refresh, Exception.