|
GettingStarted
Getting started with ironruby-dbi.
Featured IntroductionThe DBI implementation for IronRuby has a special connection string to allow specifying a provider to use. DetailsTo get started with ironruby-dbi you can reference the documentation of the ruby-dbi project. There is one difference in the way you connect to a database. In ruby-dbi the connection string to a mssql database would be something like: DBI.connect('DBI:ADO:data source=(local);initial catalog=MyDatabase;user id=user;password=password') To connect to the same database but using ADO.NET you would write the following connection string. DBI.connect('DBI:ADONET:MSSQL:data source=(local);initial catalog=MyDatabase;user id=user;password=password') There has been an extra colon defined to select the provider that ADO.NET should use to access the database. So instead of just specifying the driver DBI:ADO: which is ADO in this example. You now have to tell DBI that it needs to use the ADO.NET driver with the MSSQL provider DBI:ADONET:MSSQL. The providers that are installed by default are:
I also installed the MySQL .NET connector library and the Sqlite providers so for me the following 2 are also available:
| |||||||||||||||||||||||||||