dotConnect for SQL Server Documentation
In This Topic
    Samples Overview
    In This Topic

    dotConnect for SQL Server samples are divided into 4 categories: General demos, Web demos, Web Service sample, and CRM demo project. You can open all of them from the Start menu group. The General samples demonstrate how to work with components, classes, technologies, and also the usage of individual data access features, Web samples show how to use dotConnect for SQL Server in ASP.NET environment, and the CRM demo shows some good design and implementation practices that you can employ with dotConnect for SQL Server.

    Note: in the Standard edition of dotConnect for SQL Server some samples are not available.

    General Samples

    General samples are demos that demonstrate working with dotConnect for SQL Server classes, components, and technologies.

    Use the Start menu group to open General samples in the language you prefer. You can also run the compiled binary, which incorporates all General samples and provides quick access to C# source, necessary SQL scripts, and run-time state.

    Sample Description
    Crystal This sample project demonstrates using dotConnect for SQL Server for generating reports with Crystal Reports. Be aware that this project requires Crystal Reports, which is no longer included with Visual Studio 2010 and higher. You have to download and install Crystal Reports separately: http://scn.sap.com/docs/DOC-7824 . Then update references to the CrystalDecisions.* assemblies and rebuild the solution.
    DataReader This sample project demonstrates using SqlDataReader class to obtain data from a query. The sample executes SQL statement at the SqlCommand and gets SqlDataReader to retrieve data.
    DataSet This sample project demonstrates using untyped dataset with dotConnect for SQL Server to review and update data. The sample uses SqlDataAdapter to fill a dataset and post updated data to SQL Server database. SqlDataAdapter uses SqlCommandBuilder class to automatically generate SQL queries for INSERT/UPDATE/DELETE operations.
    DbDataTable This sample project demonstrates data mapping from SQL Server tables and paginal access. The sample uses SqlDataTable component to access data from a table and display this data in the DataGrid control.
    Note: this sample is available only in Professional Edition.
    Dependency

    The Dependency demo project illustrates how to use the data dependency technique. The sample watches for some tables in the database. As you modify their data, the name of the table being edited is shown in a list.

    Note that SQL Server puts numerous restrictions on SELECT statements that can be monitored this way. For detailed information refer to Creating a Query for Notification topic in MSDN. Its online version can be found at http://msdn2.microsoft.com/en-us/library/ms181122.aspx.

    Loader

    This sample project demonstrates working with the SqlLoader component. SqlLoader's work is based on generation of INSERT statements that insert data by several rows for one time.
    Note: this sample is available only in Professional Edition.

    MasterDetail This sample project demonstrates setting master-detail relation in an untyped dataset. The sample fills two tables in a dataset using SqlDataAdapter and sets master-detail relation between them.
    MetaData This sample project shows how to retrieve information about databases, tables, columns, users, and so on. The only method used for these tasks is GetSchema.
    Pictures This sample project demonstrates using dotConnect for SQL Server for working with BLOB objects as graphics. The sample demonstrates how to retrieve binary data from SQL Server database and display it at the monitor, load and save pictures into the file and the database.
    StoredProc This sample project demonstrates how to execute a stored procedure and view modified data.
    Table This sample project demonstrates data mapping from SQL Server tables. The sample sets CommandType property of SqlCommand to TableDirect to access data from the table.
    Transactions This sample project demonstrates working with SQL Server transactions in dotConnect for SQL Server. The sample demonstrates how to get a SqlTransaction object from a SqlConnection object, how to commit or rollback a transaction.

    Note: before running sample projects from an IDE you need to execute commands from Program Files\Devart\dotConnect\SQL Server\Samples\tables.sql to create test data. If C++ projects fail to open, it is possible that you do not have the assemblies Devart.Data.SqlServer.dll and Devart.Data.dll in GAC or project's folder.

    Web Samples

    Run InstallWebTables.sql script by default located in the Program Files\Devart\dotConnect\SqlServer\InstallWebTables.sql. Use the Start menu group to open Web samples in the language you prefer.

    Sample Description
    AjaxDemo This sample demonstrates data binding and editing in an asynchronous way. The sample uses SqlDataSource component in conjuction with ASP.NET AJAX Update Panel.
    Note: this sample is available only in Professional Edition.
    CRM This sample demonstrates how SqlDatasource can be used in the complex software product such as CRM (Customer Relationship Management).
    The sample illustrates how to perform data retrieving and editing in the complex scenario using SqlDataSource.
    Note: this sample is available only in Professional Edition.
    DataSource This sample shows how to use the SqlDbDataSource component of dotConnect for SQL Server. The sample illustrates using of manual paging, auto paging and master-detail techniques with SqlDataSource component.
    Note: this sample is available only in Professional Edition.
    DataSource_devExpress This sample demonstrates using SqlDataSource with DevExpress ASPxGridView component. The ASPxGridView component uses SqlDataSource to perform asynchronous data retrieving and paging.
    Note: this sample is available only in Professional Edition.
    LoadOnDemand This sample demonstrates the load-data-on-demand technique with the dotConnect for SQL Server components.
    The sample shows how to use SqlDataSource and ObjectDataSource to retrieve data from DB asynchronously and only on user demand.
    Note: this sample is available only in Professional Edition.
    LoadOnDemand_Telerik This sample demonstrates load-data-on-demand technique with SqlDataSource component in conjuction with Telerik RadGrid control.
    Note: this sample is available only in Professional Edition.
    Web A sample on simple usage of dotConnect for SQL Server in an ASP.NET application.
    WebProviders This sample shows how to use dotConnect for SQL Server with ASP.NET Providers Model.

    The first part of the WebProviders sample illustrates usage of WebParts, SiteMap, WebEvent, and SessionState Providers, and the second - of Membership, Roles, and Profile Providers.
    Note: this sample is available only in Professional Edition.

    Web Service

    Sample Description
    Server This sample illustrates creating a web service with dotConnect for SQL Server. In the provided web method dotConnect for SQL Server classes are used to fill DataSet and return it to a client.
    WebClient This sample demonstrates using of the web service by the web client. The data recieved from web service is shown in GridView control.
    WinClient This sample demonstrates using of the web service by the WinForms client. The data recieved from web service is shown in the DataGridView control.

    CRM Demo

    CRM (Customer Relationship Management) is a widespread class of projects in which you can encounter many typical tasks of database applications development. This sample shows how these tasks can be resolved in the scope of approaches that are offered by dotConnect for SQL Server data access solution for designing and building WinForms applications. By examining the source code of CRM demo you can see how the advanced features of dotConnect for SQL Server help you build a centralized data access and storage solution. Particularly, it solves common problems like implementing flexible data binding, passing instances of data access components, controlling database connections, and so on. For more information on the best practices in the area of data access please refer to the General Concepts in Database Application Development section of dotConnect for SQL Server documentation.

    To see how it works launch the compiled binary from the Start menu. It is required that you create a test database for this demo on the first launch.

    Note: this demo is available only in Professional Edition. Also there is similar demo for ASP.NET; more detailed information on it is provided in the Web samples section.