Solved

windowsapplication1 has stopped working

Posted on 2014-11-07
14
801 Views
Last Modified: 2014-11-15
Hi,

I'm building an application in vb.net and I've recently started experiencing random crashes in the app, the problem I have is that there's no way to know what's crashing it because the error message is very generic unlike how normally when there's an error in vb.net it specifically goes to the point in the code that crashed it.

I have a MAIN form from which I load other forms from, it's when I open up the other forms that I start to get crashes;
if I bypass the main form and I set one of the other forms as the start up form then I don't get the error anymore, it's something about the main form that causes all the other forms to unexpectedly crash,

I don't understand why these other forms are influenced by the main form, there are a few tables that I query in the main form but I don't see why it would crash all the other forms...

I use the standard code to open the forms :

        newProject.ShowDialog()
        newProject.Dispose()

The error message is a simple : windowsapplication1 has stopped working : A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available

It's impossible to know what's causing it...?
Thank you
0
Comment
Question by:FCapo
  • 7
  • 5
  • 2
14 Comments
 
LVL 32

Accepted Solution

by:
it_saige earned 500 total points
ID: 40428683
To combat the crash, you can add the following into your MainForm so that you can capture these exceptions and either log them or display a message.

Example:
Imports System.ComponentModel
Imports System.Reflection

