Charting in ASP.NET, ASP.NET Chart Controls for .NET 3.5 SP1

Here is a HelloWorld sample on the new ASP.NET Charting control.

To begin with, install the free Microsoft Chart Controls and the "Tools for VS 2008 for Chart Controls" from here and here

Note that if you don’t install the Tools for VS 2008 for Chart controls, the Chart Server Control doesnt show up in the Toolbox

Once you are done with the installation, restart Visual Studio if you are already running the same (of course, save your work)

1. Start Visual Studio 2008 and create a File – New – ASP.NET Website or a Web Application

2. From the ToolBox, under Data tab, pick up the “Chart” control (the icon would be a series of colored bar graphs) and drag and drop it into the page.

3. Click on the smart tag for configuring the Chart control and Choose DataSource

4. Select “Database” and provide the connection string to your database server (in my case I chose Northwind)

5. Choose to save the connection string etc., and select the Database table (in my case I chose “Category Sales for 1997”)

6. Click “Finish” to complete the process.

7. Now if you run the page you will NOT get the Chart Control.

8. You need to select the Properties of the Chart Control from design view.

9. Make sure under “Data” DataSource is set to “SqlDataSource1” unless you gave a different name and DataMember is set to “DefaultView”

10. Under “Series” in Properties, click on the tab to open up the “Series Collection Editor”.

11. Scroll down the Series1 Properties to DataSource section.

12. Specify “CategoryName” as the XValueMember and “CategorySales” for YValueMembers and click Ok.

13. Build the page and hit F5 to run the page.

14. You will be able to see the Chart in your webpage.

15. Right Click on the chart and you would be able to see that it is an image generated dynamically that can be saved as a “.png” file.

You can download a comprehensive list of samples from here and verify the different implementations and source code for the same.   For more details, visit the forums here

Cheers !!!

Windows Live Tools for Visual Studio 2008

The Windows Live Team put up a neat bunch of controls that can be used in your ASP.NET Websites.  In fact once you install the Windows Live Tools for Visual Studio 2008 from http://dev.live.com/tools/ you get a few server controls in the toolbox as well as website templates for Visual Studio 2008 project/website.

I wanted to demonstrate how you can quickly add a video to your website that is being streamed from the Silverlight Streaming Service, all within 5 minutes.

Pre-requisites

1. Visual Studio 2008 or Visual Web Developer Expression Edition

2. Windows Live Tools for Visual Studio 2008 (http://dev.live.com/tools/)

3.  Your video uploaded to Silverlight Streaming Service

          i. Visit http://silverlight.live.com

          ii. Sign-in using your Live ID/Hotmail/Passport

          iii. Click on "Get it Free" Icon

          iv.  Click on "I accept Terms and Conditions"

           v.  You would receive an Account ID and Account Key (GUID ID)

          vi.  Note them for your reference for now.  You would also be able to view it every time you login.

          vii. Click on "Manage Videos" in the left

          viii. Click "Upload Video" to provide a video title as well as uploading the video.

 

Adding your uploaded video into ASP.NET Website

1. Create a File - New - ASP.NET Windows Live Website

2. From the ToolBox under "Windows Live" Tab, drag and drop "SilverlightStreamingMediaPlayer" into the page

3. Click on the smart tag ">" on the Top right of the SilverlightLightStreamingMediaPlayer control in design view.

4. Click on the tab next to the URL textbox in the "SillverlightStreamingMediaPlayer Tasks" wizard.

5. It prompts you with a dialog for providing the Account ID and the Account Key.

6. You would need to provide the same that you acquired from the steps in pre-requisites above.

7. Click on "List" and it will provide a  list of the videos uploaded by you to the Streaming Service already.

8. Select the video and click "Ok" to add it to the page.

9. You are all set to play your streaming video in your ASP.NET Website.


Cheers !!!

«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910