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
Similar Messages:
Jun 9, 2010
i was looking at one example on msdn [URL], but i can't really understand it.
View 1 Replies
Mar 14, 2010
refer me few article which describe the basic use of IEnumerator and IEnumerable,
View 3 Replies
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Nov 23, 2010
How I can bind in my ActionResult IEnumerable property in Model.
Objects:
public class Project
{
public int ProjectID {get;set;}
public IEnumerable<Category> Categories {get;set;}
}
[Code]....
View 15 Replies