PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS Code System.NotImplementedException 0x80004001 Message=The method or operation is not impl-VBForums
Results 1 to 2 of 2

Thread: System.NotImplementedException 0x80004001 Message=The method or operation is not impl

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2018
    Posts
    3

    System.NotImplementedException 0x80004001 Message=The method or operation is not impl

    system.notimplementedexception = the method or operation is not implement

    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub calculate_Click(sender As Object, e As EventArgs) Handles calculate.Click
    Dim vA As Double

    Dim vEk As Double

    Dim vX As Double

    Dim vZ As Double

    'Dim vY As String

    Dim five As Integer = 5

    Dim two As Integer = 2

    vA = A.Text

    vEk = EE.Text

    vX = X.Text

    vZ = Z.Text

    Ans.Text = Convert.ToString(Sqrt((X.Text ^ 2) - five * (Z.Text) And two * (A.Text))) + Sin(X.Text) - Cos(Z.Text((X.Text ^ 3) - (EE.Text ^ A.Text)))
    End Sub

    Private Function Sin(text As String) As Integer

    Throw New NotImplementedException()

    End Function

    Private Function Cos(text As String) As Object

    Throw New NotImplementedException()
    End Function

    Private Function Sqrt(x As Double) As Object

    Throw New NotImplementedException()
    End Function

    Private Sub ennd_Click(sender As Object, e As EventArgs) Handles ennd.Click

    Me.Close()
    End Sub

    Private Sub Equation_Click(sender As Object, e As EventArgs) Handles Equation.Click

    End Sub

    Private Sub Ans_Click(sender As Object, e As EventArgs) Handles Ans.Click

    End Sub

    Private Sub E_TextChanged(sender As Object, e As EventArgs) Handles EE.TextChanged

    End Sub

    End Class


    can some pls help, thanks in advance

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,780

    Re: System.NotImplementedException 0x80004001 Message=The method or operation is not

    Firstly, if you're going to post code snippets, please using appropriate formatting tags for readability:
    vb.net Code:
    1. Public Class Form1
    2.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    3.  
    4.     End Sub
    5.  
    6.     Private Sub calculate_Click(sender As Object, e As EventArgs) Handles calculate.Click
    7.         Dim vA As Double
    8.  
    9.         Dim vEk As Double
    10.  
    11.         Dim vX As Double
    12.  
    13.         Dim vZ As Double
    14.  
    15.         'Dim vY As String
    16.  
    17.         Dim five As Integer = 5
    18.  
    19.         Dim two As Integer = 2
    20.  
    21.         vA = A.Text
    22.  
    23.         vEk = EE.Text
    24.  
    25.         vX = X.Text
    26.  
    27.         vZ = Z.Text
    28.  
    29.         Ans.Text = Convert.ToString(Sqrt((X.Text ^ 2) - five * (Z.Text) And two * (A.Text))) + Sin(X.Text) - Cos(Z.Text((X.Text ^ 3) - (EE.Text ^ A.Text)))
    30.     End Sub
    31.  
    32.     Private Function Sin(text As String) As Integer
    33.  
    34.         Throw New NotImplementedException()
    35.  
    36.     End Function
    37.  
    38.     Private Function Cos(text As String) As Object
    39.  
    40.         Throw New NotImplementedException()
    41.     End Function
    42.  
    43.     Private Function Sqrt(x As Double) As Object
    44.  
    45.         Throw New NotImplementedException()
    46.     End Function
    47.  
    48.     Private Sub ennd_Click(sender As Object, e As EventArgs) Handles ennd.Click
    49.  
    50.         Me.Close()
    51.     End Sub
    52.  
    53.     Private Sub Equation_Click(sender As Object, e As EventArgs) Handles Equation.Click
    54.  
    55.     End Sub
    56.  
    57.     Private Sub Ans_Click(sender As Object, e As EventArgs) Handles Ans.Click
    58.  
    59.     End Sub
    60.  
    61.     Private Sub E_TextChanged(sender As Object, e As EventArgs) Handles EE.TextChanged
    62.  
    63.     End Sub
    64.  
    65. End Class
    Secondly, why are you surprised that you're getting NotImplementedExceptions thrown? It's in your own code! Did you read your own code? You have Sin, Cos and Sqrt methods that each explicitly throw a NotImplementedException so why would you expect that exception not to be thrown?

    I suspect that there's something going on here that you haven't bothered to explain. You ALWAYS need to provide a FULL and CLEAR explanation of the problem. If you leave it up to us to guess or assume then there's every chance that we'll get it wrong. Why make us waste our time and yours doing that when you can just tell us everything we need to know?

    I suspect what's happened is that you have written or possibly copied this line of code:
    vb.net Code:
    1. Ans.Text = Convert.ToString(Sqrt((X.Text ^ 2) - five * (Z.Text) And two * (A.Text))) + Sin(X.Text) - Cos(Z.Text((X.Text ^ 3) - (EE.Text ^ A.Text)))
    and the IDE told you that those three methods (Sqrt, Sin and Cos) weren't defined and offered to define them for you, which offer you accepted. In that case, the IDE would generate a method signature based on your usage and it would added that line that throws a NotImplementedException. The idea is that you are supposed to replace that line with your implementation of the method. The IDE doesn't magically produce the implementation as well as the declaration. It's up to you how you want your methods implemented.

    The thing is, you shouldn't have accepted that offer. What you should have done is written that original line of code properly in the first place. The .NET Framework already has Sqrt, Sin and Cos methods as members of the Math class and it is almost certainly those methods that you should be calling. I'm not sure why you aren't doing that already - maybe you copied that code form somewhere that imported the Math class but you didn't copy the import. Regardless, get rid of those method definitions from your code and then use the Math class for those operations and you should be good to go.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width