Jump to content
  • Using .net System.Data.SqlClient module for database writeback in Spotfire® using IronPython


    This example provides a sample for database write back to Microsoft SQL Server (MSSQL) using .net System.Data.SqlClient module

     

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    import clr, datetime
    clr.AddReference('System.Data')
    from System.Data import SqlClient
    from System import Threading, DateTime
    
    sql = "INSERT INTO Companies values (123,'Tibco','US')"
    
    conn = SqlClient.SqlConnection("Server=mssqldatabase;Database=mydatabase;UID=spotfire;PWD=spotfire")
    conn.Open()
    
    cmd = SqlClient.SqlCommand(sql, conn)
    exe = cmd.ExecuteReader()
    
    exe.Close()
    conn.Close()
     

    See also

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...