Skip to content

Instantly share code, notes, and snippets.

@cassioeskelsen
Created February 16, 2011 16:09
Show Gist options
  • Save cassioeskelsen/829629 to your computer and use it in GitHub Desktop.
Save cassioeskelsen/829629 to your computer and use it in GitHub Desktop.
Abrindo uma conexão com provider ADO.NET vindo de uma DLL externa no IronPython
""" Open a connection with provider in external DLL on IronPython"""
import clr
import sys
pathParaDll = r"D:\workspace\2010\projetoXPTO\packages\Sybase11"
sys.path.append(pathParaDll)
clr.AddReferenceToFile("iAnywhere.Data.SQLAnywhere.dll")
from iAnywhere.Data.SQLAnywhere import *
con = SAConnection(r"uid=USUARIO;pwd=SENHA;ServerName=SERVIDOR;links=tcpip(host=127.0.0.1); min pool size=2; max pool size=9")
con.Open()
comm.CommandText = "select * from dummy"
reader = comm.ExecuteReader()
while reader.Read():
print reader.GetInt16(0)
con.Close()
@brdsio
Copy link

brdsio commented Nov 11, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment