Can anybody tell me if this 7 line ASP script could be converted to C#?

Eloff

Active member
Joined
Mar 20, 2003
Messages
35
Location
Canada
I have the below asp code that I cant figure out how to convert to a C# windows application. It creates a graphical chart on a webpage, but Id like to create the chart on a windows form instead.

Code:
<%@ Page Language="C#"%>
// Register the control 
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
// Database Connection String
chart.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;data source=c:\mydb.mdb"; 
// A simple query: first column returned are the y axis values and the second column 
// are the x axis values. In this case the second column returnes dates.
chart.Series.SqlStatement= @"SELECT 1 AS q, addedon FROM myusers";
// We want to group dates by year/month
chart.Series.DateGrouping = "year/month";
// Show the data as an area line.
chart.Series.Type = "AreaLine";
chart.SeriesCollection.Add();
}
</script>
<HTML><HEAD><TITLE>Orders Report</TITLE></HEAD>
<BODY>
<dotnet:Chart id="chart" runat="server"/>
</BODY>
</HTML>

Thanks.
 
If the Chart control (Im assuming its a 3rd-party control) is a
Web control, then you cant use it in a Windows Forms project.
They are two totally separate entities.
 
Back
Top