binding pivotchart to sql

omar_aa

New member
Joined
Apr 9, 2008
Messages
1
Programming Experience
Beginner
hi !

i have written the following code to programmatically bind the pivot chart with sql server but till now i m not getting any success. i am pasting my code below.plz help me .thanks.



Dim oconnection As SqlClient.SqlConnection = New SqlClient.SqlConnection("Server=awais;Database=statlogs;integrated security=true")

oconnection.Open()

Dim oselectcommand As New SqlClient.SqlCommand("select date from designfile", oconnection)

Dim odataAdapter As New SqlClient.SqlDataAdapter(oselectcommand)

ptable.ConnectionString = "Server=awais;Database=statlogs;integrated security=true"

Dim odataset As New DataSet("ptable")

odataAdapter.Fill(odataset, "abc")

ptable.DataSource = ptable

ptable.DataMember = "196$"

'cspace.DataSource = ptable

oconnection.Close()
 
What does "not getting any success" mean, more specifically? Also, what's a "pivot chart"? It's not a standard .NET control so you might need to explain it for those of us who don't read minds.

Now I look at your code more closely, maybe this is the problem:
VB.NET:
ptable.DataSource = ptable
I don't think binding something to itself will be to helpful. You aren't doing anything there that would get the data from the "abc" table of your odataset into your chart.

Also, why would you call a DataTable "abc" when the data is coming from the Date column of the DesignFile table? There's two pretty good candidates for table names there.
 
Back
Top