Dim db As New EagleGPSDataContext
Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'*********** LINQ SQL*******************
Dim c As New Customer
c.cus_prename = txtprename.Text.Trim
c.cus_name = txtname.Text.Trim
c.cus_sname = txtsname.Text.Trim
c.cus_address = txtaddress.Text.Trim
c.cus_email = txtemail.Text.Trim
c.cus_tel = txttell.Text.Trim
db.Customers.InsertOnSubmit(c)
db.SubmitChanges()
' Create a new Order object.
Dim ord As New Order With _
{.OrderID = 12000, _
.ShipCity = "Seattle", _
.OrderDate = DateTime.Now}
' Add the new object to the Orders collection.
db.Orders.InsertOnSubmit(ord)
' Submit the change to the database.
Try
db.SubmitChanges()
Catch e As Exception
Console.WriteLine(e)
' Make some adjustments.
' ...
' Try again.
db.SubmitChanges()
End Try