Error:Collection Was Modified; Enumeration Operation May Not Execute
Apr 7, 2008
Hi,
This is my save procedure.
Please check and give me some advice.looping is need or not?
i get error "Collection was modified; enumeration operation may not execute"
plz help me.
-------------------------------------------------------------------------------- Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim con As SqlConnectionDim cmd As SqlCommand
Dim da As SqlDataAdapter
Dim userid As String
Try
userid = Request.QueryString("userid")con = New SqlConnection(ConfigurationSettings.AppSettings("strcon"))
' con.ConnectionString = ConfigurationSettings.AppSettings("strcon")
con.Open()cmd = New SqlCommand("dbo.sp_AddAns", con)
cmd.CommandType = CommandType.StoredProcedure
For Each Item As DataListItem In dlAQ.ItemsDim paramid As New SqlParameter("@id", SqlDbType.Int, 4)
paramid.Value = userid.Trim
cmd.Parameters.Add(paramid)Dim paramans As New SqlParameter("@proansw", SqlDbType.NVarChar, 50)
Dim txtbox As New TextBoxtxtbox = CType(Item.FindControl("txtAns"), TextBox)
paramans.Value = txtbox.Text.Trim
cmd.Parameters.Add(paramans)
Dim paramprodesc As New SqlParameter("@prodesc", SqlDbType.NVarChar, 50)
Dim lbldesc1 As New Labellbldesc1 = CType(Item.FindControl("lbldesc"), Label)
paramprodesc.Value = lbldesc1.Text.Trim
cmd.Parameters.Add(paramprodesc)
Dim paramproid As New SqlParameter("@proid", SqlDbType.Int, 4)
Dim lblproid1 As New Labellblproid1 = CType(Item.FindControl("lblproid"), Label)
paramproid.Value = lblproid1.Text.Trim
cmd.Parameters.Add(paramproid)Dim paramreso As New SqlParameter("@proreso", SqlDbType.NVarChar, 50)
Dim lblreso1 As New Labellblreso1 = CType(Item.FindControl("lblreso"), Label)
paramreso.Value = lblreso1.Text.Trim
cmd.Parameters.Add(paramreso)Dim paramchk As New SqlParameter("@chk", SqlDbType.Int, 4)
paramchk.Value = "2"
cmd.Parameters.Add(paramchk)
'Dim rowaffected As Integer
cmd.ExecuteNonQuery()
bindData()
Next Item
View 1 Replies
ADVERTISEMENT
May 19, 2008
hi,
this is sanjeev,
i have SSIS package, using my c# program i want to add one execute package task to this package's sequence container.
it is creating the new package with out any probelm. but when i opened the package and try to move the newly created exeute package task it is giving the following error.
the element cannot be found in a collection. this error happens when you try to retrieve an element from a collection on a container during the execution of the package
this is my code
{
Package pkg = new Package();
string str = (string)entry.Key;
pkg.Name = str;
alEntity = (ArrayList)entry.Value;
ConnectionManager conMgr;
Executable chPackage;
TaskHost executePackageTask;
Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
//string PackagePath = @"c:Genesis.dtsx";
//p = app.LoadPackage(PackagePath, null);
p = new Package();
p.LoadFromXML(parentPackageBody, null);
p.Name = str;
//Sequence seqContainer;
IDTSSequence seqContainer;
//seqContainer = (Sequence)p.Executables["Extract Genesis Data"];
seqContainer = ((Sequence)p.Executables[0]);
string packageLocation = @"Geneva Packages";
conMgr = p.Connections["SQLChildPackagesConnectionString"];
foreach (string val in alEntity)
{
if (seqContainer.Executables.Contains("Load_" + val) == false)
{
chPackage = seqContainer.Executables.Add("STOCK:ExecutePackageTask");
executePackageTask = (TaskHost)chPackage;
executePackageTask.Name = "Load_" + val;
executePackageTask.Description = "Execute Package Task";
executePackageTask.Properties["Connection"].SetValue(executePackageTask, conMgr.Name);
executePackageTask.Properties["PackageName"].SetValue(executePackageTask, packageLocation + ddlApplication.SelectedItem.Text + @"" + executePackageTask.Name);
}
}
app.SaveToXml(Server.MapPath("../SynchronizeScript/Packages/" + ddlApplication.SelectedItem.Text + @"") + str + ".dtsx", p, null);
}
please let me know what is the wrong in my code.
thanks in advance.
regards
sanjeev bolllina
sanjay.bollina@gmail.com
View 14 Replies
View Related
Mar 29, 2005
Hi,
This is the error that I am getting after an unsuccessful
database attachment.
Error 21776: [SQL-DMO] The name 'XXXX' was not found in the Database
collection. If the name is a qualified name, use [] to separate various parts
of the name, and try again.
Any ideas how can I delete that database?
Thanks
View 4 Replies
View Related
Sep 4, 2003
I know why Im getting this msg, I restored a dbase from another server...so there is an orphan in the syslogin tables..is the solution below ok to do ?..and if so, do I re-enter user in the syssusers table or in EM ?
any other suggestions without touching the sysusers table would be appreciated as well
thank you
"In EM, Server Properties, turn on "Allow modifications to be done directly to the system catalogs"
- Delete the user from "sysusers"
- Re enter the user granting it the correct access to the database
- Turn off "Allow modifications to be ....."
View 4 Replies
View Related
Jan 26, 2006
I have a Sequence Container with an Exec SQL Task in it. I can't delete the task or the container. I can't disable them.
Here's how I got there:
I put a Dataflow Task and the Exec SQL Task in the container, then set a precedence constraint. Lots of complaints moving either of them. Managed to delete the Dataflow Task, but now can't do anything.
Any dieas?
Laurence
View 1 Replies
View Related
Jun 8, 2007
I need to use a modified SQL statement for a lookup component. It has an escape clause in it and this causes error:
select * from dbo.typecustomer where ? like '%'+type_subtype +'%'
ESCAPE '_'
Is this is a bug? Any help will be greatly appreciated.
Thanks
Akin
View 1 Replies
View Related
May 31, 2006
Is there "enumerate values" in SQL server? I know that VB.Net has enumeration. If there is enumeration in SQL server, how to do that?
Thanks.
View 11 Replies
View Related
Jul 18, 2007
While using SQLCE 3.0, I need to insert ~20000 records. I using the following code :
Code Snippet
cmd.CommandText = "M_Reclass";
cmd.CommandType = CommandType.TableDirect;
SqlCeResultSet rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable | ResultSetOptions.Scrollable);
SqlCeUpdatableRecord rec = rs.CreateRecord();
while ((strInput = srFile.ReadLine()) != null)
{
if (strInput.Trim().Equals(""))
continue;
intCount = intCount + 1;
arInfo = fileIO.SplitRow(strInput, fldSep);
try
{
// GKH 2007/07/17 : Perform check, but sacrifice speed
//if (arInfo.Length >= 5)
//{
rec.SetString(0, arInfo[0]);
rec.SetString(1, arInfo[1]);
rec.SetString(2, arInfo[2]);
rec.SetString(3, arInfo[3]);
rec.SetString(4, arInfo[4]);
rs.Insert(rec);
ProgressText("Processing " + Para.RECLASS_IMP_FILE + ": " + intCount + " records(s)");
//}
}
catch (Exception ex)
{
throw new Exception("Record " + intCount + " cannot be imported : ", ex);
}
}
I did a search on MSDN, I found the option available are:
Code Snippet
Member name
Description
Insensitive
The ResultSet does not detect changes made to the data source.
None
No ResultSet options are specified.
Scrollable
The ResultSet can be scrolled both forward and backward.
Sensitive
The ResultSet detects changes made to the data source.
Updatable
The ResultSet allows updates.
SqlCeResultSet.Scrollable Property : True if the ResultSet is scrollable; otherwise, false.
SqlCeResultSet.Updatable Property : True if the values in the record can be modified; otherwise, false;
SqlCeResultSet.Sensitivity Property :
The sensitivity of the ResultSet indicates whether the ResultSet is aware of changes to the data source. A ResultSet that is sensitive is aware of changes; an insensitive ResultSet is unaware of changes. If no sensitivity is set, the ResultSet is asensitive and will use the optimal configuration based on other settings.The default value is asensitive.
Since I just insert only, does it mean I no need "Scrollable" ( i think insert is mere forward scroll)?
But what about "Updatable" ? which one from SIUD (Select/Insert/Update/Delete) need to use this "Updatable"?
View 3 Replies
View Related
Nov 20, 2006
My apologies...I wasn't for sure where to post an error like this...
Over the last 2 months I have gotten this SQL Server error (twice). All existing processes will continue to work, however no new processes can be created and users cannot connect to the server. This is the exact text of the message in the SQL Server error log.
Operating system error 10038: An operation was attempted on something that is not a socket...
Error: 17059, Severity: 18, State: 0
Error accepting connection request via Net-Library 'SSNETLIB'. Execution continuing.
Error: 17882, Severity: 18, State:
While we can typically just stop SQL Server Service and restart the services...I have found it is best to restart the machine during non-production times to take care of any 'residual' effects of this error.
The SQL Server 2000 SP4 box with Windows 2003 Standard SP1 is well maintained by our I.T. team and it typically will run 4 or 5 months without a reboot.
Thank you...
...cordell...
View 5 Replies
View Related
Feb 5, 2006
Hi, I have developed a website in asp.net 2. I have tester it and it is working fine on my computer but when I have uploaded it to my server I'm getting an error message when the user signup. The error occurs when I'm setting the user role to 'members'.
Error line > Roles.AddUserToRole(user.UserName, "members")
The strage thig is that it is working on my computer but not on the server. My home computer and the server are running the same software versions and the website database is the same as well.
To double check that my code is not generating the error I have lonched 'SQL Query Analizer' and executed the folowing code on my database:
NOTE: In my database I have create the user “teeluk12� and a role “members�
aspnet_UsersInRoles_AddUsersToRoles "/", "teeluk12", "members", "5/02/2006 4:44:33 pm"
Once again the code is working on my home computer but not on the server. On the server I'm getting the following error:
Server: Msg 446, Level 16, State 9, Procedure aspnet_UsersInRoles_AddUsersToRoles, Line 76
Cannot resolve collation conflict for equal to operation.
Does anybody know what could cause the error?
Could it be some permissions that I didn't set on my server?
Thanks for my help and suggestions...
Regards,
Gonzal
View 9 Replies
View Related
Apr 17, 2007
Hello,
I have a SSIS package with a Data Flow task. This task transfers the data from SQL Server 2000 to a table in SQL Server 2005.
I deployed and tested this package on the Test Server. Then put this package in a job and executed it - Works fine.
On the production server- If I execute the package through DTEXECUI, it works fine. But when I try executing it through a job- the job fails and it gives me following error:
Description: The external metadata column collection is out of synchronization with the data source columns. The "external metadata column "T_FieldName" (82)" needs to be removed from the external metadata column collection....
What I don't understand is, why are there no errors displayed when I execute the package through DTEXECUI.
Can anyone help me to resolve this issue.
Thanks.
View 3 Replies
View Related
Jun 5, 2006
I planned to write a VB.NET SMO app enumerating all tables in a given database, all fields in each table, the properties (length, NULL, PK, etc) of each field, and finally store the result in a table. I think that should be quite doable.
But I noticed that the ForEach Loop editor has a SMO enumerator. (I don't know if it can be used to do exactly what I want.) By clicking on the options in the ForEach Loop editor I can get the Enumerator as follows:
Database[@Name='AdventureWorks']/Table[@Name='AWBuildVersion' and @Schema='dbo']/SMOEnumObj[@Name='Columns']/SMOEnumType[@Name='Names']
but it's not clear to me how to work with this thing! ( It must return a collection of items that I access through a variable.) Anyone know of an example illustrating SMO enumeration?
TIA,
Barkingdog
View 1 Replies
View Related
Apr 10, 2008
Hi. I am using SQL 2000 and DTS package to transfer data between two databases. In my DTS package, I need to create a enumeration task with a enumeration data task. However when I tried to add enumeration values, I cannot find any ways to create new values by right click to select from drop down menu or use Control + New in the enumeration properties. Could anyone point out how I can add new values in DTS Enumeration type.
Thanks
View 1 Replies
View Related
Feb 27, 2008
I am trying to move files from one directory to anonther using the For Each Loop Container and a File System Task. However, on the FIRST iteration of the ForEach Loop the variable that I am setting to the 0 index of the For Each Loop is returning me a valid directory with no file ( path only ) from who knows where ????
On the second iteration of the For Each Loop everything works as expected and I get the full path and file name and it iterates through all the files in the directory o.k.
So I have had to put a Hack to skip the fist iteration of the loop and then execute the File Task on the second iteration but I dont see anyone else doing this.
Where in the heck is it getting this odd directory from on the fist iteration ( its not my User varible because I am initializing it to \nowhereofile ). What am I doing wrong?
View 3 Replies
View Related
Dec 6, 2006
Dear all:
I had got the below error when I execute a DELETE SQL query in SSIS Execute SQL Task :
Error: 0xC002F210 at DelAFKO, Execute SQL Task: Executing the query "DELETE FROM [CQMS_SAP].[dbo].[AFKO]" failed with the following error: "The transaction log for database 'CQMS_SAP' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
But my disk has large as more than 6 GB space, and I query the log_reuse_wait_desc column in sys.databases which return value as "NOTHING".
So this confused me, any one has any experience on this?
Many thanks,
Tomorrow
View 5 Replies
View Related
Mar 6, 2008
Hi.
I have a master package, which executes child packages that are located on a SQL Server. The Child packages execute other child packages which are also located on the SQL server.
Everything works fine when I execute in process. But when I set the parameter in the mater package ExecutePackageTask to ExecuteOutOfProcess = True, I get the following error
Error: 0xC00470FE at DFT Load Data, DTS.Pipeline: SSIS Error Code DTS_E_PRODUCTLEVELTOLOW. The product level is insufficient for component "Row Count" (5349).
Error: 0xC00470FE at DFT Load Data, DTS.Pipeline: SSIS Error Code DTS_E_PRODUCTLEVELTOLOW. The product level is insufficient for component "SCR Custom Split" (6399).
Error: 0xC00470FE at DFT Load Data, DTS.Pipeline: SSIS Error Code DTS_E_PRODUCTLEVELTOLOW. The product level is insufficient for component "SCR Data Source" (5100).
Error: 0xC00470FE at DFT Load Data, DTS.Pipeline: SSIS Error Code DTS_E_PRODUCTLEVELTOLOW. The product level is insufficient for component "DST_SCR Load Data" (6149).
The child packages all run fine when executed directly, and the master package runs fine if Execute Out of Process is False.
Any help would be greatly appreciated.
Thanks
Geoff.
View 7 Replies
View Related
Nov 20, 2013
I'm using SQL Server 2012 Analysis services in Tabular mode and connected to Oracle Database and while importing, I'm getting below error after importing some rows.
OLE DB or ODBC error: Accessor is not a parameter accessor.. The current operation was cancelled because another operation in the transaction failed.
View 1 Replies
View Related
May 14, 2015
I'm trying to edit the Expressions of a Data Flow task. This seems to happen when I rename some of the Data Flow components but not always. The error I get is:
Element "[ADO Net Source].[SqlCommand]" does not exist in the collection "Properties"
However, if you look at the XML, this property does exist. So I'm not sure why this should occur.
I'm using SSIS 2008 R2 with Visual Studio 2008 V 9.0.30729.4462 QFE.
<component id="1" name="ADO Net Source" componentClassID="{2E42D45B-F83C-400F-8D77-61DDE6A7DF29}" description="Extracts data from a relational database by using a .NET provider." localeId="-1" usesDispositions="true" validateExternalMetadata="True" version="4" pipelineVersion="0" contactInfo="Extracts data from a relational database by using a .NET provider.;
[Code] ....
View 3 Replies
View Related
Jul 14, 2007
OK, a new package, with a Foreach container enumerating CSV files in a directory.
I create the container pointing it at the directory and retrieving the fully qualified name, and create a variable (called 'CSVFiles') with a package scope, but no value.
Inside the container is a bulk insert task. The destination db/table is set, and the input flat file connection manager for the CSV files is defined with the connection string set to the variable created above.
As it iterates through the files, the variable is correctly set to the next file in the directory (I put a message box in the stream to display the file name/variable). It resembles 'C: empLocation1.csv'.
But when it gets to the bulk insert, I get this error message:
[Bulk Insert Task] Error: The specified connection "CSVFiles" is either not valid, or points to an invalid object. To continue, specify a valid connection.
What's going on here? Can I not use a bulk insert task in the container? Or some other parameter needs to be set?
SQL Server 9.00.3159
View 4 Replies
View Related
Nov 1, 2000
I have W2K Adv, SQL 7 Enterprise in a workgroup with mixed security. The SQL installation is an almost entirely default install.
At the console, in SQL Enterprise Manager, when I select open a database, open tables, select a table, open table, and select all rows the system displays "an unexpected error happened during this operation". As far as I know this has never worked on this installation.
The error occurs with every logon account (including sa and local administrator accounts), both the "all rows or top row" options, every table, every database (including the customers database and the Northwind database).
I have tried adding administrators and accounts as users of the databases etc. and given the accounts all the permissions I can dream up.
There are no interesting messages in the event viewer. The SQL agent is running.
Technet found two documents but not related to the problem.
I can run SQL Analyzer and run "select * from table_name". That works on the Northwind and customer database tables - every time.
Colleagues with other installations do not get the error, and their systems return the rows correctly.
If any of you can help, I'd really appreciate it.
View 3 Replies
View Related
Mar 24, 2004
Hi
We are using a microsoft small bussiness server. One of our workstations get an mgrntw illegal operation error sometimes when doing an invoice in pastel premier. Does anyone know what can cause this problem and how can I fix it? The server run on windows 2000 and the workstations all use windows 98SE. This problem does not happen everyday. I formatted that computer, hoping the problem will go away but after 3 weeks it suddenly appeared again. I am not sure what version our mgrntw.exe is.
Thanx
Sonja
View 1 Replies
View Related
Nov 4, 2005
Hiwhen i right click table and click design table then error occured(an unexpected error occured during this operation)If any one knows please let let me know your help would be appreciated .thankspardhi--Message posted via http://www.sqlmonster.com
View 1 Replies
View Related
Apr 8, 2008
Hello I recently bought a Palm Centro from Sprint and I wanted to install the cd that came with it. On this cd is Palm desktop and Sprint music manager which I need to use my phone. The problem is when I insert the disk. After my laptop reads it it displays the error message along with: Line:134 Char:2 Code:0 and finally URL: file://E:EnglishEssential_Software
esources.html. I have no idea what to do or why this is happening can you please explain????? Maybe offer some steps also thank you
View 1 Replies
View Related
Oct 24, 2005
Using our ASP.net application we are getting inconsistent results when we are trying to update a table with more than 15 update queries sequentially.
We are using Merge replication in our SQL server database. On updating one row, it invokes a trigger to update another table and one more trigger for the merge replication. At only few
View 1 Replies
View Related
Sep 2, 2004
Exception information:System.Data.SqlClient.SqlException: Cannot resolve collation conflict for equal to operation.
Who can tell me how to resolve this problem?
Thx
View 3 Replies
View Related
Mar 25, 2008
Good morning,
I have created a very simple report that works correctly when in Report Designer Preview mode. When I deploy to the report server it reports that deployment was successful. When I log into Report Manager the report is visible, but when I click on it I end up at an error page.
The error that I get is:
Operation is not valid due to the current state of the object.
Appreciate any help on this.
Thanks
Stuart
View 2 Replies
View Related
Jan 22, 2007
Hi All,
I have a field 'Rowguid' of type uniqueidentifier in a table. This field is the last field in the table. In this case if I update a record through the application I don't get any error. Suppose if there are additional fields after the field Rowguid I get the error "Multiple-Step operation cannot be generated Check each status value"
For your reference I have used the following statement to add the RowGuid field
Alter table <tablename>
Add RowGuid uniqueidentifier ROWGUIDCOL NOT NULL Default (newid())
Can anyone please help me.
Thanks
Sathesh
View 3 Replies
View Related
Jan 15, 2015
While selecting table data I m getting below error
Msg 5243, Level 22, State 8, Line 2
An inconsistency was detected during an internal operation. Please contact technical support.
View 9 Replies
View Related
Nov 1, 2007
Hi All,
This application is developed in .NET Compact framework for Symbol Windows CE devices (MC3090). I am using SQL Compact edition as the database and uses merge replication to synchronize back and forth from Central SQL Server. The database is sitting in the SD Card, however when I suspended and restored the device while I am working with the application, it is giving me the following error message.
Error Code: 80004005
Message: OS Error: The OS storage system (RAM, CF, SD or IPSM) is not responding. Retry the operation.
Minor Err: 25049
Source: SQL Server Compact Edition ADO.NET Data Provider
The error message occurs only when I am trying to work with the application after restoring the device from suspended state. I also found KB Article from http://support.microsoft.com/kb/919150 and it explains that this issue is fixed in SQL Server Compact Edition which is what I am using now.
Please any help on this issue is very much appreciated.
Thanks
Ravi.
View 1 Replies
View Related
Feb 7, 2008
suddenly I'm getting a connect to server error dialogue box that says...
Cannot connect to serverinstance name
Additional information
The operation could not be completed. (WinMgmt)
...when trying to connect to RS2005 Server in Management Studio. I can reach Reporting Manager thru IE and run my reports.
Is it possible that my setting IIS to basic authentication (and turning off Windows Integrated) might be preventing me from connecting in MS, perhaps because MS has to go thru the RS service and doesnt know what basic auth is?
I'm temporarily unable to set IIS back to Windows Auth cuz the server is being used by users to test reports.
View 3 Replies
View Related
Aug 2, 2004
How can I make it work when I need to pull out a field which is text type using a stored procedure? Please help!!!Thanks
I am getting the following error
Error 409: The assignment operator operation could not take a text data type as an argument
===========my sp=================================
CREATE PROCEDURE [dbo].[sp_SelectABC]
(@a varchar(50) output,
@b text output
)
AS
set nocount on
select @a=name, @b= description from ABC
GO
View 1 Replies
View Related
Mar 20, 2007
I get an error message when deploying reports to the reportserver from microsoft visual studio.
error message : Error rsAccessDenied : The permissions granted to user '' are insufficient for performing this operation.
TargetServerURL : http://server.com/ReportServer$sql_2005
The Report server is configured to use a custom security extension. i can access the reportserver.
It looks like when i deploy the reports from VS. it does not pass any credentials to the report server. From the error message it looks like there is no username . How do i deploy reports to report server if we are using a custom security extension. How do i grant user rights to deploy report if we are using a custom security extension. Any idea. Thanks!
chi
View 4 Replies
View Related