By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,965 Members | 2,043 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,965 IT Pros & Developers. It's quick & easy.

binding pivotchart to sql

P: 2
i m a novice and dun't know much abt office components..i have written this code to bind my pivot chart with the sql server. but till now i m not successful at all..........plz do help me to bind sql with the pivot chart of ms excel........thanks



Private Sub cspace_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cspace.Enter

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''
Dim connString As String = "Server=awais;Database=statlogs;integrated security=true"
Dim Sql As String = "SELECT * FROM designfile " 'WHERE lastname =" + TextBox1.Text
Dim Conn As SqlConnection = New SqlConnection(connString)
Dim DS As DataSet = New DataSet
Dim Adp As SqlDataAdapter = New SqlDataAdapter(Sql, Conn)
Adp.Fill(DS, "test")
ptable.ConnectionString = "Server=awais;Database=statlogs;integrated security=true"
DataGridView1.DataSource = DS.Tables(0).DefaultView
'ptable.datasource = msdatasrc.DataSource((object) ds.table[0])
'ptable.datasource = (msdatasrc.DataSource)((object)ds.table[0])

'''''''''''''''ptable.DataSource = (DataSource)(DS.Tables(0))
ptable.DataSource = (DataSource)(DS.Tables(0))


Conn.Close()
Apr 9 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.