Visual Basic .NET

How to Cancel Delete in BindingNavigator

Submitted by admin on
When you add a DataSet to your Windows Form a BindingNavigator is automatically created with navigation to your record and it also includes Delete and Add button. When you click the Delete button there is no confirmation if you want to cancel the operation. The solution to this is to set the DeleteItem to None.

Get the ID of Last Inserted Record in SQL Server

Submitted by admin on

Sometimes you need to know the value of your Primary Key when you insert record in your table. This is true if you have a Master/Detail form and you need to know the Primary key value of the parent table so that you can insert rows in the related table.

Consider the following scenario:

Sample Invoice with Master/Detail Form

Submitted by admin on
In this sample you’ll learn on how to save record programmatically using VB.NET. A DataGridView is used to save record in the related table. You will also learn on how to get the last value of the primary key in order to save the related record. This is a very simple program that can be used to expand your knowledge on database programming. I am using SQL Server Express 2008 for my database

Number Only in TextBox

Submitted by admin on
After receiving a lot of emails about how to filter keys that accepts only number character, I decided to post this simple code to illustrate on how easy it is to allow only numbers and other character like comma (,), Period (.) and Backspace key. So far this is the best code that filters character on a textbox. There are lots of codes on the internet but some don’t allow backspace and a comma