ASP.NET - Binding a DataTable to a line series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
TlcDev
Newbie
Newbie
Posts: 4
Joined: Wed Jul 30, 2008 12:00 am

ASP.NET - Binding a DataTable to a line series

Post by TlcDev » Wed Sep 03, 2008 5:13 pm

Hi,

I have set up a ASP.NET page with a single WebChart. I have added a series to the WebChart of type line. I run a SQL query and get a dataset back which consists of 2 fields, a date and a measurement. When I add the series manually by using the Add method eg:

Code: Select all

line1.Add( (DateTime) dtMyDate[i], (double) myMeasurement[i] );
and loop it until I add all the measurements, it works beautifully! When I copy the data I want to a DataTable and use the overloaded method of Add with a DataTable or DataView, it will not work.

Code: Select all

line1.Add( (DataTable) dtMyData );
The 1st column is a DateTime and the 2nd column is a Double. My website is slow and needs optimization, I'm trying to plot roughly 2000 points per series with 4 series.

Adding it in a loop works but it's not optimized. I'd like to drop a chunk of data and not have so many jumps and conditional branching occurring on the server if possible.

Also, in your tutorials it says the ASP.NET WebChart uses a similar data binding technique as in the Windows form. How do I get a OleDbDataAdapter to be recognized by the WebChart component at design time in an ASP.NET session? It's not available in the toolbox. I can declare and add it to my code, but it will only get instantiated at runtime. Sorry if this is a stupid question, I'm still learning ASP.NET I am used to C/C++/Java embedded firmware development.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 04, 2008 7:50 am

Hi TlcDev,

I recommend you to read the forums threads below about this subject.

http://www.teechart.net/support/viewtopic.php?t=3337
http://www.teechart.net/support/viewtopic.php?t=3416

You may also be interested in using DataTable as shown here:

http://www.teechart.net/support/viewtopic.php?t=8206

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply