Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27428

VS 2012 Aplication stops when doing a tableadapter insert

$
0
0
Hi guys, the problem is as follows. My application as to do a log, at all interaction of the user with software. When the aplication runs it should write a log, through a tableadapter insert. but when it reaches that particular line the program pauses and stops. No error, no warning, justs stops. Its possible to «preview data», using the tableadapter, no problem. i've already recreated the all lots (binding source, dataset and tableadapter), and everything is working in theory. the vs ide does warn about any errors or warning's. what is the problem i'm lost?. The database is sql server. and vs is with all updates applied.




Code:

'TODO: This line of code loads data into the 'UcctieDataSet3.Log' table. You can move, or remove it, as needed.
        Me.LogTableAdapter.Fill(Me.UcctieDataSet3.Log)
        'TODO: This line of code loads data into the 'UcctieDataSet3.Log' table. You can move, or remove it, as needed.
        Me.PedidosTableAdapter.Fill(Me.UcctieDataSet.Pedidos)
        'TODO: This line of code loads data into the 'UcctieDataSet.Destacamentos' table. You can move, or remove it, as needed.
        Me.DestacamentosTableAdapter.Fill(Me.UcctieDataSet.Destacamentos)
        'TODO: This line of code loads data into the 'UcctieDataSet.SUBDESTACAMENTOS' table. You can move, or remove it, as needed.
        Me.SUBDESTACAMENTOSTableAdapter.MudarSUBDestacamentos(Me.UcctieDataSet.SUBDESTACAMENTOS, 0)
        'LoginForm2.Show()
        Label11.Text = Me.UcctieDataSet.Pedidos.Count
        Me.PedidosTableAdapter.pendentes(Me.UcctieDataSet.Pedidos)
        Label5.Text = Me.UcctieDataSet.Pedidos.Rows(Me.UcctieDataSet.Pedidos.Count - 1).Item(0)
        Label7.Text = Me.UcctieDataSet.Pedidos.Rows(Me.UcctieDataSet.Pedidos.Count - 1).Item(1)
        Label9.Text = Me.UcctieDataSet.Pedidos.Rows(Me.UcctieDataSet.Pedidos.Count - 1).Item(2)
        Label3.Text = Me.UcctieDataSet.Pedidos.Count
        Me.PedidosTableAdapter.Fill(Me.UcctieDataSet.Pedidos)
        Button4.Enabled = False
        Dim pcad As Collection
        Dim tst As String
        Dim rc As Integer
        Dim filereader As String
        Try
            filereader = My.Computer.FileSystem.ReadAllText("C:\Users\g1960931\Documents\config.txt")
            TestDecoding(filereader)

        Catch ex As Exception
            MsgBox("Erro:- Ficheiro de Configuração corrupto ou inexistente", MsgBoxStyle.Critical)
        End Try
        Dim al As Integer
        al = 1
        pcad = ListAllADComputers()
        rc = pcad.Count

        Do While al <= rc
            tst = Microsoft.VisualBasic.Right(pcad.Item(al), 13)
            Me.DataGridView1.Rows.Add(tst)
            al = al + 1
        Loop
        DataGridView1.Sort(DataGridView1.Columns(0), System.ComponentModel.ListSortDirection.Ascending)
        DataGridView1.Update()
        lerconfig(dcrp)
        'Add a valid EWS service end point here or user Autodiscover
        service.Url = New Uri("https://rnsi.mai.gov.pt/ews/exchange.asm")
        'Add a valid user credentials
        service.Credentials = New WebCredentials(user, password, domain)
        service.UseDefaultCredentials = True
        service.AutodiscoverUrl("almeida.jlcr@gnr.pt")
        'to acess the proxy server
        WebRequest.DefaultWebProxy.Credentials = New NetworkCredential(user, password, domain)
        Label9.Text = My.User.Name

        ComboBox4.SelectedIndex = 0
        ComboBox6.SelectedIndex = 0
        ComboBox7.SelectedIndex = 0
        ComboBox8.SelectedIndex = 0
        ComboBox9.SelectedIndex = 0
        ComboBox10.SelectedIndex = 4
        ComboBox11.SelectedIndex = 4
        ComboBox12.SelectedIndex = 0
        ComboBox13.SelectedIndex = 3
        ComboBox14.SelectedIndex = 0
        ComboBox15.SelectedIndex = 0
        ComboBox17.SelectedIndex = 0
        ComboBox18.SelectedIndex = 0
        DETALHESMAQ = False

        Label75.Text = Date.Now.Year
        Dim usr, dt, mov, hr As String
        Dim cod As String
        cod = Me.UcctieDataSet3.Log.Rows.Count.ToString
        If cod = 0 Then
            cod = 1
        End If
        usr = My.User.Name
        dt = DateTime.Now.ToString("dd/MM/yyyy")
        hr = DateTime.Now.ToString("HH:mm:ss")
        mov = "Utilizador iniciou aplicação"
        Me.LogTableAdapter.Fill(UcctieDataSet3.Log)
        Me.LogTableAdapter.Insert(cod, usr, dt, mov, hr)    / this is the line where it all stops
        Me.LogTableAdapter.Update(UcctieDataSet3.Log)


Viewing all articles
Browse latest Browse all 27428

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>