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


Similar Messages:

Use Of IEnumerator And IEnumerable

Mar 14, 2010

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

View 3 Replies

Iterator Not Iterating / Iterator Within The While Loop Returns False For The MoveNext Method?

Mar 16, 2011

I'm having trouble with something that is (or should be) fairly straight-forward.

I have a recursive method that traverses an XML file, writing out the element tag names and values.

This is a snippet from the XML file:

[code]

<root>
<all_companies>
<company_group company_group_ID_attr="1">
<company_group_name>Cleaning</company_group_name>
<company_group_ID>1</company_group_ID>
<company company_ID_attr="2">
<name>Bloomburg</name>
<company_ID>2</company_ID>
<Address>blah blah blah</Address>
<employee_refs>
<employee_ref>4</employee_ref>
</employee_refs>
</company>
<company company_ID_attr="4">
<name>Morris</name>
<company_ID>4</company_ID>
<Address>blah blah blah</Address>
<employee_refs>
<employee_ref>3</employee_ref>
<employee_ref>1</employee_ref>
</employee_refs>
</company>
<company company_ID_attr="7">
<name>Ajax</name>
<company_ID>7</company_ID>
<Address>blah blah blah</Address>
<employee_refs>
<employee_ref>4</employee_ref>
<employee_ref>2</employee_ref>
</employee_refs>
</company>
</company_group>
</all_companies>
</root>

[/code]

I use the following XPath expression to access the first <company group> tag:
"root[1]/all_companies[1]/company_group[1]"

On the first call to the recursive method ("swrite_for_select_certain_stuff"),I see with the debugger that I reach the <company_group_name> tag. A recursive call at that point takes me to the text node within the tag ("Cleaning"), but it is a text type node (not an element), so it returns without writing anything to the output stream.

On return from that second call, things go wrong. The Iterator within the while loop returns false for the MoveNext method, when it should have moved to the <company_group_ID> tag (or so I think it should).

Am I missing something here?

OS is Win XP, and .NET is version 4.0.

My code is as follows:

[Code]....

View 1 Replies

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

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

WCF / ASMX :: Cannot Get MethodName From Interface Of CallExternalMethodActivity In WWF

Nov 1, 2010

I have a api which has multiple interfaces.I have set the ExternalDataExchangeAttribute before interface like below- <ExternalDataExchangeAttribute()> _Public Interface ILOBBaseFunction IsProposalDate(ByVal value As String) As BooleanEnd InterfaceI am getting the IsProposalDate function name as MethodName after selecting the
ILOBBase Interface Type in CallExternalMethodActivity of workflow foundation.It is working fine.

View 1 Replies

WCF / ASMX :: Use Portalapi Interface Api Or Web Service?

May 7, 2010

I need to use api interface that is running on jboss and I know the addressees to use.It's something like this

http://<server_name>/portalapi/<function_name>?<parameter1>=<value1>&<parameter2>=<value2>

So the question is how I can call this api from asp.net page or web service.I'm thinking of making one web service,buil ther all this methods that are using this api call's and then returning the info.

View 6 Replies

WCF / ASMX :: Convert WSDL File To Service Contract Interface?

Feb 15, 2011

I would like to convert WSDL file to Service Contract Interface (WCF).

View 1 Replies

MVC :: Html.DisplayFor In An Iterator?

May 12, 2010

I need a way to show the display for an element in my list view like so:

[Code]....

Would it be possible to pass in a model to the DisplayFor method?

Maybe a syntax like this:

public static MvcHtmlString DisplayFor<TParentModel, TModel, TValue>(this HtmlHelper<TParentModel> html, TModel model, Expression<Func<TModel, TValue>> expression);
<%: Html.DisplayFor(item, i => i.BarBaz) %>

View 2 Replies

ADO.NET :: Getting DataReader Field Text To System.Collections.IEnumerator

Feb 22, 2011

cmd_again =
new
SqlCommand
();
cmd_again.CommandText =
"select * from QMS_Processes1 where QMSParentProcessId=" +
id + ";"
;
cmd_again.CommandType =
CommandType
.Text;
cmd_again.Connection = con_again;
rdr_again = cmd_again.ExecuteReader();
System.Collections.
IEnumerator
ienum = rdr_again.GetEnumerator();
while
(ienum.MoveNext())
{}

now i want 3 fields in datareader how do i get that?? i tried to create instance of System.data.common.dataRecordInternal..but it didnt happen.

View 4 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







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