Jump to content
Xtreme .Net Talk

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


Recommended Posts

Posted

I have the below asp code that I can't figure out how to convert to a C# windows application. It creates a graphical chart on a webpage, but I'd like to create the chart on a windows form instead.

 

<%@ 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.

  • *Experts*
Posted

If the Chart control (I'm assuming it's a 3rd-party control) is a

Web control, then you can't use it in a Windows Forms project.

They are two totally separate entities.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...