How To Use IEnumerable Interface

Jun 9, 2010

i was looking at one example on msdn [URL], but i can't really understand it.

View 1 Replies


Similar Messages:

WCF / ASMX :: Use Ienumerable - Ienumerator And Iterator Interface In C#?

Sep 6, 2010

how I used Ienumerable and ienumerator and itreator interface in c# with Wcf I want To used Through Class. I want To used Through C#

View 6 Replies

Visual Studio :: Retrieving Values Using Ienumerable Interface

Feb 25, 2010

I have been founding an effiecent way to retreive values returned by LINQ 2 SQL stored procdure on my presentaion layer. Am using following method rightnow:-

public List<String> MthInvitesBA()
{
List<String> lst = new List<string> { "" };
ISingleResult<USP_Actor_View_InvitesDetails1Result> invites = obj.USP_Actor_View_InvitesDetails1(p_UserName);
foreach (USP_Actor_View_InvitesDetails1Result c in invites)
{
lst = new List<string> { c.Invites_Used.ToString(), c.NoOfDoc.ToString(), c.Request_For_More_Invites.ToString() };
return lst;
}
return lst;
}

It works but at the cost of my performence due boxing unboxing on BA layer as well as on design layer. Now, I have one method which returns me 100 columns from table So in this way i have convert 100 coulmns value into type string then On design layer again have to type caste some values .Moreover, i could only access this list using index which is of type integer, which is very diffcult and tedious task to debug d code. i could effiecenlt retreive these values. Is it possible using IEnumerable? How to access Ienuemerable in design layer?

View 1 Replies

Use Of IEnumerator And IEnumerable

Mar 14, 2010

refer me few article which describe the basic use of IEnumerator and IEnumerable,

View 3 Replies

ADO.NET :: How To Read IEnumerable

Mar 6, 2011

I have function it will return IEnumerable as.

IEM = myclass.getdata("name");

How to read the data in IEM as it consists of many columns. I have to display the values into labels and textboxes.

View 3 Replies

How To Convert List Into Ienumerable

May 1, 2010

I am using LINQ for data connectivity and have made class which return me the result set into presentation here is the syntax:-

public List<ClsDermaInvestigation> MthdisplayInvestigation()
{
List<ClsDermaInvestigation> lstinvst = new List<ClsDermaInvestigation>();
ISingleResult<USP_Patient_Dermatology_InvestigationResult> investresult = objderma.USP_Patient_Dermatology_Investigation(PatientID, RepDate, Hb, TLC, F);
foreach(USP_Patient_Dermatology_InvestigationResult rel in investresult)
{
ClsDermaInvestigation objinvest = new ClsDermaInvestigation();
objinvest.Albumin = Convert.ToDouble(rel.Albumin);
objinvest.ALP = rel.ALP;
objinvest.ANA = rel.ANA;
objinvest.Date = rel.date;
lstinvest.add(objinvest)}return lstinvest}
This list is returning me the result.It works fine but in 1 case am using the same list to bind my Date dropdownlist.
//aspx.cs code
List<Dermatology.ClsDermaInvestigation> objlstinvest = objinvest.MthdisplayInvestigation();
//Array s = objlstinvest.to
drpDate.DataSource = s;
drpDate.DataTextField = "Repdate";
drpDate.DataValueField = "Repdate";
drpDate.DataBind();

But it throws an error that list does not conatin a property with "Repdate";. How can i bind this list with dropdownlist?? Can i convert it into some type so that i would be able to bind it??

View 2 Replies

ADO.NET :: LINQ And Cast Row To IEnumerable?

Apr 1, 2011

table1 row = _db.table1.FirstOrDefault(r => r.ReferenceID == refNumber);

Is there anyway to cast row to IEnumerable?

((IEnumerable<table1>)row) - does not work

View 1 Replies

MVC :: Updating Model With IEnumerable?

Apr 19, 2010

