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

Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

List - easy question hopefully :)

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :ASP.Net

Hi there,

Sorry in advance if this is the wrong place to post. Please redirect me if necessary.

I have a Generics list of my class objects - at any given time there could be a maximum range of 100 to 1000 objects in my generics list of objects. 

Let's say I have just 3 MyObject in my generics list. I want to do a .RemoveAt(0) because I no longer need it, and then maybe do a couple of .Add(MyObject) methods and then another .RemoveAt(0) method call. 

In other words, there will be constant .RemovingAt index zero and .Add method calls - the question is: I am worried about memory since the Generics list is in constant reindexing flux. Do I have anything to worry about given this scenario???

The MyObject is a very small class.


View Complete Post

More Related Resource Links

C#, LINQ: (List<>) Question???


Hi Everyone,

I have a strange problem:


There is an entity (Table) called "Filters" in my .edmx which has all my tables and stuff in it (to use it for LINQ queries)

I have created a class called "CustomFilters" which inherits "Filters". So now my cutom class has all the properties of the original "Filters" class (table) and 1 more additional property that i wanted which is a List of "CustomFilters":

List<CustomFilters> children = new List<CustomFilters>();

Now i get all my records into:

List<CustomFilters> theOriginalList = new List<CustomFilters>();

NOTE: first all records are tken into a List<Filters> and then these are added into List<CustomFilters> where List<CustomFilters> for children of that record is added, and then children of the child records, and so on......

so now, every record is an instance of CustomFilters which has a property named "children" which is a list again; and each child again has instanaces of "CustomFilters", and each instance again has children...and on and on and on.....

(basiacally its a data source for a treeview in my silverlight control)

every thing is good and working as expected.


Question about List Tools ribbon

Hi, is it possible to set by default to visible the "List Tools" upon the ribbon. When I go to Task list, the List Tools is visible by default but not with my custom lists.

Easy Calendar View Question - I hope

I have a Calendar in Sharepoint Foundation 2010. The only thing I want to do but can't is to have the Event Description text shown along with the Event title. Is it possible? Some event last several hours so there is plenty of space to show the text. TIA

Question about filter list of objects by interface



public interface ISearchable
      int Id{ get; set;}
      int LanguageId{ get; set;}


class Programmer : ISearchable

    public int Id
            return Id;
            Id = value;

    public int LanguageId
            return LanguageId;
             LanguageId = value;
} public class Teacher : ISearchable { public int Id { get

SharePoint team discussion list question



In my "Team discussion" list we ask user to select "Departments" from the drop down. Now, I'm creating view for each department so that they can only see their own discussions. But, When I add "Team discussion" list in a web part, I don't get my custom views in "Select View" drop down list. I'm getting only "Subject" view ,

You may refer my question here with screen shot  : http://stackoverflow.com/questions/4076312/sharepoint-team-discussion-list-question


Filtering foreign key drop down list question.


I have a question concerning the way dynamic data filters records in foreign key fields in edit mode.  Here is my application as an example:


I have a table called people which has a one to many relationship to a table called addresses (to keep historical address records) as well as a one-to-one foreign key relationship to determine which of those multiple addresses is the current active address.  Dynamic data displays the one-to-one as a drop down list in edit mode but the list is populated with every address in the table to choose from.  Is there a way to filter it so that the drop down list is populated with only the possible addresses that already belong to that person rather than every address in the table (including those that pertain to other people)?


String Question: probably easy/dumb :(



I am returning an JQueryAJAX update (within an JQuery/Ajax update, but don't think its relevant) in a WebService:


                                         type: 'POST',

                                         url: 'DoorAjaxCalls.asmx/AddNewComment',

                                         data: '" + tCommentAjaxData + @"',


Need to find % in a placeholder (easy question?)


I have two values in seperate datasets , one value represent the total number of cases (records) for a particular business unit.

the other represents the total number cases (records over all)

for example. Marketing has 80 in valuea cases out of 100 valueb  total cases in the organization.

the request from me is to provide them a percentage in this case it would be 80%...but im not able to figure out how to go about getting the value in % with an arithmetic equation that would take the valuea devided by the valueb in an expression.

Can anyoen offer a suggestion?  

MVC Linq Join List Question


This is the query I have

    Function Index() As ActionResult

            ViewBag.dateNow = DateTime.Now

            Dim result = (From newLocation In DataAccess.Locations Join
                         newState In DataAccess.States
                         On newLocation.state Equals newState.id
                         Select newLocation, newState)

            '   Return View(DataAccess.Locations.ToList)
            Return View(result.tolist)

        End Function

I am trying to populate the ToList View, but I can't figure out how to call a specific column since it is using a join...

Example:   @item.address

I was thinking it would be like   @item.newlocation.address

However, that is not working --- any advice?

Easy @foreach question..


Hey guys,

I am converting a basic helpdesk/jms I wrote in PHP to Razor. The way I have my database structured, I need to grab data from multiple databases and I am not sure of the correct syntax.

This is the scenario:

Table called "Jobs" has the following columns: JobId, UserId, JobDetails
Table called "Users" has the following columns: UserId, UserName 

What I want to be able to do is when I pull the details from Jobs table, instead of returning the user's id number (UserId) I would like it to grab their UserName from the Users table.

I have started to write the query, but I am a bit stuck to where I can join the tables together.

Here is what I have:

 var db= Database.Open("data");
 var GrabCaseDetails = db.Query("SELECT * FROM Jobs");
 //var GrabUserName = db.Query("SELECT * FROM Users INNER JOIN Jobs");
      @foreach(var row in GrabCaseDetails ){
		<td class="full"><a href="#">Job Title here</a></td>					
		<td class="who">Logged by @row.UserId</td>
Any help would be greatly appreciated!
Cheers, Aaron 

Six easy ways to customize your site using Web Parts in SharePoint

Becoming familiar with Web Part customization techniques gives you a range of page-customization choices. For example, you can customize your site's home page so that it displays the specific information that your team needs. You can rearrange the list items on the home page, add lists, and even change the images on the home page. As you become more familiar with Web Part Page customization techniques, you can build interactive Web Part Pages that makes the data in lists more dynamic and useful, and you can add new Web Parts that provide access to external data and Web services.

Ready made List Types provided by SharePoint

SharePoint provides some out of the box List Types. Some of the most used ready made list types that SharePoint provides currently are listed below:

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:
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