Read a database to display graph in .NET

Jun 2, 2008
163
0
0
Does anyone know of a guide that shows how to do this?

I'm trying to read a database into a array, two parts.

Day and Cost

I want to read this and plot it on a bar graph.

I would like to make it dynamic so I can choose my Days and then create the graph.

http://www.prestigedevgroup.co...TutorialAjaxPage2.aspx

I'm working with this code..

Specifically, the area I'm having a problem with is.


****

Chart.LabelsX.Add("Monday")
...

Chart.LabelsX.Add("Friday")

and

H.Add("Monday", 10)

...


H.Add("Sunday", 35)

****

This part above needs to be read from a database, what would be the best technique to read tables that have these two columns?

Thanks
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
You didn't specify which database you're connecting too. Do you already have a dataset object populated with the data you want to display?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Which version of .NET? If you are using 2.0 you can use DataSets, but if you are using 3.5 you should look into LINQ.
 
Jun 2, 2008
163
0
0
Sorry, well in the long run it's gonna be a Oracle database but for now I'm going to use what Visual Studio 2005 has which is SqlExpress. I'm using 2.0.

I don't think LINQ can work with Oracle 10g right?

Edit: Is the proper term for this an ArrayList that is being used in the linked example from above?
 

imported_Dhaval00

Senior member
Jul 23, 2004
573
0
0
LINQ is an ORM. It works with Oracle - no issues (at least none that I have come across yet). If you're using .NET 2.0, stick to DataSets.

I should warn you, though, that none of my code has been deployed to production yet. So, I don't know how well it performs. Also, I haven't used the LINQ Designer for mapping to Oracle objects, because VS2008 simply won't allow it from within Server Explorer. I have been using LINQ to DataSet for all my Oracle work.

I am playing around with the DBLinq provider for Oracle, Postgres, and MySQL found here: http://code2code.net/DB_Linq/. I haven't found any issues with it, but I am not sure what the library does under the covers [just need to spend some time with the library's source code].
 

SoundTheSurrender

Diamond Member
Mar 13, 2005
3,126
0
0
Thanks, I read somewhere that only MS SQL has LINQ capabilities so I ignored it. I still don't know much about it, only from the video I saw. The guy made a totally customizable table with no coding. I guess I should read into it more.

The situation we're in is my supervisor ordered Visual Studio 2008 so we can use 3.5 if we want to. I just know more about 2005 but I'm no Pro.