Jump to content

Recommended Posts

Posted

Este código dáme estes erros

Error 2 Type 'viat' is not defined.

Error 4 'SaveChanges' is not a member of 'COMETLIS.BaseDataSet'.

Error 3 'AddObject' is not a member of 'COMETLIS.BaseDataSet.ViatDataTable'.


      Using Context As New BaseDataSet

                

                Dim efect As New viat With
                {
                .Matr = txtMat.Text,
                .IdEsq = CLng(lblIdEsq.Text),
                .Marca = txtMarcaAd.Text,
                .Modelo = txtModeloAd.Text,
                .Combust = lblComb.Text,
                .CartGalp = txtCartGFAd.Text,
                .ValidadeCartGF = txtValAd.Text,
                .IdentiViaVerde = txtViaVerdeAd.Text,
                .UltimaREV = txtUlRevAd.Text,
                .Tipo = lblTipo.Text,
                .Situaç = "Operacional",
                .UltimaInsp = CDate(txtPrInspAd.Text),
                .DataMat = dt
                }

               context.Viat.AddObject(efect)
                context.SaveChanges()
               End Using

A base é em access 2007

Alguem me pode ajudar

Posted

Access? Esse código é normalmente é utilizado quando se trabalha com EntityFramework que não deve ser o caso uma vez que não suporta Access.

Pedro Martins

Não respondo a duvidas por PM

Posted

Se quiseres utilizar esse tipo de código tens de mudar a tua BD para uma base de dados que seja suportada, por exemplo o SQL Server Compact é suportado e funciona totalmente offline sem precisar de um servidor de SQL Server para correr. Agora é contigo.

Pedro Martins

Não respondo a duvidas por PM

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.