Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows forms VB 2008 Linq Question

Status
Not open for further replies.

aalmeida

MIS
Joined
Aug 31, 2000
Messages
468
Location
US
I'm building this WF app and am trying to insert new data to my table (tbl_registro) but am not able to commit the insert to the database. I'm using a local database file (SQLExpress). This insert seems to stay in memory until I close the debug but it does not make into the database.
Here is the insert code:
Code:
Try
                ' create a new Regitro record since the Registro ID
                ' does not exist
                Dim Registro As Table(Of tbl_registros) = Accessor.GetRegistroTable()

                Dim reg As New tbl_registros With { _
                .numero = numero, _
                .emitente = emitente, _
                .cpf = cpf, _
                .marca = marca, _
                .modelo = modelo, _
                .serie = serie, _
                .motor = motor, _
                .ano = ano}

                ' add the new Registro to the database
                Registro.InsertOnSubmit(reg)
                Registro.Context.SubmitChanges()

            Catch ex As Exception
                Throw ex
            End Try


AL Almeida
CIO
May all those that come behind us, find us faithful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top