Data Connection

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jan 13, 2004 3:49 pm

Are you using the WebChart component ?
If so, you should know that WebChart doesn’t yet work with databases at design time – however, it runs fine with databases designed at runtime. Please see “Tutorial8 – ADO.NET Database Access” for some runtime examples.

Josep Lluis Jorge
http://support.steema.com

MikeThelad
Newbie
Newbie
Posts: 7
Joined: Fri Jan 16, 2004 5:00 am
Location: UK

Post by MikeThelad » Fri Jan 16, 2004 3:01 pm

I have now purchased TeeChart and have download and installed the latest version. I have following the Tutoital8, but still I am unable to get anything to work. I am using the WebChart component, and when I compile I am getting the following:-
c:\inetpub\wwwroot\picker-results\graphtest.aspx.cs(23): The type or namespace name 'Bar' could not be found (are you missing a using directive or an assembly reference?), c:\inetpub\wwwroot\picker-results\graphtest.aspx.cs(28): The type or namespace name 'bar1' could not be found (are you missing a using directive or an assembly reference?), c:\inetpub\wwwroot\picker-results\graphtest.aspx.cs(34): The type or namespace name 'MessageBox' could not be found (are you missing a using directive or an assembly reference?)

Copy of code below:-

Code: Select all

using System.Data; 
using System.Data.OleDb; 
using System.Security; 
using System.Security.Permissions; 

namespace picker_results
{
	/// <summary>
	/// Summary description for graphtest.
	/// </summary>
	public class graphtest : System.Web.UI.Page
	{
		protected Steema.TeeChart.Web.WebChart WebChart1;

		private void InitializeComponent()
		{

		}
	
		private void Page_Load(object sender, System.EventArgs e)
		{ 
			DataSet masterDataSet = new DataSet();
			Bar bar1 = new Bar(tChart1.Chart);
			try 
			{             
				OpenConnWithJet40(ref masterDataSet);             
				DataTable employeeTable = masterDataSet.Tables["Employee"];             
				bar1.YValues.DataMember = employeeTable.Columns["SALARY"].ToString();             
				bar1.LabelMember = employeeTable.Columns["LASTNAME"].ToString();             
				bar1.DataSource = employeeTable;         
			}       
			catch (SecurityException) 
			{             
				MessageBox.Show("The calling method has not been granted sufficient permission to access the Microsoft Jet 4.0 OLE DB Provider.");
			}
					
		}   
		[OleDbPermissionAttribute(SecurityAction.Demand, Provider="Microsoft.Jet.OLEDB.4.0")] 
		private void OpenConnWithJet40(ref DataSet MasterDataSet) 
		{
			OleDbConnection testConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" +
				@"Data Source=C:\Program Files\Steema Software\TeeChart for .NET v1\Sample data\TeeChart.mdb;");
			testConn.Open();         
			string strCom = "SELECT * FROM Employee" ;
			OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom,testConn);
			myCommand.Fill(MasterDataSet,"Employee") ;
			testConn.Close(); 
		} 	
	}
			  
}

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Fri Jan 16, 2004 3:14 pm

Hello,

You could add a using to the file.

eg.

Code: Select all

using Steema.TeeChart.Styles
or add the namespace to the declaration:

eg.

Code: Select all

Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(WebChart1.Chart); 
(I put WebChart1 instead of TChart1, It seems that might be what you require there)

Something similar will be needed for MessageBox

eg.

Code: Select all

using System.Windows.Forms
Regards,
Marc Meumann
Steema Support

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Fri Jan 16, 2004 3:16 pm

BTW,

I think MessageBox is not recommendable serverside in an ASP script. You could consider returning textual info with the page output

Regards,
Marc Meumann
Steema Support

MikeThelad
Newbie
Newbie
Posts: 7
Joined: Fri Jan 16, 2004 5:00 am
Location: UK

Post by MikeThelad » Mon Jan 19, 2004 9:51 am

Thanks for this, it now compiles. When I come to run the graph, I page does not display a graph, just a x (like when a picture file is missing). I am running locally at present, I have the TeeChart.dll in the bin folder beneath the application. What I am missing ?

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Jan 19, 2004 10:01 am

Hello,

I think the simplest approach may be to compare your project to the WebForm project supplied with TeeChart.

If you are using temp files (WebChart TempChart property) to move the Chart to the page then please check that the folder has the correct write rights. If you are using 'Session' then check that you have the GetChart.aspx file as part of your project to read and return the session saved Charts.

Regards,
Marc Meumann
Steema Support

MikeThelad
Newbie
Newbie
Posts: 7
Joined: Fri Jan 16, 2004 5:00 am
Location: UK

Post by MikeThelad » Mon Jan 19, 2004 1:51 pm

I have found the graph image in c:\program files\steema softwre\TeeChart for .NET v1\TeeChartForNET\_chart_temp, my application is off IIS folder. I have now included the GetChart.aspx file in my application, still now working. How do I set the Session in order to get the file to be linked?

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Jan 19, 2004 3:00 pm

If you select the Chart on the WebForm and look at the properties browser you will see the TempChart property. Select 'Sesion' there.

Regards,
Marc Meumann
Steema Support

SpinDisc
Newbie
Newbie
Posts: 4
Joined: Mon Jun 14, 2004 4:00 am
Location: Sweden
Contact:

Post by SpinDisc » Thu Jun 17, 2004 10:13 am

So, I'm using version 1.1.1544.23908 and also have an empty Dataset dropdown in design time.

Is the WebChart still not supporting datasets at design time? If not, when is the planned release of this function?

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jun 17, 2004 4:07 pm

Hi,
Is the WebChart still not supporting datasets at design time? If not, when is the planned release of this function?
It still not supporting in the lastest release available. Will be in cluded in one of the next releases but I cannot tell for sure in which one.

Post Reply