Jump to content

Writeback to mySQL database using IronPython


Dony Unardi

Recommended Posts

I was able to writeback data into SQL Server database using the following IronPython code:

import clr, datetime

clr.AddReference('System.Data')

from System.Data import SqlClient

sql = "INSERT INTO ...."

conn = SqlClient.SqlConnection("Server=ServerName;Database=DBName;UID=xxxxx;PWD=xxxxx)

conn.Open()

cmd = SqlClient.SqlCommand(sql, conn)

exe = cmd.ExecuteReader()

exe.Close()

conn.Close()

I am now trying to re-create this code formySQL5.7 database and having such a hard time.

I think mybiggest issue is with the mySQL connection string.

Would be great if someone could help me with a pointer for this.

Thank you in advance.

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...