.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

System.Collections.Concurrent vs. System.Collections.Generic.SynchronizedCollection

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :.NET Framework
I'm confused why there is a "thread safe" collection in Collections.Generic.SynchronizedCollection and an entire namespace devoted to concurrent collections.   What is the difference?

View Complete Post

More Related Resource Links

Using the generic type 'System.Collections.Generic.IEnumerable' requires '1' type arguments



I'm trying to create a control out of a class I found, and one of the overridden functions is the following:

protected override void PerformDataBinding(IEnumerable data)

However, when I try to build the control I'm getting the error as shown in the subject. I've tried searching, and it seems the signature for the original function matches the one I have, and all other solutions I've seen uses the same signature.

Anyone able to help out?

Sharepoint site collections accessible only by system account

I I have setup a VM to start palying with SP development, everything running under administrator (sql, sharepoint services....). After succefully creating the root on port 80 and a couple of site collections, whenever I shoot IE http://mymoss or any othe site collection, I go right away to the web site without the usual authentification dialog box. On the right jand side, I see I am logged in as "System account". When I try to "sign in as a different user", enter domain\administrator, who is owner, the dialog box just keeps coming back and I can not log. . Thanks in advance

'ToList' is not a member of 'System.Collections.IList'



I am trying to cast a collection of IList object but why I get this error message "'ToList' is not a member of 'System.Collections.IList'"

The DataRecords1() function below works but not the DataRecords2() function.

Public Function DataRecords1() As IList

Dim dataInformation = From xyz In _DBContextTable1

Return dataInformation.ToList() 'works
End Function

Public Function DataRecords2() As IList
Dim dataInformation As IList

dataInformation = From xyz In _DBContextTable1

Return dataInformation.ToList() 'not working Sad
End Function



Linq to SQL does not implement System.Collections.IEnumerable


I am having a lot of the same issue as this poster did with errors on initializing type.

I am trying to learn linq and am about ready to give up - don't get how this is easier...Yell

I'm trying to do a simple update to product names in the product table based on the manufacturer ID

In order to do this I am looping through each record.  I was initally successful with changing all names in the column but when I try to query the data, I continually run into multiple problems.


The following poster has had the same issue I have but his solution isn't working for me. 


I keep getting the same error on the opening bracket on the select statement in the SelectByManufacturerID function...

Error 1 Cannot initialize type 'DataBaseDataManagement.ProductName' with a collection initializer because it does not implement 'System.Collections.IEnumerable'


Button that does the actual updating...

        protected void btnQuery_Click(object sender

Multiprocessor Optimizations: Fine-Tuning Concurrent Access to Large Data Collections


Application performance involves more than just speed. In a Web server environment, top performance also means ensuring that the maximum numbers of users can be served concurrently. This can be accomplished through efficient use of multiprocessor machines and thread management. This article presents techniques that can solve a number of concurrency problems. One approach, using thread management, controls access to a database on a per-thread basis, which protects the integrity of the data. In the article, reusable thread classes are built and presented. The classes are then tested and their performance in a live environment is examined.

Ian Emmons

MSDN Magazine August 2001

How to Cache System.Collection.Generic.List object


I need to cache System.Collection.Generic.List object with expiration time

var Root = from feed in feedhotel.Descendants(ota + "HotelContent")
                           where (feed.Attribute("HotelCode") != null)
                           select new xmlhotel()




return Root.ToList();

Is it possible to cache Root.ToList() for some time....

Optimization problem - Generic collections and user controls


I have a Winforms app (VS 2005/DotNet2) that contains a generic collection of a user control  

- Private c as new collection(of UserControl1)

Essentially it's the heart of the system and the system has grown extremely fat, to the point where users are complaining about speed.  Aside from the large number of database lookups, a major part of operations is iterating through the collection itself, to create it, set its values, and so forth.  (I am planning to try performance tools but that may take some time.)

For starters I was wondering if there was anything more optimum than a For each UC1 in C loop?  I really haven't worked that much with generic collections other than this one instance.

System Development Life Cycle

The Systems Development Life Cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project from an initial feasibility study through maintenance of the completed application. Various SDLC methodologies have been developed to guide the processes involved including the waterfall model (the original SDLC method), rapid application development (RAD), joint application development (JAD), the fountain model and the spiral model. Mostly, several models are combined into some sort of hybrid methodology

The Agile System Development Life Cycle (SDLC)

The goal of this article is to describe the agile system development life cycle (SDLC), putting it in context from what you may have heard about within the agile community and more importantly within the context of your overall IT efforts.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.



hello i have the following problem

i have upload my content to hosting server but i get the following error

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of typ

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPerm


Good Day all,

Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share. 

What do you think my approach should be. 

I already have read rights to IIS user to my BIN folder. 

Thanks for the help. 

System.IO.Packaging is not visible


I am new to ASP.net, I installed VS2005 and IIS 5 on my PC and set up my first website using IIS (not the embedded webserver in VS).

For some reason I cannot find the Assembly: "System.IO.Packaging", please let me know if I am allowed to use it in that medium and how can I reference it?

Thanks in advance.

how i can install sql server in my system


which edition of sql server  are best for me  Developer edition or express editon for development purpose.

i try to install last time sql server in my system but not successful so what i do for get the sql server in my system.

The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must



This is frustrating, and I don't know how to solve it.

I have a strange problem. I am adding a LinqDatasource object, and set the context:

        protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e)
            e.ObjectInstance = new KaruselaDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

Then I get this error:
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


On web.config I already have this:
<add assembly="System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.

is there another way adding a refernce to a web project? or only though teh web.config?


System.Xml.Linq.XElement and XPathDocument


I have an XPathDocument that I want to save to a table using LINQ, but I get this error

cannot implicitly convert type 'System.Xml.XPath.XPathDocument' to 'System.Xml.Linq.XElement'

I create the XPathDocument from some (valid) xml contained in a resource file

XPathDocument xDoc = new XPathDocument(new StringReader(Resource1.TestXML));

when I try to assign it with LINQ, it flags up an error

NewDataItem.XML = xDoc  ----  error here

NewDataitem is a LINQ to SQL object created from the underlying table, 'NewDataItem.XML' is a column type of 'XML'

how do i (easily) convert xDoc so I can pass it into the LINQ object ?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend