SQL Parameter And Item Has Already Been Added. Key In Dictionary: Error
Jun 1, 2004
Hi there,
I have a search page that redirects to another page transfering the search terms in a querystring. In the page to display the search results I use SQL parameters to show the results. Everything runs fine until I do a page refresh or use paging to bring up another set of results.
Everytime I try to refresh/page etc. I get the following error:
Item has already been added. Key in dictionary: "@CityTown" Key being added: "@CityTown"
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: "@CityTown" Key being added: "@CityTown"
Source Error:
Line 20:
Line 21: 'Creates parameters for the WHERE statement taking the querystring contents from previous page
Line 22: dsPropertyListing.Parameters.Add("@CityTown", CityTown)
Line 23: dsPropertyListing.Parameters.Add("@Suburb", Suburb)
Line 24: dsPropertyListing.Parameters.Add("@Rooms", Rooms)
I am getting this error when clicking-through in Report Builder on a report using a report model as the data source - An item with the same key has already been added.
I searched for the error but came up empty in the SSRS space. Does anyone out there know when this is generated and where I need to look in my model/properties to see what I have set incorrectly?
A little background/detail - It's a simple report against two fields (type & #count) in one entity (customer) in a (guessing here) medium sized model (~16 transactional/fact entities, ~40 lookup entities, ~15 what I am calling domain entities). The entity has 5 DefaultDetailAttributes, one Identifying. The report has 2 fields type (a lookup role) and #customers in the data area (so I can click it to test the click through). Then I click the # Customers to look at the detail for those X customers and after a long while and no queries against the DB (I have profiler running) I get this error.
Not 100% sure how to do this so I would appreciate some directions. I have 2 tables, Systems and Contacts. A system can have 1 to infinite contacts and contact can have 1 to infinite systems. So I use a 3rd table Sys_Con to add the contact needed for each system. Now my question is once I add the System and contact how do I know for sure which ContactID to add in my Sys_Con table? Because while I am doing this operation maybe someone can add an other contact. So is there a way for my store proc Add_Contact to return the contactID needed for my store proc Add_Sys_Con ?
TABLE Sys_Con SystemID int ContactID int
Table Contact ContactID int Identity ContactName ...
I am developing a small project that converts a dataset to an equivalent structure in SqlCe. The application converts every field, table and constraints to SqlCe, decomposing de dataset structure into Sql sentences.
The application works fine, the tables and constraints are reconstructed without error. but I found some issues: After conversion, the usual test is to connect to SqlCe, using Data->Add New Data Source and generate a dataset from the resulting tables.
I found that some tables throw the following message:
Failed to add relation(s).An item with the same key has already been added.
After that, the dataset returned contains the tables, but not the relations. After some trial I found that Data Source Configuration Wizard (DSCW) has some problem with foreign keys using Primary keys with multiple fields. If I drop that foreign keys, DSCW inferes the dataset without problem.
Interesting note: I am able to convert the dataset to an Sql Server using the same Sql sentences. If I use Data Source Configuration Wizard I have no errors.
Any advise to understand of fix this problem will be aprecciated. Is that a bug from DSCW ? Thanks Fernando
I am working on an ASP.NET and c# project. I am creating a page that allow user to add new Workitem to TFS and successfully do so. Now I would like to implement the way to email to notify the user that the new WI is added €¦. Does anyone know how to do this or have an example of how to implement that. Any help would be greatly appreciated.
This is all a generated query apart from the filter. If I change the @RegionParam back to its old constant value (which was 'Europe') then the fields appear again. I've set up the Query Parameters to cope with @RegionParam and also put a Report Parameter in the Layout page that uses it.
I'm lost as to why the fields don't appear with the parameter in there...
I would like to have a parameter on my report to Select by Order_Taken_By. My attempt at that is here:
Dataset called OrderTaken:
select distinct SO_Header.Order_Taken_By from SO_Header Under the report Parameter Properties named @Order, under Available Values Selected "Get Values from a query"
I have DataSet: OrderTaken
Value Field: Order_Taken_By Label Field: Order_Taken_By
The values of the field Order_Taken_By is all text characters, no integer values.
Running the inital Query by itself yields results. When I add the parameter, I can make a selection, but now I get no results, even though there should be values for the choice I've chosen.
I am developing reports using SQL Reporting Services 2005. These reports have some single valued parameters and these parameters will be provided in report viewer itself. These parameters should have "All" as default. "Select All" comes by default in Multivalue report parameter. But for single value parameter it always shows "<Select a value>" and if the user does not select a value,it prompts for one.I need to remove <Select Value> and show "All" as default thereby user does not have to select a value.
I can include "All" as a part of the select query in the parameter's datasource so that it can be shown in the parameter dropdown . However, I am not sure how I can remove "<Select a value>" from the dropdown.
Hello everyone. I am using C#, and posted this in the C# forum, but was told to try here, as for some reason I just can't get this to work. Everyone was very helpful, but for some reason I keep getting a message that a value is not being given for one or more required parameters. This doesn't make any sense though, as I am specifying a value for all parameters...
Basically, I have a listBox that has several items in it. I want to update the database for each item that appears in the listBox. I can't seem to get this to work though, no matter what I try, and it is driving me nuts... lol
Here is a link to my original thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2349891&SiteID=1
Here is my code:
Code Block
string whereClause = ""; for (int i = 0; i < Panel1ListView1.Items.Count; i++) { if (i == 0) { whereClause = "ID = " + Panel1ListView1.Items[0].Text; } else { whereClause += " OR ID = " + Panel1ListView1.Items[i].Text; } }
try { using (OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Environment.CurrentDirectory + @"DB.mdb;Jet OLEDB:Database Password=xxx;")) { OleDbCommand cmd; conn.Open();
string command = "UPDATE [Table1] SET [Status] = @P1, [Name] = @P2, [Number] = @P3 WHERE " + whereClause;
int i = cmd.ExecuteNonQuery(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } I really appreciate any help anyone can give me. I REALLY want to get this working. I am open to any suggestions and will try anything.
I have a BOM table with all finished item receipes and semi items recipes. create a query where semi item materials are also listed in finished item recipe.
When setting an output's "IsErrorOut" property to true, is it also possible to add additional columns to that error output?
I'd like to add a message beyond the standard errorCode and errorColumn columns, a column which is the "specific error message", not just a lookup on the errorCode.
Here's my problem. I have 2 tasks defined in my Control Flow tab:
EXECUTE SQL--------->EXECUTE DTS 2000 PACKAGE
When I attempt to run it, by right-clicking the EXECUTE SQL task, and selecting "Execute Task", it only runs the EXECUTE SQL part (successfully), and does not "kick off" the EXECUTE DTS 2000 PACKAGE, after it is done running (even though it completes successfully, as shown by the green box).
Yes, they are connected by a dark green arrow, as indicated in my diagram above.
Why is this?? Am I missing something here? Need help.
When I try to run my application using VWD from the file system I can connect and run the application and it connects to the remote SQL 2000 server with no problem.However, when I publish to my web server I get the folloiwng error message: Anyone got any ideas?? Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The entry 'MCLConnectionString' has already been added.Source Error: Line 11: <appSettings/> Line 12: <connectionStrings> Line 13: <add name="MCLConnectionString" connectionString="Data Source=GEACO1INTR1;Initial Catalog=MCL;Persist Security Info=True;User ID=ASPNET;Password=PAUL0001" providerName="System.Data.SqlClient"/> Line 14: </connectionStrings> Line 15: <system.web>Source File: c:inetpubwwwrootmcltestweb.config Line: 13
Hello,Basically, I have a table with 2 fieldsId item#1 33332 33333 22224 22225 22226 33337 33338 3333I would like to only select the last identical Item# which in this case would be the id 6,7 and 8Any idea how could I do that?Thanks
I'm trying to copy and paste an 'Execute SQL Tasks' within one of my packages.
I've managed to solve the copy part of the problem by registering the following dlls:
regsvr32.exe msxml3.dll regsvr32.exe msxml6.dll However, I can't paste the copied task onto my control flow. When I paste I get the following error:
The designer could not paste one or more executables. Additional information: At least one executable could not be pasted correctly. the executable with the name 'Record Row Count' could not be pasted successfully. Information about the state of the executable with the name 'Microsoft.SqlServer.Dts.Tasks.ExecuteSQLTask.ExecuteSQLTask, Microsoft.SqlServer.SQLTask, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded from the clipboard. Exception from HRESULT: 0xC0010028 (Microsoft.DataTransformationServices.Design)
While building Report Model Solution in Business Intelligent Studio i am getting following errror- More than one item in the Entity 'table' has the name 'columns'. Item names must be unique among immediate siblings.
Please advice how to resolve this one. Thanks Ashwin.
Can anyone point me in right direction as to how to prepare a DATA DICTIONARY for a given databse ??. And what is the usual format of preparing a data dictionary...Any help in this regard is greatly appreciated.
We have several SQL 6.5 data bases and a few Access Data Bases. We would like to build a data dictionary. Has anyone seen any 3rd party products which might help, or any ideas of how to manipulate the existing objects to do so?
Is there any tool for data dictionary? Basically there are no descriptions/comments to many of the columns (about 99%) in the database. Datawarehouse team does not know exactly what those columns are, where its used, how its used. No comments have been defined in the system tables. We would like to have a tool where SME's/Bussiness analysts enter the description for the columns in the production database. We have SQL Server databases, many oracle dbs, few sybase databases, ACCESS. Sometimes we might have to search for strings in the descriptions entered.
Hello,I am working on a project to reverse engineer requirements for adatabase. The database is sitting on a MS SQL Server. How would Iget a listing of all tables and columns within each table to helpcreate a data dictionary.I have developed a script in Oracle to do this, but I am just notfamiliar with MS SQL Server synthax.Thanks,Hitesh
I'm developing a report which contains a number of matrixes which are ordered in a hierarchy which can be navigated using a document map. One of the matrixes contains a subreport containing a table which displays a description for the matrix and the corresponding document map label. This is working without problem already in the production environment.
Recently, after updating my machine with numerous updates and patches, this stopped functioning. I now receive the error message, "The given key was not present in the dictionary" when I run this subreport, either as part of the greater report or on its own.
I have seen the posting which recommends deleting the report.rdl.data files. This did not solve the issue.
The data and the dataset are both in sync. When I click the "Print layout" button when previewing the report in Visual Studio .Net 2005, I can view the data. This looks like a bug in the VS.NET 2005 report designer.
I am using ATL COM library application. It is using sql data base for fetching the records. Some times, i get the following error. could you please let me know, why this happens? This is not reproduceble every time.
(Error! hr=80040e21, hrDesc=Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work
Here is the code to connect to database which i am using.
I have a old report that was pointing to a different database, and i changed the connection string for that report and changed the field names (As per my new stored Procedure). In some places I keep getting this run time error, i have tried looking for all the hidden references to this field and i cannot find any parameter that the old database had. The error messages that i get are as follows:
[rsFieldReference] The Hidden expression for the table €˜tblContactInfo€™ refers to the field €˜PL_Admin_ShowInKit€™. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.
[rsFieldReference] The Hidden expression for the table €˜tblContactInfo€™ refers to the field €˜PL_FA_ShowInKit€™. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.
[rsFieldReference] The Hidden expression for the table €˜tblWithdrawals€™ refers to the field €˜PW_Comment€™. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.
Can Someone please help me out as to how should i get rid of these error messages, they are kinda driving me nuts.
I need to build a data dictionary for a SQL 7 DB that already exists that has over 16000 columns. What I really need is to add a comment to the table and column names.We use ERWin and have looked at the Microsoft Repository but I would like a quick interface to create the descriptions which neither one of these have. I scripted out all the table and column objects into tables and built a simple Access Form to handle the updates. Now I need to commite these updates to the Microsoft Repository. Has anyone seen or tried something like this? THanks
I need to sort my data more than just order it using Order by clause. I need the, to appear so that they are sorted like in dictionary's order. example: if I have 0.1 and 0.2 and 0.11 They need to be ordered into 0.1 then 0.11. then 2.0. etc.
I thought I could use Val() function but it wasn't a successful attempt. Anyone can help me please?
I'm using ColdFusion and this is one of the query :
I am adding tables to a DB. I want to put table and column descriptions in as I go.
1. Is there a "Description" property for the table? I see in the column properties list a "description".
2. Once I have my descriptions all in, indexes set etc, is there a system stored procedure that I can run that will generate the data dictionay? (With a table description.)
When I try to preview a SSRS report in VS 2005 I get the following error: "The given key was not present in the dictionary", however when I deploy the report and view it in the Report Manager all is fine. I have not been able to find any useful info in MSDN, what I can try?