Public Class Form1
	Public Sub New()
		Try
			AddHandler Application.ThreadException, AddressOf OnThreadException
			AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf OnApplicationUnhandledException
			InitializeComponent()
			' Do some other stuff here
		Catch ex As Exception
			MessageBox.Show(String.Format("Unhandled exception - {0}", ex.Message))
		End Try
	End Sub

	Private Shared Sub OnThreadException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)
		MessageBox.Show(String.Format("{0}: Thread exception reported in {1} - {2} [{3}]", MethodBase.GetCurrentMethod(), e.Exception.Source, e.Exception, e.Exception.Message))
	End Sub

	Private Shared Sub OnApplicationUnhandledException(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
		If e.IsTerminating Then
			MessageBox.Show(String.Format("{0}: Application unhandled exception reported - {1}", MethodBase.GetCurrentMethod(), e.ExceptionObject))
		End If
	End Sub
End Class

Open in new window


After that it's just a matter of locating what is causing the exception.

-saige-
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 40428726
Try getting rid of the Dispose() call:

    newProject.Dispose() ' <--- get rid of it
0
 

Author Comment

by:FCapo
ID: 40428798
It has something to do with how I obtain data from my database, I found that if I try to retrieve data from the database in another form that was retrieved in the startup form, then the program crashes :

On my main form (the startup form), I load data from my database :
    Dim budgetData As ClientsAccess
    Dim budgetdataset As nclMisDataSet
    Dim WithEvents budgetBindingsource As BindingSource
  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        budgetData = New ClientsAccess
        budgetdataset = budgetData.getBudget
        budgetBindingsource = New BindingSource

        With budgetBindingsource
            .DataSource = budgetdataset
            .DataMember = "budget"
        End With
End Sub

Open in new window


In the clientsaccess class file I have :

Public Class ClientsAccess
    Private budgetTableAdapter As nclMisDataSetTableAdapters.budgetTableAdapter
    Private prjDataset As nclMisDataSet
    Public Function getBudget() As nclMisDataSet
        Try
            budgetTableAdapter = New nclMisDataSetTableAdapters.budgetTableAdapter
            prjDataset = New nclMisDataSet
            budgetTableAdapter.Fill(prjDataset.budget)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function

Open in new window

0
 
LVL 32

Expert Comment

by:it_saige
ID: 40428875
The first thing that glares out at me is that you throw an exception but don't have anything that catches it.  You should do this:
Dim budgetData As ClientsAccess
Dim budgetdataset As nclMisDataSet
Dim WithEvents budgetBindingsource As BindingSource
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
	budgetData = New ClientsAccess
	Try
		budgetdataset = budgetData.getBudget
		budgetBindingsource = New BindingSource

		With budgetBindingsource
			.DataSource = budgetdataset
			.DataMember = "budget"
		End With
	Catch ex As Exception
		' Write something to a log or display a message
		MessageBox.Show(String.Format("There was an error binding to the database: {0}", ex.Message))
	End Try
End Sub

Open in new window


Public Class ClientsAccess
	Private budgetTableAdapter As nclMisDataSetTableAdapters.budgetTableAdapter
	Private prjDataset As nclMisDataSet
	Public Function getBudget() As nclMisDataSet
		Try
			budgetTableAdapter = New nclMisDataSetTableAdapters.budgetTableAdapter
			prjDataset = New nclMisDataSet
			budgetTableAdapter.Fill(prjDataset.budget)
			Return prjDataset
		Catch ex As Exception
			Throw ex
		End Try
	End Function
End Class

Open in new window


-saige-
0
 

Author Comment

by:FCapo
ID: 40429065
I've tried putting the Catch ex As Exception but the same message always comes up : windowsapplication1 has stopped working
0
 
LVL 32

Expert Comment

by:it_saige
ID: 40429106
Did you add the initial code I recommended into your main form?

-saige-
0
 

Author Comment

by:FCapo
ID: 40432906
Hi,

Yes I put the Try Catch in the main form and all the other forms, but the app still crashes with the generic message : windowsapplication1 has stopped working

It crashes in my other form with the following code, this piece of code is also in my main form when the app is first launched, it's as if my access database doesn't like me having more than 1 or 2 connections from different forms sequentially

budgetData = New ClientsAccess
budgetdataset = budgetData.getBudget
budgetBindingsource = New BindingSource
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 32

Expert Comment

by:it_saige
ID: 40432920
Could you provide the code for your main form and ClientsAccess?

-saige-
0
 

Author Comment

by:FCapo
ID: 40432966
Yes Of Course,

Form1(Main Form):

'Imports Microsoft.Office.Interop
Imports System
Imports System.IO
Imports System.Net.Mail
Imports System.ComponentModel
Imports System.Reflection

Public Class Form1

    Public selectedId As String
    Public tempName, clientName, contactName, cliDom, cliBureau, cliCell, cliTelFax, cliMail, labelName, cliStreet1, cliStreet2, cliCity, cliProv, cliPost As String

    Dim clientData As Clients
    Dim cliDataSet As simplyDataSet
    Dim WithEvents cliBindingSource As BindingSource

    Dim clientDataExtra As clientsExtra
    Dim clidatasetExtra As simplyDataSet
    Dim WithEvents cliBindingSourceExtra As BindingSource

    Dim prjData As ClientsAccess
    Dim prjDataset As nclMisDataSet
    Dim WithEvents prjBindingSource As BindingSource


    Dim timeData As timesheet
    Dim timeDataSet As NCLDataSet
    Dim WithEvents timeBindingSource As BindingSource

    Dim currentName As Integer
    Dim test As Boolean = False
    Dim suivi As Boolean = False

    Dim rectAccessData As ClientsAccess
    Dim recAccDataSet As nclMisDataSet
    Public WithEvents AccessBindingsource As BindingSource

    Dim budgetData As ClientsAccess
    Dim budgetdataset As nclMisDataSet
    Dim WithEvents budgetBindingsource As BindingSource

    Dim timeData1 As timesheet
    Dim timeDataSet1 As NCLDataSet
    Dim WithEvents timeBindingSource1 As BindingSource

    Dim hoursCompleted As Double = 0
    Dim totalBudgetedHours As Double = 0
    Dim hoursLeft As String
    Dim timeString As String

    Dim clientAccessData As ClientsAccess
    Dim WithEvents cliAccessBindingsource As BindingSource
    Dim cliAccDataSet As nclMisDataSet
    Public Sub New()
        Try
            AddHandler Application.ThreadException, AddressOf OnThreadException
            AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf OnApplicationUnhandledException
            InitializeComponent()
            ' Do some other stuff here
        Catch ex As Exception
            MessageBox.Show(String.Format("Unhandled exception - {0}", ex.Message))
        End Try
    End Sub

    Private Shared Sub OnThreadException(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)
        MessageBox.Show(String.Format("{0}: Thread exception reported in {1} - {2} [{3}]", MethodBase.GetCurrentMethod(), e.Exception.Source, e.Exception, e.Exception.Message))
    End Sub

    Private Shared Sub OnApplicationUnhandledException(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
        If e.IsTerminating Then
            MessageBox.Show(String.Format("{0}: Application unhandled exception reported - {1}", MethodBase.GetCurrentMethod(), e.ExceptionObject))
        End If
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Try
            budgetData = New ClientsAccess
            budgetdataset = budgetData.getBudget
            budgetBindingsource = New BindingSource

            With budgetBindingsource
                .DataSource = budgetdataset
                .DataMember = "budget"
            End With
        Catch ex As Exception
            ' Write something to a log or display a message
            MessageBox.Show(String.Format("There was an error binding to the database: {0}", ex.Message))
        End Try

        clientData = New Clients
        cliDataSet = clientData.getCliDataSet
        cliBindingSource = New BindingSource

        clientDataExtra = New clientsExtra
        clidatasetExtra = clientDataExtra.getCliDataSet
        cliBindingSourceExtra = New BindingSource

        rectAccessData = New ClientsAccess
        recAccDataSet = rectAccessData.getRecDataSet
        AccessBindingsource = New BindingSource

        timeData = New timesheet
        timeDataSet = timeData.getTimesheetHoursDataSet
        timeBindingSource = New BindingSource

        timeData1 = New timesheet
        timeDataSet1 = timeData1.getTimesheetHoursDataSet2
        timeBindingSource1 = New BindingSource

        budgetData = New ClientsAccess
        budgetdataset = budgetData.getBudget
        budgetBindingsource = New BindingSource

        clientAccessData = New ClientsAccess
        cliAccDataSet = clientAccessData.getrelateddata
        cliAccessBindingsource = New BindingSource

        With cliAccessBindingsource
            .DataSource = cliAccDataSet
            .DataMember = "projets"
        End With

        With budgetBindingsource
            .DataSource = budgetdataset
            .DataMember = "budget"
        End With

        With cliBindingSource
            .DataSource = cliDataSet
            .DataMember = "DataTable"
            .Sort = "sName"
        End With

        With timeBindingSource
            .DataSource = timeDataSet
            .DataMember = "FeuillesDeTemps"
            .Sort = "ID"
        End With

        With timeBindingSource1
            .DataSource = timeDataSet1
            .DataMember = "FeuillesDeTemps"
            .Sort = "ID"
        End With

        With AccessBindingsource
            .DataSource = recAccDataSet
            .DataMember = "recevable"
        End With

        With cliBindingSourceExtra
            .DataSource = clidatasetExtra
            .DataMember = "DataTable1"
        End With

        With cliCbx
            .DataSource = cliBindingSource
            .DataBindings.Add("text", cliBindingSource, "sName", False, DataSourceUpdateMode.Never)
            .DisplayMember = "sName"
        End With

        With extraCbx
            .DataSource = cliBindingSourceExtra
            .DataBindings.Add("text", cliBindingSourceExtra, "lCusId", False, DataSourceUpdateMode.Never)
            .DisplayMember = "lCusId"
        End With

        DataGridView1.DataSource = cliBindingSource

        For i = 0 To DataGridView1.Columns.Count - 1
            If i = 1 Then
            Else
                DataGridView1.Columns(i).Visible = False
            End If
        Next

        DataGridView1.Columns(1).HeaderText = "Nom du client"
        DataGridView1.Columns(1).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill

        SimpleId.DataBindings.Add("text", cliBindingSource, "lId")
        cliSimplyExtra.DataBindings.Add("text", cliBindingSourceExtra, "lCusId")

        cliRue1.DataBindings.Add("text", cliBindingSource, "sStreet1")
        cliRue2.DataBindings.Add("text", cliBindingSource, "sStreet2")
        cliVille.DataBindings.Add("text", cliBindingSource, "sCity")
        cliPrv.DataBindings.Add("text", cliBindingSource, "sProvState")
        cliCode.DataBindings.Add("text", cliBindingSource, "sPostalZip")
        cliCourriel.DataBindings.Add("text", cliBindingSource, "sEmail")
        CliTxt.DataBindings.Add("text", cliBindingSource, "sCntcName")
        cliTelBur.DataBindings.Add("text", cliBindingSource, "sPhone1")
        cliTelCell.DataBindings.Add("text", cliBindingSource, "sPhone2")
        cliFax.DataBindings.Add("text", cliBindingSource, "sFax")
        cliTelDom.DataBindings.Add("text", cliBindingSourceExtra, "sUsrDfnd1")

        TextBox1.Select()
        checkpopupsettings()
        startEmailTimer()
        My.Settings.timesheetId = timeDataSet.FeuillesDeTemps.Compute("max(ID)", "")
        checktimersheetTimer()
    End Sub

    Private Sub checktimersheetTimer()

        If My.Settings.recevReminders = "no" Then

        ElseIf My.Settings.recevReminders = "yes" Then

            Timer2.Enabled = True
            Timer2.Interval = 1800000 ' Add these 3 lines of code where ever you want timer to start calling the function 
            Timer2.Start()
        End If


    End Sub


    Private Sub checktimesheets()
        resettimesheets()
        resettimesheets2()
        timeBindingSource.Filter = "ID >'" & My.Settings.timesheetId & "' AND Nom <> 'Carole Beaupre' AND Nom <> 'Pierrette St-Germain'AND Nom <> 'Pierrette St-Germain' AND Nom <> 'Rachid Negaa' AND Nom <> 'Gregory Pereira' AND Nom <> 'Mouloud Boutora' AND Nom <> 'Sylvie Lemieux'"
        If timeBindingSource.Count = 0 Or timeBindingSource.Count = -1 Then
        Else
            For i = 0 To timeBindingSource.Count - 1

                timeBindingSource1.Filter = "Projet ='" & timeBindingSource.Item(i)("Projet").ToString & "'"
                budgetBindingsource.Filter = "prjBudgetID='" & timeBindingSource.Item(i)("Projet").ToString & "'"
                cliAccessBindingsource.Filter = "prjNumber='" & timeBindingSource.Item(i)("Projet").ToString & "'"

                For b = 0 To timeBindingSource1.Count - 1
                    hoursCompleted = hoursCompleted + timeBindingSource1.Item(b)("Heures") + timeBindingSource1.Item(b)("Heures +")
                Next
                If budgetBindingsource.Count = 0 Or budgetBindingsource.Count = -1 Then

                Else
                    totalBudgetedHours = budgetBindingsource.Item(budgetBindingsource.Position)("heuresTotal")
                    If totalBudgetedHours < hoursCompleted Then
                        hoursLeft = "<span style=""background-color: #FFFF00"">Budget passed by: " & hoursCompleted - totalBudgetedHours & " hours</span>"
                    Else
                        hoursLeft = "Budgeted hours available: " & totalBudgetedHours - hoursCompleted
                    End If

                    timeString += _
                        "<h2>" & timeBindingSource.Item(i)("Nom").ToString & "</h2>" & "<b> added </b> : " & _
                        timeBindingSource.Item(i)("Heures").ToString & " hours to the <b>Project</b> : " & timeBindingSource.Item(i)("Projet").ToString & _
                        " <b>Client</b> : " & cliAccessBindingsource.Item(0)("cliName").ToString & "<br>" & _
                        " <b>Contact</b> : " & cliAccessBindingsource.Item(0)("prjContact").ToString & _
                            " <b>Mandat</b> : " & cliAccessBindingsource.Item(0)("Mandats").ToString & "<br>" & _
                             " <b>Lieux des travaux</b> : " & cliAccessBindingsource.Item(0)("prjAddr").ToString & "<br>" & _
                            " <b>Notes</b> : " & timeBindingSource.Item(i)("Description").ToString & "<br>" & "<br>" & _
                        " Total hours completed : " & hoursCompleted & "<br>" & _
                        "Total budgeted hours : " & totalBudgetedHours & "<br>" _
                        & hoursLeft & "<hr>"
                End If

                hoursCompleted = 0
                totalBudgetedHours = 0
                hoursLeft = 0
            Next

            Dim Mail As New MailMessage
            Dim SMTP As New SmtpClient("mail.nclenvirotek.com")

            Mail.Subject = "Project Management"
            Mail.From = New MailAddress("projects@nclenvirotek.com")
            SMTP.Credentials = New System.Net.NetworkCredential("fcapozio@nclenvirotek.com", "capo") '<-- Password Here
            Mail.IsBodyHtml = True
            Mail.To.Add("capoproductions@hotmail.com,plegaultcapozio@nclenvirotek.com,information@nclenvirotek.com") 'I used ByVal here for address
            Mail.Body = "<b>The following employees added new hours to their timesheet:</b> <hr>" & timeString 'Message Here

            ' SMTP.EnableSsl = True
            SMTP.Port = "1025"
            SMTP.Send(Mail)
            My.Settings.timesheetId = timeDataSet.FeuillesDeTemps.Compute("max(ID)", "")
        End If

    End Sub


    Private Sub makeBudgetEmail()

    End Sub

    Dim receivablesString As String
    Private Sub startEmailTimer()
        If My.Settings.recevReminders = "no" Then

        ElseIf My.Settings.recevReminders = "yes" Then

            AccessBindingsource.Filter = "recDateSuivi ='" & Format(Date.Now, "M/d/yyyy") & "'"
            If AccessBindingsource.Count = 0 Or AccessBindingsource.Count = -1 Then

            Else
                sendEmail2()
                emailTimer.Enabled = True
                emailTimer.Interval = 1800000 ' Add these 3 lines of code where ever you want timer to start calling the function 
                emailTimer.Start()
            End If

        End If
    End Sub
    Private Sub sendEmail2()
        '  receivablesString = "<b>The following clients need to be called because a follow-up was scheduled for today :</b>"
        AccessBindingsource.Filter = "recDateSuivi ='" & Format(Date.Now, "M/d/yyyy") & "'"

        If AccessBindingsource.Count = 0 Or AccessBindingsource.Count = -1 Then

        Else
            For i = 0 To AccessBindingsource.Count - 1
                receivablesString += "<b>Client</b> : " & AccessBindingsource.Item(i)("recCliName") & " <b>Amount</b> : $" & AccessBindingsource.Item(i)("recAmount") & "</br>" & "<b> Notes</b> : " & AccessBindingsource.Item(i)("recDescOff").ToString.TrimEnd & "<hr>"
            Next

        End If


        Dim Mail As New MailMessage
        Dim SMTP As New SmtpClient("mail.nclenvirotek.com")

        Mail.Subject = "Accounts Receivable"
        Mail.From = New MailAddress("System@nclenvirotek.com")
        SMTP.Credentials = New System.Net.NetworkCredential("fcapozio@nclenvirotek.com", "capo") '<-- Password Here
        Mail.IsBodyHtml = True
        Mail.To.Add("capoproductions@hotmail.com,information@nclenvirotek.com,plegaultcapozio@nclenvirotek.com") 'I used ByVal here for address
        Mail.Body = "<b>The following clients need to be called because a follow-up was scheduled for today :</b> <hr>" & receivablesString 'Message Here

        ' SMTP.EnableSsl = True
        SMTP.Port = "1025"
        SMTP.Send(Mail)



    End Sub
    Private Sub dothis()

        prjData = New ClientsAccess
        prjDataset = prjData.getPrjAccessDataSet
        prjBindingSource = New BindingSource

        With prjBindingSource
            .DataSource = prjDataset
            .DataMember = "projets"
        End With

        With prjSuiviComboBox
            .DataSource = prjBindingSource
            .DataBindings.Add("text", prjBindingSource, "prjNumber", False, DataSourceUpdateMode.Never)
            .DisplayMember = "prjNumber"
        End With

        EtatDuProjetCbx.DataBindings.Add("text", prjBindingSource, "prjType")
        prjFermeDate.DataBindings.Add("text", prjBindingSource, "prjFerme")
        factAddr.DataBindings.Add("text", prjBindingSource, "prjFactAddr")
        factEtat.DataBindings.Add("text", prjBindingSource, "factEtat")
        factFinal.DataBindings.Add("text", prjBindingSource, "factFinal")
        factPart.DataBindings.Add("text", prjBindingSource, "factPart")
        paiFinal.DataBindings.Add("text", prjBindingSource, "paiFinal")
        paiPart.DataBindings.Add("text", prjBindingSource, "paiPart")
        prjSuiviRem.DataBindings.Add("text", prjBindingSource, "prjRemarque")

        prjBindingSource.Filter = "cliId ='" & SimpleId.Text & "'"



    End Sub
    Private Sub checkpopupsettings()

        If My.Settings.recevReminders = "no" Then
            NotifyIcon1.Visible = False
        ElseIf My.Settings.recevReminders = "yes" Then
            AccessBindingsource.Filter = "recDateSuivi ='" & Format(Date.Now, "M/d/yyyy") & "'"
            If AccessBindingsource.Count = 0 Or AccessBindingsource.Count = -1 Then
            Else
                NotifyIcon1.Visible = True
                Timer1.Enabled = True
                Timer1.Interval = 30000 ' Add these 3 lines of code where ever you want timer to start calling the function 
                Timer1.Start()
            End If
        End If

    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        projectManagement.ShowDialog()
        projectManagement.Dispose()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        selectedId = SimpleId.Text
        contactName = CliTxt.Text
        cliDom = cliTelDom.Text
        cliBureau = cliTelBur.Text
        cliCell = cliTelCell.Text
        cliTelFax = cliFax.Text
        cliMail = cliCourriel.Text
        cliStreet1 = cliRue1.Text
        cliStreet2 = cliRue2.Text
        cliCity = cliVille.Text
        cliProv = cliPrv.Text
        cliPost = cliCode.Text
        clientName = cliCbx.Text

        If cliPrv.Text = "" Then
            tempName = cliCbx.Text & "" & vbCrLf & cliRue1.Text & vbCrLf & cliVille.Text
        Else
            tempName = cliCbx.Text & "" & vbCrLf & cliRue1.Text & vbCrLf & cliVille.Text & " (" & cliPrv.Text & ")" & " " & cliCode.Text
        End If

        labelName = cliRue1.Text & cliRue2.Text & "," & cliVille.Text

        newProject.ShowDialog()
        newProject.Dispose()
        If suivi = True Then
            resetEverything()
        Else
            dothis()
            suivi = True
        End If

    End Sub

    Private Sub SimpleId_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleId.TextChanged

        extraCbx.Text = SimpleId.Text
        Try
            prjBindingSource.Filter = "cliId ='" & SimpleId.Text & "'"
        Catch
        End Try

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Me.Validate()
        prjBindingSource.EndEdit()
        prjData.savePrjAccessDataset(prjDataset)
        MsgBox("Changements Sauvegardé!")
    End Sub



    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        selectedId = SimpleId.Text
        contactName = CliTxt.Text
        cliDom = cliTelDom.Text
        cliBureau = cliTelBur.Text
        cliCell = cliTelCell.Text
        cliTelFax = cliFax.Text
        cliMail = cliCourriel.Text
        cliStreet1 = cliRue1.Text
        cliStreet2 = cliRue2.Text
        cliCity = cliVille.Text
        cliProv = cliPrv.Text
        cliPost = cliCode.Text
        clientName = cliCbx.Text
        approbation.ShowDialog()
        approbation.Dispose()

    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        listeDesDossiers.ShowDialog()
        listeDesDossiers.Dispose()
    End Sub

    Private Sub resetEverything()
        Me.Validate()
        prjBindingSource.EndEdit()
        prjDataset = prjData.getPrjAccessDataSet
        prjBindingSource.DataSource = prjDataset
    End Sub
    Private Sub resettimesheets()
        Me.Validate()
        timeBindingSource.EndEdit()
        timeDataSet = timeData.getTimesheetHoursDataSet
        timeBindingSource.DataSource = timeDataSet

    End Sub
    Private Sub resettimesheets2()
        Me.Validate()
        timeBindingSource1.EndEdit()
        timeDataSet1 = timeData1.getTimesheetHoursDataSet
        timeBindingSource1.DataSource = timeDataSet1

    End Sub

    Private Sub resetRecevables()
        Me.Validate()
        AccessBindingsource.EndEdit()
        recAccDataSet = rectAccessData.getRecDataSet
        AccessBindingsource.DataSource = recAccDataSet

    End Sub
    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Try
            Shell("Explorer.exe " & prjBindingSource.Item(prjBindingSource.Position)(50).ToString & "\" & prjBindingSource.Item(prjBindingSource.Position)(49).ToString, vbNormalFocus)

        Catch
            MsgBox("Aucun répertoire associé à ce projet")
        End Try

    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        currentName = cliCbx.SelectedIndex
        Me.Validate()
        cliBindingSource.EndEdit()
        cliDataSet = clientData.getCliDataSet
        cliBindingSource.DataSource = cliDataSet
        cliCbx.SelectedIndex = currentName

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        cliBindingSource.Filter = "sName like '%" + TextBox1.Text.Trim() + "%'"
    End Sub

    Private Sub DataGridView1_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentDoubleClick
        Button2.PerformClick()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        recevNew.ShowDialog()
        recevNew.Dispose()
        resetRecevables()
        checkpopupsettings()
    End Sub


    Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged

        If TabControl1.SelectedIndex = 1 Then
            If suivi = True Then
            Else
                dothis()
                suivi = True
            End If
        End If
    End Sub

    Dim intCnt As Integer
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        NotifyIcon1.Icon = SystemIcons.Error
        NotifyIcon1.BalloonTipTitle = "URGENT: ACCOUNTS RECEIVABLE FOLLOW-UP"
        If AccessBindingsource.Count = 1 Then
            NotifyIcon1.BalloonTipText = "there is " & AccessBindingsource.Count & " client scheduled today that needs to be called, click here for more information"

        Else
            NotifyIcon1.BalloonTipText = "there are " & AccessBindingsource.Count & " clients scheduled today that need to be called, click here for more information"

        End If

        NotifyIcon1.BalloonTipIcon = ToolTipIcon.Error
        NotifyIcon1.ShowBalloonTip(20000)

        ' task

    End Sub

    Private Sub NotifyIcon1_BalloonTipClicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.BalloonTipClicked
        Timer1.Stop()
        NotifyIcon1.Visible = False
        recevNew.ShowDialog()
        resetRecevables()
        checkpopupsettings()
        recevNew.Dispose()

    End Sub

    Private Sub emailTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles emailTimer.Tick
        sendEmail2()
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        checktimesheets()
    End Sub
End Class

Open in new window

ClientsAccess:
Public Class ClientsAccess

    Private clientNameTableAdapter As nclMisDataSetTableAdapters.clientsTableAdapter
    Private prjAccessTableAdapter As nclMisDataSetTableAdapters.projetsTableAdapter
    Private approTableAdapter As nclMisDataSetTableAdapters.approbationTableAdapter
    Private extraTableAdapter As nclMisDataSetTableAdapters.extraTableAdapter
    Private recTableAdapter As nclMisDataSetTableAdapters.recevableTableAdapter
    Private budgetTableAdapter As nclMisDataSetTableAdapters.budgetTableAdapter
    Private budgetDesignTableAdapter As nclMisDataSetTableAdapters.budgetDesignTableAdapter
    Private controleTableAdapter As nclMisDataSetTableAdapters.controleTableAdapter


    Private prjDataset As nclMisDataSet
    Private prjDataset2 As nclMisDataSet
    Private prjDataTable As DataTable

    Public Function getControle() As nclMisDataSet
        Try
            controleTableAdapter = New nclMisDataSetTableAdapters.controleTableAdapter
            prjDataset = New nclMisDataSet
            controleTableAdapter.Fill(prjDataset.controle)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function getServerDistinct() As nclMisDataSet
        Try
            prjAccessTableAdapter = New nclMisDataSetTableAdapters.projetsTableAdapter
            prjDataset2 = New nclMisDataSet
            prjDataset2.EnforceConstraints = False
            prjAccessTableAdapter.FillBy1(prjDataset2.projets)
            Return prjDataset2
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function getbudgetDesign() As nclMisDataSet
        Try
            budgetDesignTableAdapter = New nclMisDataSetTableAdapters.budgetDesignTableAdapter
            prjDataset = New nclMisDataSet
            budgetDesignTableAdapter.Fill(prjDataset.budgetDesign)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function getrelateddata() As nclMisDataSet
        Try
            prjAccessTableAdapter = New nclMisDataSetTableAdapters.projetsTableAdapter
            prjDataset = New nclMisDataSet
            prjAccessTableAdapter.FillBy(prjDataset.projets)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function getApproDataSet() As nclMisDataSet
        Try
            approTableAdapter = New nclMisDataSetTableAdapters.approbationTableAdapter
            prjDataset = New nclMisDataSet
            approTableAdapter.Fill(prjDataset.approbation)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function getRecDataSet() As nclMisDataSet
        Try
            recTableAdapter = New nclMisDataSetTableAdapters.recevableTableAdapter
            prjDataset = New nclMisDataSet
            recTableAdapter.Fill(prjDataset.recevable)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function


    Public Function getBudget() As nclMisDataSet
        Try
            budgetTableAdapter = New nclMisDataSetTableAdapters.budgetTableAdapter
            prjDataset = New nclMisDataSet
            budgetTableAdapter.Fill(prjDataset.budget)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function


    Public Function getExtraDataSet() As nclMisDataSet
        Try
            extraTableAdapter = New nclMisDataSetTableAdapters.extraTableAdapter
            prjDataset = New nclMisDataSet
            extraTableAdapter.Fill(prjDataset.extra)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function


    Public Function getCliNameDataSet() As nclMisDataSet
        Try
            clientNameTableAdapter = New nclMisDataSetTableAdapters.clientsTableAdapter
            prjDataset = New nclMisDataSet
            clientNameTableAdapter.Fill(prjDataset.clients)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function


    Public Function getPrjAccessDataSet() As nclMisDataSet
        Try
            prjAccessTableAdapter = New nclMisDataSetTableAdapters.projetsTableAdapter
            prjDataset = New nclMisDataSet
            prjAccessTableAdapter.Fill(prjDataset.projets)
            Return prjDataset
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function saveCliAccessDataset(ByVal cliData As nclMisDataSet) As Boolean
        Try
            clientNameTableAdapter.Update(cliData)
            Return True
        Catch ex As Exception
        End Try
    End Function

    Public Function saveApproDataset(ByVal approData As nclMisDataSet) As Boolean
        Try
            approTableAdapter.Update(approData)
            Return True
        Catch ex As Exception
        End Try
    End Function

    Public Function savePrjAccessDataset(ByVal prjData As nclMisDataSet) As Boolean
        Try
            prjAccessTableAdapter.Update(prjData)
            Return True
        Catch ex As Exception
        End Try
    End Function

    Public Function saveRecAccessDataset(ByVal prjData As nclMisDataSet) As Boolean

        recTableAdapter.Update(prjData)
        Return True
      
    End Function

    Public Function saveBudgetDataset(ByVal prjData As nclMisDataSet) As Boolean
        Try
            budgetTableAdapter.Update(prjData)
            Return True
        Catch
        End Try

    End Function

    Public Function saveBudgetDesignDataset(ByVal prjData As nclMisDataSet) As Boolean
        Try
            budgetDesignTableAdapter.Update(prjData)
            Return True
        Catch ex As Exception
        End Try
    End Function

    Public Function saveControleDataset(ByVal prjData As nclMisDataSet) As Boolean
        Try
            controleTableAdapter.Update(prjData)
            Return True
        Catch ex As Exception
        End Try
    End Function
End Class

Open in new window

0
 

Author Comment

by:FCapo
ID: 40433006
There was a details section in an XML file when the app crashes, It's written this :

<WERReportMetadata>
<OSVersionInformation>
<WindowsNTVersion>6.1</WindowsNTVersion>
<Build>7600</Build>
<Product>(0x30): Windows 7 Professional</Product>
<Edition>Professional</Edition>
<BuildString>7600.16385.x86fre.win7_rtm.090713-1255</BuildString>
<Revision>1</Revision>
<Flavor>Multiprocessor Free</Flavor>
<Architecture>X86</Architecture>
<LCID>1033</LCID>
</OSVersionInformation>
<ParentProcessInformation>
<ParentProcessId>3212</ParentProcessId>
<ParentProcessPath>
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
</ParentProcessPath>
<ParentProcessCmdLine>
"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" "C:\Users\fcapozio\Desktop\Ncl Envirotek\Programming\Test\NCLADMIN - Time - Test\NCLADMIN.sln"
</ParentProcessCmdLine>
</ParentProcessInformation>
<ProblemSignatures>
<EventType>APPCRASH</EventType>
<Parameter0>NCLADMIN.exe</Parameter0>
<Parameter1>1.0.0.0</Parameter1>
<Parameter2>5460dbca</Parameter2>
<Parameter3>tiptsf.dll</Parameter3>
<Parameter4>6.1.7600.16385</Parameter4>
<Parameter5>4a5bdb20</Parameter5>
<Parameter6>c0000005</Parameter6>
<Parameter7>0000e69a</Parameter7>
</ProblemSignatures>
<DynamicSignatures>
<Parameter1>6.1.7600.2.0.0.256.48</Parameter1>
<Parameter2>1033</Parameter2>
<Parameter22>161d</Parameter22>
<Parameter23>161dbf8ffcae0abae6139cc297c8fa91</Parameter23>
<Parameter24>bef5</Parameter24>
<Parameter25>bef5b1eb625766916218d2fe4b977cf2</Parameter25>
</DynamicSignatures>
<SystemInformation>
<MID>91E7D333-54F7-41A9-93CE-A2D0541291DE</MID>
<SystemManufacturer>Dell Inc.</SystemManufacturer>
<SystemProductName>Vostro 230</SystemProductName>
<BIOSVersion>1.3.0</BIOSVersion>
</SystemInformation>
</WERReportMetadata>

Open in new window

0
 

Assisted Solution

by:FCapo
FCapo earned 0 total points
ID: 40433064
seems like this whole thing was caused by some PC Tablet component part of windows 7, I had to disable it in the control panel in order to prevent these crashes and it actually completely worked, Can't believe it :(

the link where I found this out is here : http://forums.ni.com/t5/NI-TestStand/TestStand-2010-crashes-tiptsf-dll/td-p/1497990

Thank you
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 40433187
Huh.  Glad you found it, as we never would have from our end.  =)
0
 
LVL 32

Expert Comment

by:it_saige
ID: 40433196
Yes, that is a weird issue.

-saige-
0
 

Author Closing Comment

by:FCapo
ID: 40444292
Contribution to the solution
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now