التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
AccessViolationException was unhandled error
#1
,Hi everyone

:I'm facing an issue in my project every time that I'm trying to use "openfiledialog", and you can see the issue below
[ATTACH=CONFIG]1218[/ATTACH]

:And I have the following
.I had "Login Form", and I deleted it

.Changed the startup form to the MDIParent

!Debug the project and it's worked just fine

:The "Login Form" is
[ATTACH=CONFIG]1219[/ATTACH]

:And the code of the "Login Form" is
كود :
Imports System.Data.OleDb
Public Class LoginFrm

    Private Sub LoginFrm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        If UsersCount() = True Then
            MsgBox("There is no user in your system, you will be redirected to another form to add new user.", MsgBoxStyle.Information, "Login")
            AddUserFrm.MdiParent = MainFrmvb
            AddUserFrm.Show()
            'Me.Hide()
            Me.Close()
            Exit Sub
        End If
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If Me.TextBox1.Text = "" Then
            MsgBox("You should enter the user name", vbOKOnly, "Login")
            Exit Sub
        ElseIf Me.TextBox2.Text = "" Then
            MsgBox("You should enter the password", vbOKOnly, "Login")
            Exit Sub
        ElseIf Me.TextBox1.Text = "Administrator" AndAlso Me.TextBox2.Text = "Administrator" Then ' this code I should remove it from here
            AfterLogin.MdiParent = MainFrmvb
            AfterLogin.Show()
            'Me.Hide()
            Me.Close()
        Else
            If UserLoggedIn() = True Then
                MsgBox("Wrong username or password", vbCritical, "Login")
            Else
                'checkpermissions()
                MsgBox("You logged in successfully", vbInformation, "Login")
                AfterLogin.Label1.Text = test()
                AfterLogin.MdiParent = MainFrmvb
                AfterLogin.Show()
                'Me.Hide()
                Me.Close()
            End If
        End If
    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Application.Exit()
    End Sub
    Function UsersCount()
        ' get the password from the database
        Dim DA As New ERPDataSetTableAdapters.User_Tbl_localTableAdapter
        Dim TB = DA.User_Count
        If TB = 0 Then
            Return True
        Else
            Return False
        End If
    End Function
    Function UserLoggedIn()
        ' get the password from the database
        Dim DA As New ERPDataSetTableAdapters.User_Tbl_localTableAdapter
        Dim TB = DA.GetDataByUserNamePass(Trim(Me.TextBox1.Text), Trim(Me.TextBox2.Text))
        If TB.Rows.Count = 0 Then
            Return True
        Else
            Return False
        End If
    End Function
    Function test()
        Dim DA As New ERPDataSetTableAdapters.User_Tbl_localTableAdapter
        Dim TBS = DA.GetDataByUserNamePass(Trim(Me.TextBox1.Text), Trim(Me.TextBox2.Text))
        Return TBS.Rows(0).Item(1)
    End Function
End Class



:I searched all the code, and I did the following
كود :
Private Sub LoginFrm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'If UsersCount() = True Then
        MsgBox("There is no user in your system, you will be redirected to another form to add new user.", MsgBoxStyle.Information, "Login")
        AddUserFrm.MdiParent = MainFrmvb
        AddUserFrm.Show()
        Me.Hide()
        'Me.Close()
        'Exit Sub
        'End If
End Sub

!If you noticed that I canceled the calling of the function "UsersCount()" and everything works fine

.I don't know what is the problem in that function

?Do you have any suggestion for me

.I'll appreciate it

.Best


الملفات المرفقة صورة/صور
       
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
AccessViolationException was unhandled error - بواسطة hoob computer - 04-11-12, 07:42 PM
AccessViolationException was unhandled error - بواسطة amgadtamer - 04-11-12, 11:00 PM
AccessViolationException was unhandled error - بواسطة amgadtamer - 05-11-12, 03:36 PM
AccessViolationException was unhandled error - بواسطة amgadtamer - 05-11-12, 06:59 PM
AccessViolationException was unhandled error - بواسطة amgadtamer - 05-11-12, 08:31 PM
AccessViolationException was unhandled error - بواسطة amgadtamer - 05-11-12, 10:54 PM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  سؤالي عن a generic error occurred in gdi+ ahmed_elwerfalli 3 976 01-02-22, 03:40 PM
آخر رد: ahmed_elwerfalli
  Error In GridControl DevExpress yazanahmed 1 1,196 13-12-20, 10:49 PM
آخر رد: ابو ليلى
  [سؤال] Parse error: syntax error, unexpected '{' Sorax 4 1,900 15-02-20, 10:52 PM
آخر رد: محمد كريّم
  [سؤال] Error Syntax Insert Into" djelloul 11 4,648 28-12-19, 04:20 PM
آخر رد: مصطفى حفناوى
  حل مشكلة A generic error occurred in GDI+. samira20 2 1,949 17-12-19, 03:20 PM
آخر رد: asemshahen5
  Error creating window handle اسامه الهرماوي 3 3,756 09-10-19, 12:57 AM
آخر رد: اسامه الهرماوي
Rainbow (تم الحل )احتاج مساعدة حول خطأ system.accessviolationexception was unhandled dametucorazon 5 3,006 22-04-19, 12:47 AM
آخر رد: elgokr
  [سؤال] احتاج مساعدة يظهر لدى خطأ ExecutionengineException was unhandled dametucorazon 0 1,044 21-03-19, 09:09 AM
آخر رد: dametucorazon
  طريقة تكرار الامر تلقائيا | حل مشكلة script error في webbrowser عند فتح صفحة ما soloxocf1 6 3,228 18-03-19, 09:16 AM
آخر رد: 5000
  ما هو حل مشكلة هذا ال Error The connection was not closed. The connection's current mostafa nada 3 3,149 12-02-19, 06:58 PM
آخر رد: asemshahen5

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم