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

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

Help: How to create a list(Ienumerable) using loop

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


I needed to modify the code(The test method part especially) present in the link ( http://blogs.msdn.com/b/lucabol/archive/2007/12/17/bisection-based-xirr-implementation-in-c.aspx)

Instead of Hard Coding the values for cash and date(under Test methods, for object such as cfs), I want to use a loop, which depending on the two arrays of cashflows and dates, that I am receiving, creates the object (cfs) insteasd.

So, right now the cfs is hardcoded something like( as can be seen in the link)

  IEnumerable<CashFlow> cfs = new CashFlow[] {
                new CashFlow(-10000, new DateTime(2008,1,1)),
                new CashFlow(2750, new DateTime(2008,3,1)),
                new CashFlow(4250, new DateTime(2008,10,30)),
                new CashFlow(3250, new DateTime(2009,2,15)),
                new CashFlow(2750, new DateTime(2009,4,1))

I want to do something like

IEnumerable<Cashflow> cfs = new Cashflow[5];

for (int j = 0; j < 5; j++)

View Complete Post

More Related Resource Links

Can I create several steps to be run on a SharePoint list as a task to run on a daily basis?


We have a manual process that we do on a SharePoint list to export data from SharePoint to a spreadsheet that can then be used by non SharePoint programs.  I'd like to be able to automate this process so that it can be scheduled as a Task to run on a daily basis.   Not sure if a workflow can do what I'd like it to.  I have SharePoint Designer 2007 as well.

Here are the steps:

1. Load a particular View of a SharePoint List

2. From the view's Action menu, "Open with Access"

3. Save the resulting Access database as a file to a specific Folder on the computer hosting SharePoint

This would be run as a Task on the computer hosting SharePoint.

Quick Note: Create Custom List Definitions in SharePoint 2010

In this exercise, you create a custom list definition in Microsoft SharePoint 2010 and then create an event receiver that is triggered when the list is used.

create new custom list form in sharepoint designer and edit in browser

hi, i have created a new list using sharepoint designer 2007. now i inserted a custom list form to modify some field and add new ones. when i finished i will tight my new custom list to the custom form. what i want to know is. i see the status field in my new form. and i only want the status field to appear in the edit form for the one that has the permission to edit the status. then i tought of open the list in my browser and go to the list settings. but what i notice is i dont see my fields i have modified in sharepiont designer in the columns section i only see the ones from the existing list. my question is how can i hide the status field in the new item form that it only show in the edit form. and how do i get my new form in the column section so the end user can add more fields if they want without using sharepointdesigner thnx

Create a new list View Style

Hi, In SharePoint 2010 for XSLT List View Web Part you can assign different view styles using SharePoint Designer. For example "Basic Table", "Boxed" or "Shaded" etc. These styles just don't fit my needs. So my question is how can I create my own View Style which I can apply to any list? I came across "Customize XSLT > Customize Entire View" option under Design tab in SharePoint Designer which allows me to change the XSL stylesheet and control the rendering for a list. But how can I create my own list "View Style" which I would like to reuse with other lists too? Thanks, Hitesh  

Create drop-down filter for External List

I hope this is an easy question. I will have an external list of a bunch of people.  There are several ways I want to display this data: All of them, Only the ones that have a value of 1-4 in the status field, Only the ones that have any other value in the status field, and people that have a value of 1-4 in the status field, but are at a certain location. I want to be able to put a drop-down filter above the list where people can select that. Could someone please point me in the right direction? Time is of the essence.  

create workflow for 2 list

hi, this is my senario: i have created a custom list in the "absence and vacation schedule" site template. http://www.microsoft.com/downloads/details.aspx?FamilyId=56406562-01F9-4A18-9924-2DC0684232C8&displaylang=en   in the custom list i created i store the ID of all the approvers and the ID of all the users that can fill a request form. now i wanted to create a workflow between the custom list i created and the absence list that was already created. in the submit new absence form i added a field named user id. now what i want to do is that when a user fill in a form the workflow must compare the user his id in absence list with the user his id in the custom list i created and see witch approver is connected to that user id so it can send the request form only for that approver. i hope i was clear enough thnx

What is the best way to dynamically create a scrollable list of forms that when clicked expand for e

Hello, What is the best way to dynamically create a scrollable list of forms that when clicked expand for entry? More details: In my XAML I have a TabControl. One particular TabItem looks like this:   <TabItem Name="Tab_Forms" Header="4" Width="50" Height="20" Background="{x:Null}" BorderBrush="{x:Null}"> <Border Name="Tab_CategoryTabSelected_Border" BorderThickness="10" BorderBrush="Transparent" Padding="3"> <... What do I use here? ...> </Border> </TabItem> At the location <... What do I use here? ...> I need some sort of scrollable control.  The scrollable control can be part of the XAML above. However, the contents of that scrollable control will be entirely code generated. Within that scrollable control will be a vertical list of forms by name with an expansion/contract button next to the name.  When the user clicks the expansion button, the form expands into view, and may be longer than the viewable area, and the user will need to be able to enter data into the entry fields.  I need the tab key to go from field to field as would be expected. If the user is on the last viewable field and there are more fields below, when the user hits the tab key, the for

How to create field in the list that shows Person's e-mail of Person selected in other field?

There are nor web-parts allowed, neither any server-side code too.

Create Dropdown list

Dear All, I want to create dropdown list in EXCEL file from .Net Application.. Its completely dynamic from .net application... Excel file contains DATA ---> Validation ---> List  To create dropdown list in excel...   Please help me regarding this.. Thanks...

how to create a List order and unourder a simple Sql Query

A Simple Query Pass to connection String 1 My Query is SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.COFROM V_HIERARCHY1 a   2,My Data is HD    HEAD    SH    SUBHEAD    TRK    TRACK    TGT    TARGET    PDC    DT_RELEASE    STATUS    COHR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    EdlinkHR    HR1    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    EdlinkHR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010    WIP    EdlinkHR    HR  

how to create a list order and unorder using database

how to create a list order and unorder using database

How to create a list filter like: get all list elements from the current user and all employees from

Hello, is it possible to filter elements by the condition mentioned in the title? Tobias

Excel External Table Data can only create new SharePoint List when Exporting from Excel?

I have a SQL Query that I refresh everyday in Excel. I want to be able to export this list over to a SharePoint list right after my refresh in Excel but I can only Export to a SharePoint list only once. If I try to export again to the same list then it will give me the error "The specified list name is already in use on this server. You must rename the list before publishing it to the server." I have web parts that have connections to this list and I do not want to export my Query to a new SharePoint list everyday. Does anyone know a way around this issue?

Create a list definition without a Custom Content Type

is it possible to create a list definition without creating a custom content type?  I want to create a list definition and select "Custom List" and then I just want to add fields to the custom list and not create a content type that will show up in the SharePoint GUI.  Seems like to get the new fields to show up in the new and edit forms I have to add the fields to a custom content type.

Create a custom search for searcing contents of a sharepoint list

Hi, I am new to sharepoint, i am working on a assignment to create a custom search for a specific sharepoint list . I would like to implement a search by multiple filter criteria's. I am using sharepoint 2007 and with no administrator privileges to the sharepoint server. Can someone guide me with this request. Thanks,  

Create task activity break out inside a While loop

Hi I have developed a sharepoint state machine workflow. I want to assign a same task to more than one users, but unfortunatly, I cannot give the attribute "AssignTo" to more users in the code, even like this:"this.workflowTask1Properties.AssignedTo = "mydomain\\user01;mydoman\\user02", that will result in an empty value to the attribure.So, I involved the createtask activity in a While loop so I can asign deferent user in each loop, but It's very stange,  the loop always stopped in the second time, does anybody have met this issue?I have referensed Amit's question:http://social.msdn.microsoft.com/forums/en-US/windowsworkflowfoundation/thread/b238978d-f330-420c-823e-b77b0e19414d?prof=requiredbut I have no define the "correlation refernce " in my workflow.my code is here:public SPWorkflowTaskProperties workflowTask1Properties;public int abc;...private void OnWorkflowActivated(object sender, ExternalDataEventArgs e)        {            ...           this.abc = 0;           ...        }...private void CreateTask1(object sender, EventArgs e)        { 

Create list column, if column does not exist programmatically

Hi, I want to create a column in  the list programmatically. I tried this, and it created the column. But I would like to check if the list column already exist and if column does not exist, would like to create the column. How to check if a list column exists and if it does not exist, create the list column. I have used this code: [CODE] SPList MyList; MyList = currentweb.Lists[Constants.listname]; MyList.Fields.Add("FilesCount", SPFieldType.Number, false); MyList.DefaultView.ViewFields.Add("FilesCount"); MyList.DefaultView.Update(); [/CODE] Thank you
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