Results 1 to 7 of 7

Thread: System.InvalidOperationException on form.show()

  1. #1
    Join Date
    Apr 2009
    Posts
    91

    System.InvalidOperationException on form.show()

    Hello,

    I have a piece of code that load up a form: -

    frmCreatePurchaseOrder.show()
    my problem is that this application worked fine in W2000. But the client change to XP, and from that get this error.

    Please help.

  2. #2
    Join Date
    Dec 2008
    Posts
    183

    Re: System.InvalidOperationException on form.show()

    Try to Compile the program in the other VB.net editor then check for debug build and try running it from the bin folder again.

    Or else When you get the exception error there should be an option to debug the application. The Visual Studio IDE allows to open and break where the
    error occurred. You should be able to examine the values of the different variables at this point.

  3. #3
    Join Date
    Feb 2009
    Posts
    71

    Re: System.InvalidOperationException on form.show()

    I will provide you some trick to handle the exception use try...catch blocks:


    Code:
    try
         your code here
    
    catch ex as exception
    
      MsgBox(ex.Message & " - " & ex.StackTrace)
    
    end try
    It would be helpful to you to understand how the try- catch blog has been used in the programming.

  4. #4
    Join Date
    Dec 2008
    Posts
    161

    Re: System.InvalidOperationException on form.show()

    Are you able to load the form in the designer? If it loads fine then you should be able to set a breakpoint in the Form_Load event just as you did with VB6 and determine which control is not loading the second element.

    Depending on the version of Visual Basic you're using this is either in the .Designer.vb file (show all files from the solution explorer to see it) or it's in the collapsed Windows Form Designer generated code region of the form file. If you remove the attribute (<System.Diagnostics.DebuggerStepThrough()>) on the IntializeComponents sub routine you should be able to debug this routine it as well.

    You should be able to just inspect this routine and make sure all of your control arrays are loading the 2 element. The code you’re looking for would be similar to the following example:

    Me.Command1.SetIndex(_Command1_2, CType(2, Short))

  5. #5
    Join Date
    Nov 2010
    Location
    Leon, Gto, Mexico
    Posts
    1

    Re: System.InvalidOperationException on form.show()

    I had this kind of problem, and I solved it reasigning the icon on some forms on my application, in Vista and W7, you can display an icon with 256x256, but in WinXP does not work, and worse, does not gives you a clue, my solution was change the icon's forms to a smaller one.

  6. #6
    Join Date
    May 2009
    Posts
    527

    Re: System.InvalidOperationException on form.show()

    Looking at the situation that you have presented here I think that the possible reason for this issue can be when you use a Microsoft Visual Studio .NET 2003 client application against a Microsoft SQL Server 2005 native Web service. The reason for the occurrence for this is because the System.Data.DataSet object that Visual Studio .NET 2003 uses does not support the XML Schema definition language (XSD) schemas that SQL Server 2005 generates. In order to overcome the issue I would suggest you to use the simple Web Services Description Language (WSDL) instead of the default WSDL. If you want to have a reference then you can use the following or the similar URL:http://<server>/<endpoint>?wsdlsimple. Hope that you will find this useful.

  7. #7
    Join Date
    Nov 2008
    Posts
    2

    Re: System.InvalidOperationException on form.show()

    Quote Originally Posted by phernand1956 View Post
    I had this kind of problem, and I solved it reasigning the icon on some forms on my application, in Vista and W7, you can display an icon with 256x256, but in WinXP does not work, and worse, does not gives you a clue, my solution was change the icon's forms to a smaller one.
    Kudos phernand1956! I had this SAME problem, and spent 3 days looking around for a solution to this "generic" error! Well, two weeks earlier, I had created a new new icon for my application. Wanting it to look good in newer versions of windows, I included 128 and 256 pixel versions in the .ICO file. Well, since it was my main program icon, I also used it at the upper-left of my main form! It worked fine on Windows 7 and Vista systems... I discovered three days ago though, when attempting to install it on a Windows XP machine, wouldn't even start; hit an error trap, or anything!

    I started yanking out references and commenting out code but nothing helped. I reinstalled .NET on the target machine. Everything I could think of. Just when I had about hit rock bottom and totally given up, I found that post and realized "Hey! I got a 256x256 icon as my form icon! I wonder..." I replaced it and everything worked!

    It seems like it's fine to have a large-format icon for your PROGRAM icon and any shortcuts in your setup program, but you MUST make a standard (64x64 max frame size) .ICO file for your Windows Forms icon.

Similar Threads

  1. Replies: 5
    Last Post: 25-05-2011, 10:21 PM
  2. Replies: 4
    Last Post: 26-12-2010, 09:07 AM
  3. Replies: 5
    Last Post: 11-08-2010, 01:46 AM
  4. Under system it wont show me if its 32 or 64 bit
    By Aramax in forum Operating Systems
    Replies: 3
    Last Post: 29-06-2009, 06:24 PM
  5. Show Your Name In the System Clock
    By Cadmus in forum Tips & Tweaks
    Replies: 2
    Last Post: 09-01-2009, 12:39 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,754,584.12788 seconds with 16 queries