Connect to a DB Programatically via ODBC

from Spotfire.Dxp.Data.Import import DatabaseDataSource
from Spotfire.Dxp.Data.Import import DatabaseDataSourceSettings

Category=Document.Properties["Category"]
State=Document.Properties["State"]

dbSettings=DatabaseDataSourceSettings("System.Data.Odbc","DSN=DSN Name","Dynamic SQL Query")

ds=DatabaseDataSource(dbSettings)

Document.Data.Tables["Test1"].ReplaceData(ds)
Previous
Next Post »