Created
February 16, 2011 16:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" 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
commented
Nov 11, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment