8. Use the ExecuteNonQuery() method to run the INSERT SQL statement that has no return value.
If you want a return value use ExecuteScalar() instead.
A good example of ExecuteScalar is to get the Identity column after inserting record(ExecuteScalar returns the first column of the first row from the result).
Full sample source code of inserting record to SQL Database:
Dim con As New SqlConnection 'Define variable con as a new SQL Server Connection
Dim cmd As New SqlCommand 'Define variable cmd as a new SQL Server Command
Try 'Used for Error Logging - Try/Catch
con.ConnectionString = "Data Source=examplesource;Initial Catalog=Example;Persist Security Info=True;User ID=admin;Password=admin" 'Sets the properties of the connection string
con.Open() 'Invokes the server connection to Open
cmd.Connection = con 'The Connection Used for the SQL Command
cmd.CommandText = "INSERT INTO ExampleTable([field1], [field2]) VALUES([Value1], [Value2])" 'Sets The Command Text To An Insert Query
Catch ex As Exception ' If there's an error, catch it!
MsgBox("Error while inserting record on table..." & ex.Message, "Insert Records") 'Displays a Message Box popup to the user notifying them of an error (if any)
con.Close() 'Close the SQL connection (Well you wouldn't leave your car door open when you get out of it would you?)