Click here to Skip to main content
15,897,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to plot a certain field to chart from different tables in one database
This is for from 1 table how to make it from several tables?


VB
Dim tblFields As String = "select par,day_date from table1 where day_date between 2014-01-01 and 2014-01-31 order by day_date"
     Dim conn As New OleDbConnection(MDBConnString)
     Dim oCmd As New OleDbCommand(tblFields, conn)
     Dim oData As New OleDbDataAdapter(tblFields, conn)
     Dim ds As New DataSet
     conn.Open()
 oData.Fill(ds, "table1")
     conn.Close()
 Chart1.DataSource = ds. "table1")
     Dim Series1 As Series = Chart1.Series("Series1")
     Chart1.Series(Series1.Name).XValueMember = "day_date"
     Chart1.Series(Series1.Name).YValueMembers = "par"
Posted
Comments
syed shanu 14-Apr-14 4:59am    
You need to use join tables for example select a.pay,b.pay_date from table1 a inner join table2 on a.tableid=b.tableid
where a.date>getdate()
Eman Ayad 14-Apr-14 6:52am    
Thanks, but I got this error (Syntax error in JOIN operation.)
syed shanu 14-Apr-14 20:43pm    
paste your join query here and also your both table structure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900