Questions tagged [invalidoperationexception]

The exception that is thrown when a method call is invalid for the object's current state.

The exception that is thrown when a method call is invalid for the object's current state.

More information is available on Docs.

505 questions
0
votes
1 answer

WPF DataGrid Editing Difficulty (InvalidOperationException)

I have a DataGrid that I am filling with information from an ObservableCollection> where T is an object of mine that implements IEditableObject. I have the DataGrid correctly filling with the information I need. The…
0
votes
2 answers

Entity Framework: The 'IngramMicro_RetailPrice' property on 'IngramMicro' could not be set to a 'System.Double' value

I am using Entity Framework Code First approach - TPH to read CSV's into SQL Server. The files are read in and mapped to specific properties of specific Distributor Objects. I can successfully read in a specific file from the distributor:…
0
votes
0 answers

c# i'm not editing my collection,but the program show me InvalidOperationException error

I don't understand why this code does not work. foreach (DataRow dr in dtr.Rows) { A = new Kustom.Metier.Authentification.Utilisateur(Convert.ToInt32(dr[0]), dr[1].ToString().Trim(), dr[2].ToString().Trim(),…
Oussam
  • 1
  • 1
0
votes
1 answer

The property 'Id' is part of the object's key information and cannot be modified ON SELECT

We are encountering this error on a particular query in our application about 1 in 3 times: The property 'Id' is part of the object's key information and cannot be modified. at…
0
votes
1 answer

Ajax call to .asmx page method failing with invalid System.InvalidOperationException: Missing parameter

I am trying to use a jquery autocomplete with an ajax call to a webservice method the call works fine on localhost but when published to the dev server it fails everytime and using google chrome to debug i get the following error: …
0
votes
1 answer

How can fix System.InvalidOperationException = Unable to create service from type 'My type'?

I've got a web service that references a set of dlls that are currently version 6. I was given version 7 dlls to upgrade to, so I registered the new dlls in the GAC, removed the references in my project to the old dlls and added references in for…
sr28
  • 4,728
  • 5
  • 36
  • 67
0
votes
1 answer

DesignSurface: Can't delete controls

I'm currently working on a project involving DesignSurfaces. In the Form_load event, I load a form with 3 textboxes, 3 labels and a button. To manage these controls, I have a ContextMenuStrip with MenuItems containing the StandardCommands Cut, Copy,…
chesta
  • 315
  • 3
  • 13
0
votes
2 answers

Could not load file or assembly 'System.Drawing' or one of its dependencies

I'm getting this error since yesterday and after 'searching trying and crying' I've ended up asking the question on here. An unhandled exception of type 'System.InvalidOperationException' occurred in 'project.exe' The error is: Could not load…
0
votes
0 answers

Entity Framework CF Something has changed

I just got back to an old project that uses Entity Framework and when I run it I get the dreaded "The model backing the ‘MyContext’ context has changed since the database was created. Consider using Code First Migrations to update the database ..."…
0
votes
1 answer

InvalidOperationException by InitializeComponent

If I open a new Window from the MainWindow Class, I got an InvalidOperationException. The exception is thrown by calling the InitializeComponent()-Method. I don't know what to do. ItemWindow itemWindow = new ItemWindow() { WindowStartupLocation =…
Thomas
  • 113
  • 1
  • 11
0
votes
1 answer

"The input sequence has an insufficient number of elements" on a Seq.length call?

I'm working on the Matasano Crypto Challenges but I'm running into an odd bug. I have a Seq of integers, and on a call to Seq.length (or Seq.sum), I get a 'System.InvalidOperationException' with the explanation of "The input sequence has an…
Arcsech
  • 36
  • 4
0
votes
1 answer

C# MSMQ Invalid Operation Exception

I create a basic application to manage MSMQ in C#. I create messages in my trasaction message queue with this method: /// /// Method to send message in message queue /// /// message queue (to) ///
Vynhoû Tawa
  • 68
  • 1
  • 14
0
votes
3 answers

"Collection was modified; enumeration operation may not execute." on form disposal

"Collection was modified; enumeration operation may not execute." appears to be a common error with foreach loops, but I can't figure mine out. I have two classes of forms. One is begun on startup, and a button creates new instances of the second…
dlras2
  • 8,416
  • 7
  • 51
  • 90
0
votes
1 answer

How can I remove more than one item from a listbox?

This is really getting annoying; or, to be honest, it became quite annoying a good while back. Programmatically removing items from a listbox should be pretty straightforward, yet it seems everything I try ends up the same: with an exception. This…
0
votes
3 answers

Why is this array list removal code failing?

I'm trying to remove specific values from a listbox by passing the corresponding text, looking for it in the listbox, and removing that item. With this code: private void UpdateGUIAfterTableSend(String listboxVal) { …
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862