Working with .NET Managed Data Providers in CodeCharge Studio
Add CommentIntroduction
The release of the .NET Platform is complimented with the release of ADO.NET the new API to access databases on the .NET Platform. ADO.NET has a concept of Managed Data Providers. A Managed Provider is a group of objects that allow you to access a particular database or a particular type of data sources. Managed Providers help you to gain the maximum performance out of your data source. The .NET Framework by default carries two Managed Providers, the SQL Managed Provider to deal specifically with the Microsoft SQL Server and OleDB Managed Provider to deal with data sources having OleDb connectors. A third, Odbc Managed Provider was released separately available from here, built specially to deal with data sources having ODBC drivers. CodeCharge Studio support the usage of all three above mentioned Managed Providers. Since all vendors are free to create their own Managed Providers to interface their data source better, more Managed Providers will be released, and its not possible to address them all. May be the popular Managed Providers will get added into CodeCharge Studio going forward. But basically since most data sources have either a OleDb or ODBC connector you should not face problems interfacing any of them through CodeCharge Studio.
Selecting the Managed Provider in CodeCharge Studio
Its utmost important to use the right Managed Provider for your data
source so that our applications works correctly as well as we get
the maximum performance from our application. For example while using
MS SQL Server as the database we should always use the SQL Managed
Provider since it uses direct binary streams to communicate with the
database giving us maximum performance.
By default CodeCharge Studio uses the OleDb Managed Provider to
connect to the data source. The choosing between different Managed
Providers is done while creating a new database Connection in
CodeCharge Studio.
Configuring a database Connection
Create a new Blank Project or Open an existing project in CodeCharge
Studio. Go to the Project Explorer, right-click Connections tab and
select New Connection from the context-menu. The same New Connection
dialog is opened even if when we using Application Builders or editing
any of the previously created Connections.

Figure 1: New Connection dialog
Configuring a server
database connection
CodeCharge Studio, gives us the flexibility of defining two ways to
connect to your database i.e. we can define a connection string to be
used by CodeCharge Studio while creating our application and
optionally we can
specify an additional connection string to be used on the server where
we publish
our Web Application. Of course the database schema referenced by both
the connection strings should match else our application will
malfunction. Hence remember if a database schema is changed the same
change should be propagated to the other database also, in case you
are using two separate connection strings.
Switch to the Server tab in the Add New Connection dialog as shown in figure 2. By default the server-side database connection is configured to use the same connection string used while designing our application (indicated by the selected Same as Design checkbox).

Figure 2: Server tab of Connection dialog

Figure 3: SQL Managed Provider
Conclusion
In this article we have learnt how to configure CodeCharge Studio to
use the right .NET Managed Data Provider for your Web Application to
give you maximum performance. Plus we learnt to setup database specific
Date and Boolean type formatting schemes.

