[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/16/2003 at 04:11PM PDT, ID: 20740723
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Application has generated an exception...

Asked by EYoung in .NET

Tags: application, could, exception

Basics:  VB.net, Windows 2000 and XP, .Net Framework 1.1, MS SQL Server 7.

I have written a simple vb.net application (Test1.exe) that reads a table in MS SQL Server 7 and displays a record each time the Start button is clicked.  The application runs fine on my development computer.  When I copy it to a mapped network drive it also runs fine if I execute it from my development computer.  Additonally, it runs fine from other people's computers - both from their C: drive and from the mapped network drive.

However, we recently added some new computers for some users and when they try to run the application from their C: drive or from the mapped network drive, they get the following error:  "Test1.exe - Common Language Runtime Debugging Services.  Application has generated an exception that could not be handled."  No other helpful information is displayed.  All the computers including the new ones are running .NET Framework 1.1.

This error message is similar to an error I was getting a while back.  See http://www-tcsn.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20665455.html  At the time I thought the solution offered would solve the problems, but we are still getting an error.

It appears that the problem may be somehow related to my adding the SQL code to the program that reads the SQL table and displays the records - but I am not sure about that.  I did test this theory as follows:  I created a really simple vb.net program that just displays "Hello" in a label when a button is pressed.  There was no SQL Server commands in this first program.  The program ran just fine from everyone's computers including the new users's computers and the mapped drives.  Then I added the SQL Server commands shown below and although the program runs fine from my development computer and the mapped drive and the older users's computers, it did not run from the newer users computers.  So it looks like there may be an issue with SQL rights?


Below is the code from the program (Test1.exe) that contains the SQL Server commands and causes the error message:
=============================================================================
Imports System.Data.SqlClient

Public Class Form1
    Inherits System.Windows.Forms.Form

    Dim mDataReader As SqlDataReader
    Dim mSqlConnection As SqlConnection = New SqlConnection("Data Source=SV03;Integrated Security=SSPI;Initial Catalog=HF_Standards; ")
    Dim mSqlCommand As New SqlCommand("Select * from Divisions Order By Sort_Seq, Division", mSqlConnection)

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        mSqlConnection.Open()
        mDataReader = mSqlCommand.ExecuteReader

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        Me.SuspendLayout()
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(48, 140)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(80, 24)
        Me.Button1.TabIndex = 0
        Me.Button1.Text = "Start"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(168, 140)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(72, 24)
        Me.Button2.TabIndex = 1
        Me.Button2.Text = "Exit"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(36, 48)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(216, 24)
        Me.Label1.TabIndex = 2
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 201)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        mDataReader.Read()
        Label1.Text = mDataReader("Division")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        mDataReader.Close()
        mSqlConnection.Close()

        Close()
    End Sub
End Class
=============================================================================


I am really at a loss as to how to try to solve this ongoing problem.  It is becoming a real issue here.

Also note that I have done the following two things but neither worked:

1.  I ran the "Microsoft .NET Framework 1.1 Configuration" utility and created a new code group for this program.  I gave it unlimited rights to "Everything" including SQL Server.

2.  I also ran the "Microsoft .NET Framework 1.1 Wizards" and granted full rights in "Adjust .NET Security" and "Trust an Assembly".

Neither of these made any difference.



Would appreciate any help.  Thanks.
[+][-]09/16/03 05:07 PM, ID: 9374504

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/03 10:22 PM, ID: 9375795

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/17/03 12:15 AM, ID: 9376220

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: application, could, exception
Sign Up Now!
Solution Provided By: TheAvenger
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09/17/03 10:27 AM, ID: 9379920

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91