Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



System.InvalidOperationException on form.show()

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 30-04-2009
AK_Chopra's Avatar
Member
 
Join Date: Apr 2009
Posts: 91
System.InvalidOperationException on form.show()

Hello,

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

Quote:
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.
Reply With Quote
  #2  
Old 30-04-2009
Member
 
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.
Reply With Quote
  #3  
Old 30-04-2009
Member
 
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.
Reply With Quote
  #4  
Old 30-04-2009
Member
 
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))
Reply With Quote
  #5  
Old 22-11-2010
Member
 
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.
Reply With Quote
  #6  
Old 22-11-2010
Shreevats's Avatar
Member
 
Join Date: May 2009
Posts: 477
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.
Reply With Quote
  #7  
Old 11-03-2011
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "System.InvalidOperationException on form.show()"
Thread Thread Starter Forum Replies Last Post
How to access the windows music file form the Linux dual boot system. Ighun55 Operating Systems 4 26-12-2010 09:07 AM
Desktop icons disappear when system out form Sleep in Windows 7 Flacos Operating Systems 5 11-08-2010 02:46 AM
Under system it wont show me if its 32 or 64 bit Aramax Operating Systems 3 29-06-2009 07:24 PM
Show Your Name In the System Clock Cadmus Tips & Tweaks 2 09-01-2009 12:39 AM
How do you show percent complete on the task form? Phil Microsoft Project 1 17-09-2008 04:18 AM


All times are GMT +5.5. The time now is 04:24 AM.