diff --git a/simpledata/docs/pages/Start/OpeningAConnection.html b/simpledata/docs/pages/Start/OpeningAConnection.html old mode 100644 new mode 100755 index c682d59..9d15d9a --- a/simpledata/docs/pages/Start/OpeningAConnection.html +++ b/simpledata/docs/pages/Start/OpeningAConnection.html @@ -11,7 +11,7 @@

Simple.Data

Simple.Data is a lightweight framework that uses the dynamic features of .NET 4 to provide an expressive, ORM-ish way of accessing and manipulating data without any of the code pre-generation and boilerplate required by other frameworks. In this section, we see why and how to get started with Simple.Data.

Opening A Connection

-

Once you’ve set up your connection strings in your configuration file (or not), the first action to have your code take is to open your data store. You can use one of four methods to do this.

+

Once you’ve set up your connection strings in your configuration file (or not), the first action to have your code take is to open your data store. You can use one of five methods to do this.

Open

Tries to open a connection to a data store using the connection string named Simple.Data.Properties.Settings.DefaultConnectionString in your configuration file

var defaultDb = Database.Open();
@@ -22,19 +22,20 @@ 

OpenNamedConnection(string connectionName)

var namedDb = Database.OpenNamedConnection("MvcMusicStoreDb");
 var artist2 = namedDb.Artists.FindByName("Metallica");
 Console.WriteLine("Id: {0}, Name: {1}", artist2.ArtistId, artist2.Name);
-

OpenConnection(string connectionString[, string providerName])

+

OpenConnection(string connectionString)

Tries to open a connection to a data store with the given literal connectionString.

var magicDb = Database.OpenConnection("--Your Connection String--");
 var artist3 = magicDb.Artists.FindByName("Iron Maiden");
 Console.WriteLine("Id: {0}, Name: {1}", artist3.ArtistId, artist3.Name);
-

OpenConnection has a second variant that allows you to specify the name of the Simple.Data provider that should be used to open the connection. If you’ve only one provider in your project, Simple.Data will pick it up by default. If you’d like to identify it explicitly or need to switch between two providers in you project, you’ll need to use this.

-
var magicDb = Database.OpenConnection("--Your Connection String--", "providerString");
+

Opener.OpenConnection(string connectionString[, string providerName])

+

Opener.OpenConnection allows you to specify the name of the Simple.Data provider that should be used to open the connection. If you’ve only one provider in your project, Simple.Data will pick it up by default. If you’d like to identify it explicitly or need to switch between two providers in you project, you’ll need to use this.

+
var magicDb = Database.Opener.OpenConnection("--Your Connection String--", "providerString");
 var artist3 = magicDb.Artists.FindByName("Iron Maiden");
 Console.WriteLine("Id: {0}, Name: {1}", artist3.ArtistId, artist3.Name);

In the code above, providerString can be one of the following values:

- +
ProviderString To Use
Simple.Data.SqlServerSystem.Data.SqlServer
Simple.Data.SqlServerSystem.Data.SqlClient
Simple.Data.SqlCe35sdf
Simple.Data.SqlCe40System.Data.SqlServerCe
System.Data.SqlServerCe.4.0
Simple.Data.MySqlMySql.Data.MySqlClient