473,659 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Collection was modified; enumeration operation might not execute.

2 New Member
For Each row As DataRow In edt.Rows
dr = dt.NewRow
dr("slno") = i
dr("item_cd") = Convert.ToStrin g(row("item_cd" ))
dt1 = sp.FillDataTabl e("select ITEM_CD,SIBPART _CD from m033sibpart where comp_cd='" & Session("CompCd ") & "' and ITEM_CD='" & row("item_cd") & "'")
dr("SIBPART_CD" ) = dt1.Rows(0)("SI BPART_CD")
dr("qty") = Convert.ToStrin g(row("qty"))
dr("REMARKS") = Convert.ToStrin g(row("REMARKS" ))
dt.Rows.Add(dr)
i += 1
Next
May 11 '11 #1
1 2226
Abdul Khadhar
2 New Member
Me getting the error when i run the code in second time
May 11 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
372
by: Dave Arkley | last post by:
I have a type Dictionary<int, List<int>> oKP = new Dictionary<int, List<int>>(); Im populating the dictionary so that a key is associated with a list of integers. I then remove some, or possible all integers from the list by using foreach: foreach (int i in oKP.Keys) {
3
54595
by: Anders Both | last post by:
My client-server system, is begining (when more client are connected) sometimes to throw an exception like this: Collection was modified; enumeration operation may not execute. foreach (tcClient per in tcClientList) <-- Exception throw by this line. { if (tcClient!=tcClientNow) tcClient.flush(); }
2
1941
by: Tamir Khason | last post by:
I have a queue, wich recieves a lot of messages (between 10 and 100 a second) There is thread that takes care on this queue, but as far as I see it can not follow the messages so "Collection was modified; enumeration operation may not execute." exception thows. How to take care on it txn BTW. this not any other problem then reading from queue. I double checked it.
2
2271
by: Chuck Bowling | last post by:
I have a collection that I want to edit. When I remove an object from the collection and then try to enumerate thru it with the foreach statement it throws an exception - "Collection was modified; enumeration operation may not execute." Can somebody tell me how to fix this?
5
2650
by: David C | last post by:
This is very strange. Say I have code like this. I am simply looping through a collection object in a foreach loop. Course course = new Course(); foreach(Student s in course.Students) { Console.WriteLine(s.StudentID); }
1
1694
by: Tim | last post by:
Hi, I'm very new to .NET and am programming in C#. I have a web application where i have two list boxes. Its kind of like a shopping card where you can add items from one 'locations' list box to the 'locations selected' (cart) listbox. I have a hirarchy of locations - main locations and sub locations. main locations being the parent locations, and the sub locations being the child locations. I want to be able to check to see if the...
0
1502
by: Geoffrey | last post by:
Hello, I work with .net remoting,to simplify, when the client connected, he send an handle to an object, the object is used to exchange message and events. no problem. In my server, I keep a list of all actives clients and the handle of each., no problem In remoting, it's difficult to see when a client is disconnected, so I use asynchronous call to contact the client and if I got an error when I call EndInvoke =the client is...
4
1142
by: nondos | last post by:
Hello I have a thread that run loop in queue variable like this: For each <somethingas <somethingin <queue variable>
1
3172
by: Michel Racicot | last post by:
When executing the following function, I get this error message: Collection was modified; enumeration operation may not execute. The only thing that can modify lstClients is when I add one in it and I'm sure that my listener isn't accepting another connection. As you can see, I even locked it!!! What is wrong? private void ReceiveMessage() {
1
5645
by: SaradaV | last post by:
Hi all, I am working on vb.net web application and Often getting the following error. But even with the same inputs it is not reproducable. In most of the cases its executing successfully and in some rare (unknown) cases only its failing. The interesting point is; I just noted one set of the inputs caused the problem and tried to reproduce the same problem but not able to reproduce the error. One time error came at the firstline of the...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.