Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2014, 02:17 AM
Authorized User
 
Join Date: Jun 2005
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default .Net Charts - Converting DataTable to IEnumerable interface

Hi,

I am using .Net Charts. It has a method DataBindTable() which takes IEnumerable as a parameter. Now I have DataTable and unable to convert it into IEnumerable. Google says there is an extension method DataTable.AsEnumerable() but it returns System.Collections.Generic.IEnumerable, however I need to convert the table into System.Collections.IEnumerable.

Also I cannot pass the data reader directly as I need to Transpose+Update the result set before passing it to the Chart. Moreover, my datatable is having dynamic rows and columns.

Kindly suggest.

Thanks,
Shazia.

Last edited by shazia1; January 17th, 2014 at 02:26 AM..
 
Old January 17th, 2014, 03:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The generic IEnumerable inherits IEnumberable from the Collections namespaces. This means you should be able to pass an IEnumberable<Something> to code that expects a regular IEnumerable. For more info: http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
LINQ to SQL / IEnumerable String Criteria Yisman ASP.NET 2.0 Professional 2 December 15th, 2008 04:54 AM
Binding IEnumerable result set of a LINQ query prakashbpl .NET Framework 3.5 0 November 11th, 2008 04:41 AM
COM .NET Interop - How to return a DataTable from jhpe VS.NET 2002/2003 1 July 19th, 2005 01:29 PM
Charts in ASP.NET lewindha BOOK: Professional Crystal Reports for VS.NET 0 October 11th, 2004 10:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.