alsam
asked on
How to populate axspreadsheet from SQL Server db
Hi, can enyone provide me with the code how can I populate my axspreadsheet with data from SQL Server database...
I tried with the code below but it does not work
"Unable to cast object of type 'System.Windows.Forms.Bind ingSource' to type 'msdatasrc.DataSource'."
Please help...
I would apprecate a lot...
I tried with the code below but it does not work
"Unable to cast object of type 'System.Windows.Forms.Bind
Please help...
I would apprecate a lot...
Private Sub GetData(ByVal selectCommand As String)
Try
Dim connectionString As String = My.Settings.ControllingConnectionString
Me.dataAdapter = New SqlDataAdapter(selectCommand, connectionString)
Dim commandBuilder As New SqlCommandBuilder(Me.dataAdapter)
table.Locale = System.Globalization.CultureInfo.InvariantCulture
Me.dataAdapter.Fill(table)
Me.AxSpreadsheet1.DataSource = table
Catch ex As SqlException
MessageBox.Show("NOK")
End Try
End Sub
ASKER
It is specified in My.Settings.ControllingCon nectionStr ing
Its not a problem....
Its not a problem....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Right
Dim connectionString As String = "Data Source=localhost;Initial Catalog=DatabaseName;User Id=sa;Password=pass"