>From http://www.ironpython.info/index.php/Accessing_SQL_Server
import clr clr.AddReference('System.Data') from System.Data import * TheConnection = SqlClient.SqlConnection("server=yourserver;database=News;uid=sa;password=password") TheConnection.Open() MyAction = SqlClient.SqlCommand("Select Headline from News", TheConnection) MyReader = MyAction.ExecuteReader() while MyReader.Read(): print MyReader[0] MyReader.Close() TheConnection.Close() <http://www.ironpython.info/index.php/Accessing_SQL_Server>Davy On Thu, May 27, 2010 at 3:54 PM, Matthew Wilson <m...@tplus1.com> wrote: > I want to connect with IronPython to SQLServer 2008. I found some SAS > code (SAS is another programming language) that uses OLEDB and I have a > connection string with the server name and credentials. > > In IronPython in Action, there's an example of how to connect to a > Postgresql database, and that example has this section: > > >>> import clr > >>> clr.AddReference('Npgsql') > >>> import Npgsql as pgsql > >>> connection = pgsql.NpgsqlConnection('....') > > What do I need to use for my clr.AddReference and my import? > > Thanks in advance. > > Matt > > > > _______________________________________________ > Users mailing list > Users@lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- -- Davy Stuff - http://daftspaniel.blogspot.com Geeky Stuff - http://daftpython.blogspot.com Davy's Ironpython Editor - http://code.google.com/p/davysironpythoneditor/
_______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com