I'm trying to update values I have stored in an IEnumerable using UpdateModel, but it isn't reflecting the changes when I step over it in Debug.I also tried upating it using a foreach loop and updating the values in each object T within the IEnumerable<T>. The values are changed at the object level, but it seems that the value of the object in the IEnumerable isn't being changed.I was looking at IEnumerable<T> and didn't see a way to update it... I'm thinking that I might have to assign the updates to some other data structure, then convert it to an IEnumerable or something before I try to save my repository

View 6 Replies

What Is The Difference Between IEnumerable And List

May 18, 2010

I've read some articles about this but for some reason they're just not doing it for me. I'd like to understand the difference between

IEnumerable<string> myList and List<string>myListToo

View 7 Replies

C# - Getting Two Different Data Types From IEnumerable?

Jun 29, 2010

I have IEnumerable object with value1 and value2. value2 is an array and value1 is string. I want to databind this object to Listview like that. So both value1 and value2[0] (always first item in array) could be accessed via <%# Eval("value1") %> and <%# Eval("value2") %> .

How to write expression to handle both items ?

ListViewItems.DataSource = f.Items.Select(t => t.value1, t.value2[0]);
ListViewItems.DataBind();

View 1 Replies

Retain IEnumerable<T> Value During Postback?

Mar 17, 2010

I have an IEnumerable< T> which is declared on the page like this:IEnumerable< Person> person;When the page postsback, the person list is null. How can I retain the values of person list without declaring it as static? Sr. devs in my company say that you should not declare the list as static.

View 2 Replies

Convert Datatable To IENumerable?

Feb 10, 2010

Dim list As List(Of DataRow) = dt.AsEnumerable().ToList()When I compile I get the error:
'AsEnumerable' is not a member of 'System.Data.DataTable'.I added Imports system.data.datatableextensions to the file..This code works when I run it on a asp.net project But when I use the same code in Website it returns the above error..Can anyone help solve this error.

View 2 Replies

MVC :: IEnumerable - Null Files Parameter

Feb 3, 2010

i'm using MVC 2, RC, and i have a controller method:

[Code]....

and i have an <input type="file"../> in my form. during post, however, the files parameter is null.

View 9 Replies

MVC :: JsonResult Only Returns IEnumerable Data?

Mar 31, 2010

My controller has a member that returns a JsonResult object, it is coded as per below. The problem is that Json(users) only returns the data from IEnumerable (MembershipUserEx objects) and I also want the data from the public Properties of MembershipUserExCollection as well. Is there a way to do this? I guess I am looking for the Json object to look something like this pseudo object:

results = {
pageIndex:0,
pageSize:50,

[code]...

View 1 Replies

VS 2010 - Casting SiteMapNodeCollection To IEnumerable

Feb 19, 2013

Why it's not possible to cast a SiteMapNodeCollection (eg. SiteMap.CurrentNode.ChildNodes) to an IEnumerable<SiteMapNode>? I was wanting to do some filtering of the collection via LINQ, but this might not be possible?

The MSDN page says it implements IList, ICollection, and IEnumerable, so I don't see what the problem is.

View 4 Replies

C# - IEnumerable Collection Binding To DetailsView Control

Jun 2, 2010

I have a DetailsView control which gets data from a IEnumerable custom class. But I can't get updated values from the control so I can process to update them manually in the database. How can I do that?

View 2 Replies

IEnumerable - Get The Split String Into OpensReviews List

Sep 24, 2010

I have a string which is stored as a cookie. The string is made up of the following data:

int userId
DateTime expiryDate

A user can have a number of these, so I store them like this "userId,expiryDate$userId,expiryDate"

When I retrieve the cookie value, I then split the string and add it to a list. The list is List<OpenReviews> openReviews, which contains the two variables above. I use the following piece of code to split the string:

string[][] reviews = value.Split( '$' ).Select( f => f.Split( ',' ) ).ToArray();

As you can see it goes to an array which I then have to iterate through to add it back into my list. All of which seems extremely long winded. I believe I can use the code above to put it into an IEnumerable<IEnumerable<string>> format. The problem is I don't know how to then get it into my List<OpenReviews> I'm therefore looking at getting the split string into my OpensReviews list as efficiently as possible.

View 2 Replies

C# - Paging Through IEnumerable - Retrieve Specified Line From Object

Dec 17, 2010

I have an IEnumerable object (IEnumerable<Class>) and I would like to retrieve a specified line from the object. So if I'm on page two I would like to select row two from the IEnumerable object and then pass it on to another class etc. I'm a bit stuck at the moment, any ideas?

View 3 Replies

C# - A Linq Question With IEnumerable<DataRow> Result

Dec 21, 2010

How can i convert following sql guery to LINQ in C# ? I dont need all columns from both tables and the result set should be IEnumerable<DataRow>

select c.level,cl.name,c.quantity
from dbo.vw_categories c
left join dbo.vw_categoriesLocalization cl on c.level = cl.level and cl.language = 'en'
where c.level like '000%' and c.level <> '000';

View 2 Replies

Web Forms :: Can't Retrieve Properties From IEnumerable Object

Aug 27, 2010

I'm trying to retrieve 3 properties from an IEnumerable object. But cant!

The 3 properties are:

serier
dage
stofnavn

This is how the code is

[Code]....

View 3 Replies

DataSource Controls :: Convert An Ienumerable To A Datatable() VB.net?

May 24, 2010

I am having trouble converting a ienumerable to a datatabe here is the code:The problem is in the following line-

ViewState("dt") = elements.CopyToDataTable()
Dim dt As New DataTable
Private Sub DisplayAuthorLastName(ByVal strLetter As String)

[code]...

View 7 Replies

MVC :: No ViewData Item Of Type 'IEnumerable' That Has The Key 'Carrera'?

Sep 6, 2010

When running the HttpGet action, it works fine. But when I run the HttpPost action, I recieve the error in the title.

Is it because the HttpPost doesn't have a ViewData declared?

[Code]....

View 3 Replies

Write A Class For Retrieving IEnumerable Objects In EF And C#?

Mar 7, 2011

In my Code Behind I use several times this code below to bind and rebind (for refresh) e GridView after an insertion or other operations completed using EF objects.

Using a simple gridview.DataBind(); does not work because I call EF programmatically so I thought to use a Class to keep in memory this code that can create Objects for my GridView and call it how many time I need in my code avoiding redundancy.

IEnumerable<CmsContent> queryContents = myCurrentSlot.CmsContents.Where(x => x.IsPublished == true);
uxManageContents.DataSource = queryContents;
uxManageContents.DataBind();

Or do you know a batter way to Refresh the gridview after EF executing some commands? how to do it?

remember that I do use any data source web control for the gridview but i bind it programmatically.

View 1 Replies

ADO.NET :: WCF Entity Framework - Convert IEnumerable To Datatable?

Oct 13, 2010

We are using WCF and ADO.NET entity framework in our ASP.NET 4.0 application. we are using Entity Framework in our WCF service to execute a storedprocedure and return the results.

[WebGet]
public List<Cs_MT> GetSearchResult(string emailId, string localTitle, string colorGrouping)
{[code]....

We are calling the WCF service from our client application and get the results as IEnumerable

IEnumerable<GetSearchResult_ByEmail_Result> SearchResult = dsContext.Execute<GetSearchResult_ByEmail_Result>(new Uri(url));

I want to loop through the records and form a new table. How to loop through it and read the values?Or How to convert IEnumerable to Datatable?

View 3 Replies

MVC :: RenderPartial Partial View With IEnumerable Not Working?

Feb 1, 2011

[Code]....

And here is the partial view:

[Code]....

I get:

The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments

What is the proper syntax? I have tried many alernate objects.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved