Welcome to ComponentOne DataObjects for .NET

Untitled Document ComponentOne Data for .NET Untitled Document E-mail sent to documentation@componentone.com is for documentation feedback only. We welcome any suggestions to help improve our documentation.

Welcome to ComponentOne DataObjects for .NET

ComponentOne DataObjectsÔ for .NET includes two editions to provide you with a choice of tools to best suits your needs: the Enterprise edition (also referred to as simply C1DataObjects) and Express edition (also referred to as C1DataExpress). Both editions are included in ComponentOne Studio for .NET, so there is no need to buy another if you already own one of them. The difference between the editions is in design-time interface and in the level of required user expertise.

DataObjects for .NET is a data framework for Microsoft Visual Studio.NET developed by ComponentOne LLC.

ComponentOne has a user-friendly distribution policy. We want every programmer to obtain a copy of DataObjects for .NET to try for as long as they wish. Those who like DataObjects and find it useful may buy a license for a reasonable price. The only restriction is that unlicensed copies of DataObjects for .NET will display a ComponentOne banner every time they are loaded to remind developers to license the product.

We hope you will like DataObjects for .NET. If you have suggestions or ideas for new features or new tools, please call us or write.

ComponentOne LLC
201 South Highland Avenue
3rd Floor
Pittsburgh, PA 15206 USA
412.681.4343
412.681.4384 (Fax)

http://www.componentone.com

ComponentOne DataObjects Enterprise Edition (C1DataObjects)

ComponentOne DataObjects Express Edition (C1DataExpress)

Product Profile

What's New in ComponentOne Data for .NET

Installing DataObjects for .NET

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

Licensing FAQs

Technical Support

Redistributable Files

Namespaces

Creating a .NET Project

Adding C1DataObjects Components to the Toolbox

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ComponentOne DataObjects Enterprise Edition (C1DataObjects)

ComponentOne DataObjects Enterprise Edition (C1DataObjects)

The ComponentOne DataObjects Enterprise Edition is a comprehensive data and business objects framework that can be used in .NET applications of any range, scalability and architecture, from simple desktop applications to classic client-server applications to 3-tier distributed applications and enterprise-wide business object libraries. In fact, it is in 3-tier applications and enterprise-wide business where C1DataObjects is the most useful, the most productivity enhancing and time saving. Learning C1DataObjects is easy enough, in fact we think it is easier to master than the standard ADO.NET, but still, it requires certain effort. On the other hand, many developers do not need its full functionality, they want a really easy to use (but still enough powerful) tool to provide data functionality in .NET applications. This is the rationale behind C1DataExpress.


ComponentOne DataObjects Express Edition (C1DataExpress)

ComponentOne DataObjects Express Edition (C1DataExpress)

The ComponentOne DataObjects Express Edition is a data framework that is very easy to use, with virtually no learning curve at all. It makes data access and data binding in .NET applications a matter of a few clicks (maybe a little more than a few in more complicated cases), providing the same or higher level of rapid application development as used to exist in pre-.NET Visual Studio data controls and tools. C1DataExpress supports almost all important functionality of C1DataObjects except 3-tier and business object architecture. If you develop 3-tier distributed applications, or if you want to develop a business object library for use in different applications throughout the enterprise, we recommend using C1DataObjects Enterprise Edition. Otherwise, we suggest to try C1DataExpress.


Product Profile

Product Profile

ComponentOne Data Objects for .NET (C1DataObjects) is a comprehensive framework for creating database applications. It is integrated with other components of ComponentOne Studio for .NET to provide you with all the necessary tools for application development.

C1DataObjects is based on Microsoft ADO.NET technology and enhances it in many ways to empower and simplify database application development in Visual Studio .NET:

· C1DataObjects uses the standard business object paradigm to allow you to develop business logic components (data libraries) and reuse them in multiple client projects. It provides clear separation of business and data logic from the presentation (GUI) layer.

· C1DataObjects allows you to expose data to users and client applications in a structured consistent way, so that all structural dependencies are maintained automatically without manual coding.

· Unlike other business object, data object and data persistence frameworks, C1DataObjects fully supports multi-table objects, what is called a composite table in C1DataObjects.

· C1DataObjects completely automates the task of developing distributed 3-tier web-based applications. No special server-based code is necessary, and making your application distributed becomes a simple matter of deployment configuration.

· With an innovative virtual mode technology, C1DataObjects allows you to use large datasets in .NET Windows Forms applications, the feature that is not supported in Visual Studio .NET and ADO.NET without C1DataObjects.

· Combining C1DataObjects virtual mode and distributed applications technologies, you can make creating sophisticated, fully scalable web-based distributed applications a matter of point-and-click, as easy as creating a simple desktop application used to be in the good old Visual Basic.

· In enterprise development, C1DataObjects allows to create a centralized and reusable repository of data schema and business logic (data libraries) used in applications throughout the enterprise.


What's New in ComponentOne Data for .NET

What's New in ComponentOne Data for .NET

This documentation was last revised on July 1, 2005.


Feature Overview

Feature Overview

There are no new features in DataObjects for .NET at this time.


Installing DataObjects for .NET

Installing DataObjects for .NET

This section describes the setup files and system requirements for DataObjects for .NET. It also explains how to install demonstration versions of ComponentOne products and uninstall DataObjects for .NET.

DataObjects for .NET Setup Files

System Requirements

Installing Demonstration Versions

Uninstalling DataObjects for .NET


DataObjects for .NET Setup Files

DataObjects for .NET Setup Files

The installation program will create the directory C:\Program Files\ComponentOne Studio.NET, which contains the following subdirectories:

bin | Contains copies of all binaries (DLLs, EXEs) in the ComponentOne Visual Studio.NET package.
Common | Contains support and data files that are used by many of the demo programs.
Help | Contains online documentation for all Studio components.
DataExpress and Data Objects | Contains samples and tutorials for DataExpress for .NET and DataObjects for .NET


System Requirements

System Requirements

· Operating Systems:

- Windows 2000

- Windows 2003 Server

- Windows NT 4

- Windows XP, sp1, sp2

· Environments:

- .NET Framework 1.0

- .NET Framework1.1

- C# .NET

- Delphi

- Visual Basic .NET

· Hard Disk Space: 35 mb hard disk space for storage of the software

· Disc Drive: CD or DVD-ROM drive if installing from CD


Installing Demonstration Versions

Installing Demonstration Versions

If you wish to try DataObjects for .NET or any of our other products and do not have a registration key, follow the steps through the installation wizard and use the default serial number.

The only difference between unregistered (demonstration) and registered (purchased) versions of our products is that registered versions will stamp every application you compile so a ComponentOne banner will not appear when your users run the applications.


Uninstalling DataObjects for .NET

Uninstalling DataObjects for .NET

To uninstall DataObjects for .NET, open the Control Panel and select the Add or Remove Programs. Select DataObjects for .NET and click the Remove button.


END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

IMPORTANT-READ CAREFULLY: This End User License Agreement (this "EULA") contains the terms and conditions regarding your use of the SOFTWARE (as defined below). This EULA contains material limitations to your rights in that regard. You should read this EULA carefully and treat it as valuable property.

I. THIS EULA.

1. Software Covered by this EULA. This EULA governs your use of the ComponentOne, LLC ("C1") software product(s) enclosed or otherwise accompanied herewith (individually and collectively, the "SOFTWARE"). The term "SOFTWARE" includes, to the extent provided by C1: 1) any revisions, updates and/or upgrades thereto; 2) any data, image or executable files, databases, data engines, computer software, or similar items customarily used or distributed with computer software products; 3) anything in any form whatsoever intended to be used with or in conjunction with the SOFTWARE; and 4) any associated media, documentation (including physical, electronic and on-line) and printed materials (the "Documentation").

2. This EULA is a Legally Binding Agreement Between You and C1. If you are acting as an agent of a company or another legal person, such as an officer or other employee acting for your employer, then "you" and "your" mean your principal, the entity or other legal person for whom you are acting. However, importantly, even if you are acting as an agent for another, you may still be personally liable for violation of federal and State laws, such as copyright infringement.

This EULA is a legally binding agreement between you and C1. You intend to be legally bound to this EULA to the same extent as if C1 and you physically signed this EULA. By installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms and conditions contained in this EULA. If you do not agree to all of the terms and conditions contained in this EULA, you may not install or use the SOFTWARE. If, for whatever reason, installation has begun or has been completed, you should cancel installation or un-install the SOFTWARE, as the case may be. (You may click on the "exit" button or its equivalent to immediately abort installation.) If you do not agree to all of these terms and conditions, then you must promptly return the SOFTWARE to the place of business from which you obtained it in accordance with any return policies of such place of business. Return policies may vary between or among resellers, and you must comply with your particular reseller's return policies as agreed at the point of purchase. If the place of business from which you purchased the SOFTWARE does not honor a complete refund for a period of thirty (30) days from the date of proof of purchase, then you may return the SOFTWARE directly to C1 for a period of thirty (30) days from the date of your purchase. To return the product directly to C1, you must obtain a C1 Return Authorization Number by contacting C1, and you must forward all items purchased, including the proof of purchase, directly to C1. The return must be postage-prepaid, and post-marked within thirty (30) days from the proof of purchase, time being of the essence. The return option to C1 is only available to the original purchaser of an unopened factory packaged item.

II. YOUR LICENSE TO DEVELOP AND TO DISTRIBUTE.

As provided in more detail below, this EULA grants you two licenses: 1) a license to use the SOFTWARE to develop other software products (the "Development License"); and 2) a license to use and/or distribute the Developed Software (the "Distribution License"). Both of these licenses (individually and collectively, the "Licenses") are explained and defined in more detail below.

1. Definitions. The following terms have the respective meanings as used in this EULA:

"Network Server" means a computer with one or more computer central processing units (CPU's) that operates for the purpose of serving other computers logically or physically connected to it, including, but not limited to, other computers connected to it on an internal network, intranet or the Internet. "Web Server" means a type of Network Server that serves other computers more particularly connected to it over an intranet or the Internet.

"Developed Software" means those computer software products that are developed by or through the use of the SOFTWARE. "Developed Web Server Software" means those Developed Software products that reside logically or physically on at least one Web Server and are operated (meaning the computer software instruction set is carried out) by the Web Server's central processing unit(s) (CPU). "Developed Legacy Software" means those Developed Software products that are not Developed Web Server Software, including, for example, stand-alone applications and applications accessed by a file server only. "Redistributable Files" means the SOFTWARE files or other portions of the SOFTWARE that are provided by C1 and are identified as such in the Documentation for distribution by you with the Developed Software. "Developer" means a human being or any other automated device using the SOFTWARE in accordance with the terms and conditions of this EULA.

"Developer Seat License" means that each Developer using or otherwise accessing the programmatic interface or the SOFTWARE must obtain the right to do so by purchasing a separate End User License.

“Source Code” shall mean computer software code or programs in human readable format, such as a printed listing of such a program written in a high-level computer language. The term "Source Code" includes, but is not limited to, documents and materials in support of the development effort of the SOFTWARE, such as flow charts, pseudo code and program notes.

2. Your Development License. You are hereby granted a limited, royalty-free, non-exclusive right to use the SOFTWARE to design, develop, and test Developed Software, on the express condition that, and only for so long as, you fully comply with all terms and conditions of this EULA.

The SOFTWARE is licensed to you on a Developer Seat License basis.

The Developer Seat License means that you may perform an installation of the SOFTWARE for use in designing, testing and creating Developed Software by a single Developer on one or more computers, each with a single set of input devices, so long as such computer/computers is/are used only by one single Developer at any given time and not concurrently. Conversely, you may not install or use the SOFTWARE on a computer that is a network server or a computer at which the SOFTWARE is used by more than one Developer. You may not network the SOFTWARE or any component part of it, where it is or may be used by more than one Developer unless you purchase an additional Development License for each Developer. You must purchase another separate license to the SOFTWARE in order to add additional developer seats, whether the additional developers are accessing the SOFTWARE in a stand-alone environment or on a computer network.

In all cases, you may not use C1's name, logo, or trademarks to market your Developed Software without the express written consent of C1; (b) you must include the following C1 copyright notice in your Developed Software documentation and/or in the "About Box" of your Developed Software, and wherever the copyright/rights notice is located in the Developed Software (“Portions Copyright © ComponentOne, LLC 1991-2002. All Rights Reserved.”); (c) agree to indemnify, hold harmless, and defend C1, its suppliers and resellers, from and against any claims or lawsuits, including attorney's fees that may arise from the use or distribution of your Developed Software; (d) you may use the SOFTWARE only to create Developed Software that is significantly different than the SOFTWARE.

3. Your Distribution License.

License to Distribute Developed Software. Subject to the terms and conditions in this EULA, you are granted the license to use and to distribute Developed Software on a royalty-free basis, provided that the Developed Software incorporates the SOFTWARE as an integral part of the Developed Software in machine-language compiled format (customarily an ".exe", or ".dll", etc.). You may not distribute, bundle, wrap or subclass the SOFTWARE as Developed Software which, when used in a "designtime" development environment, exposes the programmatic interface of the SOFTWARE. You may distribute, on a royalty-free basis, Redistributable Files with Developed Software only.

4. Specific Product Limitations. Notwithstanding anything in this EULA to the contrary, if the license you have purchased is for any of the following products, then the following additional limitations will apply:

a. ComponentOne Reports for .NET Designer Edition. ComponentOne Reports for .NET Designer Edition includes at least: 1) one dynamic link library (c1.win.c1reportdesigner.dll) file known as C1ReportDesigner Component, 2) one executable (ReportDesigner.exe) file known as C1ReportDesigner Application and, 3) the Source Code of the C1ReportDesigner Application. The C1ReportDesigner Component is subject to the general terms and restrictions set forth in this EULA. The C1ReportDesigner Application is an executable file used to design and prepare reports; the C1ReportDesigner Application may be distributed, free of royalties, only in conjunction with the Developed Software.

Subject to the terms and conditions in this EULA, C1 hereby grants you the right to use the C1ReportDesigner Application Source Code. You are hereby also granted the right to modify such Source Code and to create derivative works that are based on the licensed Source Code. You may distribute the derivative works that you develop, solely in object code format and exclusively in conjunction with and/or as a part of the Developed Software. You are expressly not granted the right to distribute, disclose or otherwise make available to any third party the licensed Source Code, any modified version, derivative work, or any portion thereof, in source code format.

C1 shall retain all right, title and interest in and to the licensed Source Code, and all C1 updates, modifications or enhancements thereof. Nothing herein shall be deemed to transfer any ownership or title rights in and to the licensed Source Code from C1 to you.

SOURCE CODE IS LICENSED TO YOU AS IS. C1 DOES NOT AND SHALL NOT PROVIDE YOU WITH ANY TECHNICAL SUPPORT FOR YOUR SOURCE CODE LICENSE.

b. VSView Reporting Edition. VSView Reporting Edition includes at least one executable file listed as “VSRptX.exe” (where X indicates the version number i.e.7,8, etc.), known as “Designer.” The file "VSRptX.exe”, or any upgrade or future versions of the Designer, are subject to the restrictions set forth in this EULA and may not be distributed with your Developed Software or in any other way.

c. Doc-to-Help and ComponentOne Natural Search. You may use Doc-To-Help to create online help, manuals or other documentation in electronic or printed format (the "Output Documents"). You may distribute and incorporate in such Output Documents those files identified in the documentation as Redistributable Files. Except for those specific Redistributable Files, you MAY NOT distribute the SOFTWARE, in any format, to others.

d. Studio Products. You may not share the component parts of the Studio Products licensed to you with other Developers, nor may you allow the use and/or installation of such components by other Developers.

e. ComponentOne Response and SOAP Channel. ComponentOne Response is intended to be installed on a Network Server. C1 grants to you the following rights to the SOFTWARE: a) Installation: You may install one copy of the SOFTWARE on a single Network Server; b) Use: When installed and initialized, the SOFTWARE creates a database file which contains the embodiment of a solution knowledge base (the database hereinafter referred to as the "Knowledge Base").

You may use the SOFTWARE to create Knowledge Bases on one Network Server only. To create or to operate Knowledge Bases in more than one Network Server, you must purchase one additional SOFTWARE license for each additional Network Server.

5. Updates/Upgrades; Studio Subscription. Subject to the terms and conditions of this EULA, the Licenses are perpetual. Updates and upgrades to the SOFTWARE may be provided by C1 from time-to-time, and, if so provided by C1, are provided upon the terms and conditions offered at that time by C1 in its sole discretion. C1 may provide updates and upgrades to the SOFTWARE for free or for any charge, at any time or never, and through its chosen manner of access and distribution, all in C1's sole and complete discretion.

C1 licenses certain of its separately-licensed products bundled together in a product suite, called the C1 "Studio" product line (the "Studio Products"). The exact separately-licensed products that are bundled into the Studio Products may change from time-to-time in C1's sole discretion. If the SOFTWARE is identified as a C1 "Studio" product, then the SOFTWARE is one of the Studio Products. The SOFTWARE and the Studio Products are revised from time-to-time (meaning, for example, revised with updates, upgrades and, in the case of Studio products, possibly changes to which specific products are included in the bundle). For you to be entitled to receive any such revisions to the SOFTWARE or the Studio Products, as the case may be, you must have a valid SOFTWARE license or a valid Studio subscription. The original purchaser of the SOFTWARE or of a Studio product receives a one-year subscription from the date of purchase of the SOFTWARE. After one year, the Studio subscription and/or the SOFTWARE license must be renewed to continue to be entitled to receive the SOFTWARE and/or the Studio Products revisions as the case may be.

6. Serial Number. Within the packaging of the SOFTWARE, a unique serial number (the "Serial Number") is included, which allows for the registration of the SOFTWARE. The Serial Number is subject to the restrictions set forth in this EULA and may not be disclosed or distributed either with your Developed Software or in any other way. The disclosure or distribution of the Serial Number shall constitute a breach of this EULA, the effect of which shall be the automatic termination and revocation of all the rights granted herein.

7. Evaluation Copy. If you are using an "evaluation copy" or similar version, specifically designated as such by C1 on its website or otherwise, then the Licenses are limited as follows: a) you are granted a license to use the SOFTWARE for a period of thirty (30) days counted from the day of installation (the "Evaluation Period"); b) upon completion of the Evaluation Period, you shall either i) delete the SOFTWARE from the computer containing the installation, or you may ii) contact C1 or one of its authorized dealers to purchase a license of the SOFTWARE, which is subject to the terms and limitations contained herein; and c) any Developed Software may not be distributed or used for any commercial purpose.

III. INTELLECTUAL PROPERTY.

1. Copyright. You agree that all right, title, and interest in and to the SOFTWARE (including, but not limited to, any images, photographs, animations, video, audio, music, text, and “applets” incorporated into the SOFTWARE), and any copies of the SOFTWARE, and any copyrights and other intellectual properties therein or related thereto are owned exclusively by C1, except to the limited extent that C1 may be the rightful license holder of certain third-party technologies incorporated into the SOFTWARE. The SOFTWARE is protected by copyright laws and international treaty provisions. The SOFTWARE is licensed to you, not sold to you. C1 reserves all rights not otherwise expressly and specifically granted to you in this EULA.

2. Backups. You may either: (a) copy the SOFTWARE solely for backup or archival purposes; or (b) install the SOFTWARE on a single computer, provided you keep the original solely for backup or archival purposes. Notwithstanding the foregoing, you may not copy the Documentation.

3. General Limitations. You may not reverse engineer, decompile, or disassemble the SOFTWARE, except and only to the extent that applicable law expressly permits such activity notwithstanding this limitation.

4. Software Transfers. You may not rent or lease the SOFTWARE. You may transfer the SOFTWARE to another computer, provided that it is completely removed from the computer from which it was transferred. You may permanently transfer all of your rights under the EULA, provided that you retain no copies, that you transfer all the SOFTWARE (including all component parts, the media and printed materials, any dates, upgrades, this EULA and, if applicable, the Certificate of Authenticity), and that the recipient agrees to the terms and conditions of this EULA as provided herein. If the SOFTWARE is an update or upgrade, any transfer must include all prior versions of the SOFTWARE.

5. Termination. Without prejudice to any other rights it may have, C1 may terminate this EULA and the Licenses if you fail to comply with the terms and conditions contained herein. In such an event, you must destroy all copies of the SOFTWARE and all of its component parts.

6. Export Restrictions. You acknowledge that the SOFTWARE is of U.S. origin. You acknowledge that the license and distribution of the SOFTWARE is subject to the export control laws and regulations of the United States of America, and any amendments thereof, which restrict exports and re-exports of software, technical data, and direct products of technical data, including services and Developed Software. You agree that you will not export or re-export the SOFTWARE or any Developed Software, or any information, documentation and/or printed materials related thereto, directly or indirectly, without first obtaining permission to do so as required from the United States of America Department of Commerce's Bureau of Export Administration ("BXA"), or other appropriate governmental agencies, to any countries, end-users, or for any end-uses that are restricted by U.S. export laws and regulations, and any amendments thereof, which include, but are not limited to, the following:

Restricted Countries: Restricted Countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, Montenegro, North Korea, Serbia, Sudan, and Syria.

Restricted End-Users: Any End-User whom you know or have reason to know will use SOFTWARE or Developed Software in the design, development, or production of missiles and missile technology, nuclear weapons and weapons technology, or chemical and biological weapons. Any national of any of the Restricted Countries, wherever located, who intends to transmit or transport the SOFTWARE or Developed Software to one of the Restricted Countries.

Restricted End-Uses: Any use of SOFTWARE and Developed Software related to the design, development, or production of missiles and missile technology, nuclear weapons and weapons technology, or chemical and biological weapons.

These restrictions change from time to time. You represent and warrant that neither the BXA nor any other United States federal agency has suspended, revoked or denied your export privileges. C1 acknowledges that it shall use reasonable efforts to supply you with all reasonably necessary information regarding the SOFTWARE and its business to enable you to fully comply with the provisions of this Section. If you have any questions regarding your obligations under United States of America export regulations, you should contact the Bureau of Export Administration, United States Department of Commerce, Exporter Counseling Division, Washington DC. U.S.A. (202) 482-4811, http://www.bxa.doc.gov.

7. U.S. Government Restricted Rights. The SOFTWARE and documentation are provided with RESTRICTED RIGHTS. For solicitations issued before December 1, 1995, by the United States of America, its agencies and/or instrumentalities (the "Government"), other than the Department of Defense, the use, duplication or disclosure of the software and documentation provided to the Government under this EULA shall be subject to the RESTRICTED RIGHTS as set forth in subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at 48 CFR ch.1 52.227-19. For solicitations issued before September 29, 1995, by the Department of Defense, the use, duplication or disclosure of the software and documentation provided under this EULA shall be subject to the RESTRICTED RIGHTS as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 48 CFR ch.2 252.227-7013. You will comply with any requirements of the Government to obtain such RESTRICTED RIGHTS protection, including without limitation, the placement of any restrictive legends on the SOFTWARE, and any license agreement used in connection with the distribution of the SOFTWARE. Manufacturer is ComponentOne, LLC, 201 South Highland Avenue, 3rd Floor, Pittsburgh, Pennsylvania 15206 USA. For solicitations issued by the Government on or after December 1, 1995 and the Department of Defense on or after September 29, 1995, the only rights provided in the software and documentation provided herein shall be those contained in this EULA. Under no circumstances shall C1 be obligated to comply with any Governmental requirements regarding the submission of or the request for exemption from submission of cost or pricing data or cost accounting requirements. For any distribution of the SOFTWARE that would require compliance by C1 with the Government's requirements relating to cost or pricing data or cost accounting requirements, you must obtain an appropriate waiver or exemption from such requirements for the benefit of C1 from the appropriate Government authority before the distribution and/or license of the SOFTWARE to the Government.

IV. WARRANTIES AND REMEDIES.

1. Limited Warranty. C1 warrants that the original media, if any, are free from defects for ninety (90) days from the date of delivery of the SOFTWARE. EXCEPT AS OTHERWISE PROVIDED IN THE PRECEDING SENTENCE, AND TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, C1 EXPRESSLY DISCLAIMS ANY WARRANTY FOR THE SOFTWARE, DOCUMENTATION AND ANYTHING ELSE PROVIDED BY C1 HEREBY AND C1 PROVIDES THE SAME IN “AS IS” CONDITION WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE AND DOCUMENTATION REMAINS WITH YOU. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU MAY HAVE OTHERS WHICH VARY FROM STATE TO STATE.

2. Limited Remedy. C1's entire liability and your exclusive remedy under this EULA shall be, at C1's sole option, either (a) return of the price paid for the SOFTWARE; (b) repair the SOFTWARE through updates distributed online or otherwise in C1's discretion; or (c) replace the SOFTWARE with SOFTWARE that substantially performs as described in the SOFTWARE documentation, provided that you return the SOFTWARE in the same manner as provided in Section I.2 for return of the SOFTWARE for non-acceptance of this EULA. Any media for any repaired or replacement SOFTWARE will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer. THESE REMEDIES ARE NOT AVAILABLE OUTSIDE OF THE UNITED STATES OF AMERICA. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL C1 BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFIT, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF C1 HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME STATES/JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES IN CERTAIN CASES, THE ABOVE LIMITATION MAY NOT APPLY TO YOU.

V. MISCELLANEOUS.

1. This is the Entire Agreement. This EULA (including any addendum or amendment to this EULA included with the SOFTWARE) is the final, complete and exclusive statement of the entire agreement between you and C1 relating to the SOFTWARE. This EULA supersedes any prior and contemporaneous proposals, purchase orders, advertisements, and all other communications in relation to the subject matter of this EULA, whether oral or written. No terms or conditions, other than those contained in this EULA, and no other understanding or agreement which in any way modifies these terms and conditions, shall be binding upon the parties unless entered into in writing executed between the parties, or by other non-oral manner of agreement whereby the parties objectively and definitively act in a manner to be bound (such as by continuing with an installation of the SOFTWARE, "clicking-through" a questionnaire, etc.) Employees, agents and other representatives of C1 are not permitted to orally modify this EULA.

2. You Indemnify C1. . You agree to indemnify, hold harmless, and defend C1 and its suppliers and resellers from and against any and all claims or lawsuits, including attorney's fees, which arise out of or result from your breach of any of the terms and conditions of this EULA.

3. Interpretation of this EULA. If for any reason a court of competent jurisdiction finds any provision of this EULA, or any portion thereof, to be unenforceable, that provision of this EULA will be enforced to the maximum extent permissible so as to effect the intent of the parties, and the remainder of this EULA will continue in full force and effect. Formatives of defined terms shall have the same meaning of the defined term. Failure by either party to enforce any provision of this EULA will not be deemed a waiver of future enforcement of that or any other provision. Except as otherwise required or superseded by law, this EULA is governed by the laws of the Commonwealth of Pennsylvania, without regard to its conflict of laws principles. The parties consent to the personal jurisdiction and venue of the Commonwealth of Pennsylvania, in the County of Allegheny, and agree that any legal proceedings arising out of this EULA shall be conducted solely in such Commonwealth. If the SOFTWARE was acquired outside the United States, then local law may apply.


Licensing FAQs

Licensing FAQs

This section describes the main technical aspects of licensing. It may help the user to understand and resolve licensing problems he may experience when using ComponentOne .NET and ASP.NET products.

What is Licensing?

How does Licensing Work?

Common Scenarios

Troubleshooting


What is Licensing?

What is Licensing?

Licensing is a mechanism used to protect intellectual property by ensuring that users are authorized to use software products.

Licensing is not only used to prevent illegal distribution of software products. Many software vendors, including ComponentOne, use licensing to allow potential users to test products before they decide to purchase them.

Without licensing, this type of distribution would not be practical for the vendor or convenient for the user. Vendors would either have to distribute evaluation software with limited functionality, or shift the burden of managing software licenses to customers, who could easily forget that the software being used is an evaluation version and has not been purchased.


How does Licensing Work?

How does Licensing Work?

ComponentOne uses a licensing model based on the standard set by Microsoft, which works with all types of components.

Note: The Compact Framework components use a slightly different mechanism for licensing than the other ComponentOne components due to platform differences.

When a user decides to purchase a product, he receives an installation program and a Serial Number. During the installation process, the user is prompted for the serial number that is saved on the system. (Users can also enter the serial number by clicking the "License" button on the About Box of any ComponentOne product.)

When a licensed component is added to a form or web page, Visual Studio asks the newly created component for licensing information. The component looks for licensing information stored in the system and generates a key, which Visual Studio saves in two files:

1. a "<projectName>.licenses" resource file which contains the actual key and

2. a "licenses.licx" file that contains references to those resources.

These files are automatically added to the project.

Note that the licenses.licx file is usually not shown in the Solution Explorer; it appears if you press the "Show All Files" button in the Solution Explorer's toolbox, or select "Project | Show All Files" from Visual Studio's main menu.

Later, when the component is created at run time, it gets passed the key that was created at design time and can decide whether to simply accept the key, to throw an exception and fail altogether, or to display some information reminding the user that the software has not been licensed.

All ComponentOne products are designed to display licensing information if the product is not licensed. None will throw licensing exceptions and prevent applications from running.


Common Scenarios

Common Scenarios

Creating components at design time

Creating components at run time

Inheriting from licensed components

Using licensed components in console applications

Using licensed components in Visual C++ applications


Creating components at design time

Creating components at design time

This is the most common scenario and also the simplest: the user adds one or more controls to the form, the licensing information is stored in the licenses.licx file, and the component works.

Note that the mechanism is exactly the same for Windows Forms and Web Forms (ASP.NET) projects.


Creating components at run time

Creating components at run time

This is also a fairly common scenario. You do not need an instance of the component on the form, but would like to create one or more instances at run time.

In this case, the project will not contain a licenses.licx file (or the file will not contain an appropriate key for the component) and therefore licensing will fail.

To fix this problem, add an instance of the component to a form in the project. This will create the licenses.licx file and things will then work as expected. (The component can be removed from the form after the licenses.licx file has been created).


Inheriting from licensed components

Inheriting from licensed components

If a component that inherits from a licensed component is created, the licensing information to be stored in the form is still needed. This can be done in two ways:

1. Add a LicenseProvider attribute to the component.

This will mark the component as licensed. When a component is added to a form, Visual Studio will create and manage the licenses.licx file, and the base class will handle the licensing process as usual. No additional work is needed. For example:

[LicenseProvider(typeof(LicenseProvider))]

class MyGrid: C1.Win.C1FlexGrid.C1FlexGrid

{

// ...

}

2. Add an instance of the base component to the form.

This will embed the licensing information into the licenses.licx file as in the previous scenario, and the base component will find it and use it. As before, the extra instance can be deleted after the licenses.licx file has been created.


Using licensed components in console applications

Using licensed components in console applications

When building console applications, there are no forms to add components to, and therefore Visual Studio won't create a licenses.licx file.

In these cases, create a temporary Windows Forms application and add all the desired licensed components to a form. Then close the Windows Forms application and copy the licenses.licx file into the console application project.

Make sure the licensex.licx file is configured as an embedded resource. To do this, right-click the licenses.licx file in the Solution Explorer window and select Properties. In the property window, set the "Build Action" property to "Embedded Resource".


Using licensed components in Visual C++ applications

Using licensed components in Visual C++ applications

It seems there is a bug in VC++ 2003. The licenses.licx is ignored during the build process, therefore the licensing information is not included in VC++ applications.

To fix this problem, extra steps must be taken to compile the licensing resources and link them to the project. Note the following:

1. Build the C++ project as usual. This should create an exe file and also a licenses.licx file with licensing information in it.

2. Copy the licenses.licx file from the app directory to the target folder (Debug or Release).

3. Copy the C1Lc.exe utility and the licensed dlls to the target folder. (Don't use the standard lc.exe, it has bugs.)

4. Use C1Lc.exe to compile the licenses.licx file. The command line should look like this:

c1lc /target:MyApp.exe /complist:licenses.licx /i:C1.Win.C1FlexGrid.dll

5. Link the licenses into the project. To do this, go back to Visual Studio, right-click the project, select properties, and go to the Linker/Command Line option. Enter the following:

/ASSEMBLYRESOURCE:Debug\MyApp.exe.licenses

6. Rebuild the executable to include the licensing information in the application.


Troubleshooting

Troubleshooting

We try very hard to make the licensing mechanism as unobtrusive as possible, but problems may occur for a number of reasons.

Below is a description of the most common problems and their solutions.


I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

If this happens, there must be a problem with the licenses.licx file in the project. It either doesn't exist, contains wrong information, or is not configured correctly.

First, try a full rebuild ("Rebuild All" from the Visual Studio Build menu). This will usually rebuild the correct licensing resources.

If that fails, follow these steps:

1. Open the project and go to the Solution Explorer window.

2. Click the "Show All Files" button on the top of the window.

3. Find the licenses.licx file and delete it.

4. Close the project and reopen it.

5. Open the main form and add an instance of each licensed control.

6. Check the Solution Explorer window, there should be a licenses.licx file there.

7. Rebuild the project using the "Rebuild All" option (not just "Rebuild").


I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.

I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.

There is no need to install any licenses on machines used as servers and not used for development.

The components must be licensed on the development machine, therefore the licensing information will be saved into the executable (exe or dll) when the project is built. After that, the application can be deployed on any machine, including web servers.


I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

Make sure that the license key is still valid. If you licensed the component over a year ago, your subscription may have expired. In this case, you have two options:

Option 1 - Renew your subscription to get a new license key.

If you choose this option, you will receive a new key that you can use to license the new components (from the installation utility or directly from the About Box).

The new subscription will entitle you to a full year of upgrades and to download the latest maintenance builds directly from http://prerelease.componentone.com/.

Option 2 – Continue to use the components you have.

Subscriptions expire, products do not. You can continue to use the components you received or downloaded while your subscription was valid.


Technical Support

Technical Support

C1DataObjects for .NET is developed and supported by ComponentOne LLC, a company formed by the merger of APEX Software Corporation and VideoSoft. You can obtain technical support using any of the following methods:

ComponentOne Web Site

ComponentOne HelpCentral

Internet E-mail

Peer-to-Peer Newsgroup

Documentation


ComponentOne Web Site

ComponentOne Web Site

The ComponentOne Web site at www.componentone.com provides a wealth of information and software downloads for C1DataObjects users:

· Descriptions of the various support options available through the ComponentOne Service Team.

· Answers to frequently asked questions (FAQ's) about C1DataObjects, organized by functionality. Please consult the FAQ's before contacting us directly, as this can save you time and also introduce you to other useful information pertaining to C1DataObjects.

· Free product updates, which provide you with bug fixes and new features.


ComponentOne HelpCentral

ComponentOne HelpCentral

ComponentOne HelpCentral is the new online resource for Visual Studio developers and Help authors. Visit HelpCentral to get information on ComponentOne products, view online demos, get Tech Tips and answers to frequently asked questions (FAQ's), search the ComponentOne knowledgebase and more!


Internet E-mail

Internet E-mail

For technical support through the Internet, e-mail us at:

support.c1data.net@componentone.com

To help us provide you with the best support, please include the following information when contacting ComponentOne:

· Your ComponentOne product serial number.

· The version and name of your operating system.

· Your development environment and its version.

For more information on technical support, go to:

www.componentone.com/support


Peer-to-Peer Newsgroup

Peer-to-Peer Newsgroup

ComponentOne also sponsors a peer-to-peer newsgroup for C1DataObjects users. ComponentOne does not offer formal technical support in this newsgroup, but instead sponsors it as a forum for users to post and answer each other's questions regarding C1DataObjects. However, ComponentOne may monitor the newsgroup to ensure accuracy of information and provide comments when necessary. You can access the newsgroup from the ComponentOne Web site at http://helpcentral.componentone.com/Newsgroups.aspx.


Documentation

Documentation

ComponentOne documentation is available with each of our products in HTML Help, Microsoft Help 2.0 (.NET, ASP.NET and Mobile Device products only), and PDF format. All of the PDFs are also available on our Web site. If you have suggestions on how we can improve our documentation, please email the Documentation team. Please note that e-mail sent to the Documentation team is for documentation feedback only. Technical Support and Sales issues should be sent directly to their respective departments.


Redistributable Files

Redistributable Files

ComponentOne DataObjects for .NET is developed and published by ComponentOne LLC. You may use it to develop applications in conjunction with Microsoft Visual Studio or any other programming environment that enables the user to use and integrate the control(s). You may also distribute, free of royalties, the following Redistributable Files with any such application you develop to the extent that they are used separately on a single CPU on the client/workstation side of the network:

· c1.data.dll

· c1.data.express.dll

Site licenses are available for groups of multiple developers. Please contact Sales@ComponentOne.com for details.


Namespaces

Namespaces

Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.

The namespaces for the C1DataObjects controls are:

· C1.Data

· C1.Data.SchemaObjects

· C1.DataExpress (for C1DataExpress)

The following code fragment shows how to declare a C1DataSet control, for example, using the fully qualified name for this class:

· Visual Basic

· C#

· Delphi

Namespaces address a problem sometimes known as namespace pollution, in which the developer of a class library is hampered by the use of similar names in another library. These conflicts with existing components are sometimes called name collisions.

For example, if you create a new class named DataItem, you can use it inside the project without qualification. However, the C1DataObjects assembly also implements a class called DataItem. So, to use the DataItem class in the same project, a fully qualified reference must be used to make the reference unique. If the reference is not unique, Visual Studio .NET produces an error stating that the name is ambiguous.

Fully qualified names are object references that are prefixed with the name of the namespace where the object is defined. Objects defined in other projects can be used if a reference to the class is created (by choosing Add Reference from the Project menu) and then the fully qualified name for the object can be used in the code.

Fully qualified names prevent naming conflicts because the compiler can always determine which object is being used. However, the names themselves can get long and cumbersome. To get around this, use the Imports statement (using in C#) to define an alias — an abbreviated name that can be used in place of a fully qualified name. For example, the following code snippet creates aliases for two fully qualified names, and uses these aliases to define two objects:

· Visual Basic

· C#

· Delphi

If the Imports statement is used without an alias, all the names in that namespace can be used without qualification provided they are unique to the project.

As a warning, unless specified explicitly in the code, it is taken for granted that the statement has been specified. This applies only to small code samples. Tutorials and other longer samples will specify complete qualifiers.

· Visual Basic

· C#

· Delphi


Creating a .NET Project

Creating a .NET Project

This topic demonstrates how to create a new .NET project.

1. From the File menu in Microsoft Visual Studio .NET, select New and click Project. The New Project dialog box opens.

2. Under Project Types, choose either Visual Basic Projects or Visual C# Projects, and select Windows Application from the list of Templates in the right pane.

3. Enter or browse for a location for your application in the Location field and click OK.

A new Microsoft Visual Studio .NET project is created in the specified location. In addition, a new Form1 is displayed in the Designer view.

4. Double-click the desired C1DataObjects components from the Toolbox to add them to Form1. For information on adding a component to the toolbox, see Adding C1DataObjects Components to the Toolbox.


Adding C1DataObjects Components to the Toolbox

Adding C1DataObjects Components to the Toolbox

After installing C1DataObjects on your computer, you need to add the following C1DataObjects components to Visual Studio Toolbox:

· C1DataTableSource

· C1DataSet

· C1DataSetLogic

· C1DataView

· C1SchemaDef

· C1SchemaRef

· C1TableLogic

Note: If you are using C1DataExpress, you must add the C1ExpressConnection, C1ExpressTable, and C1ExpressView components to the Visual Studio Toolbox.

Open the Visual Studio IDE (Microsoft Development Environment). Make sure the Toolbox is visible (select Toolbox in the View menu, if necessary). Right-click the Toolbox to open the toolbox context menu.

If you want the C1DataObjects components to appear on their own tab in the Toolbox, select Add Tab from the context menu and type in the tab name, for example, “C1DataObjects”. Select the tab where you want the components to appear. Right-click that tab and select Customize Toolbox… from the context menu. The Customize Toolbox dialog box will open.

In the Customize Toolbox dialog box, go to the .NET Framework Components tab. Sort the list by Namespace (click the Namespace column header) and check the check boxes for the components belonging to namespace C1.Data.

Note: Make sure that the ComponentOne C1TrueDBGrid control is available in the Toolbox. It is used in C1DataObjects tutorials. The ComponentOne C1TrueDBGrid control is a part of ComponentOne Studio for .NET.


ComponentOne DataObjects (Enterprise Edition)

ComponentOne DataObjects (Enterprise Edition)

The ComponentOne DataObjects Enterprise Edition is a comprehensive data and business objects framework that can be used in .NET applications of any range, scalability and architecture, from simple desktop applications to classic client-server applications to 3-tier distributed applications and enterprise-wide business object libraries. In fact, it is in 3-tier applications and enterprise-wide business where C1DataObjects is the most useful, the most productivity enhancing and time saving.

C1DataObjects and ADO.NET

C1DataObjects Tutorials

Schema Objects

Business Logic

Application Configurations

Virtual Mode - Dealing with Large Datasets

Updating the Database

Features and Techniques

C1DataObjects Samples


C1DataObjects and ADO.NET

C1DataObjects and ADO.NET

C1DataObjects is based on Microsoft ADO.NET technology and enhances it in many ways to empower and simplify database application development. It also has close connections with ADO.NET that programmers can utilize if they have already mastered ADO.NET:

· C1DataObjects programmatic object model closely follows one of ADO.NET, so it will look very familiar to those who are used to the ADO.NET object model. For example, C1DataSet is similar to ADO.NET DataSet, C1DataTable to ADO.NET DataTable, etc.

· The relation with ADO.NET goes beyond object model similarity. In fact, C1DataObjects stores data in ADO.NET DataSet and that internal storage is accessible via the StorageDataSet property. This enables a powerful combination of C1DataObjects and ADO.NET in the same code. Your code can work with the same data using either C1DataObjects or ADO.NET interface, whichever is most suitable for the task at hand. This duality is very important, because it allows you to:

1. Do everything with your data that you can do with ADO.NET, including features that are not supported in C1DataObjects (for example, DataSet.Merge).

2. Export/import your data from/to C1DataObjects in ADO.NET DataSet format.

3. Work with XML data in C1DataObjects and import/export data in self-describing XML to/from other tools and programs.

See Working with ADO.NET Dataset for details on how to use this C1DataObjects-ADO.NET bridge.


C1DataObjects Tutorials

C1DataObjects Tutorials

Note: If you are running the pre-built tutorial projects included in C1DataObjects installation, please be aware that the projects have the sample database location hard coded in the connection string:

C:\Program Files\ComponentOne Studio.NET\Common\NWIND.MDB

If you have the Northwind database (standard MS Access sample database included in Visual Studio 6 and 7) installed in a different location, you can change the connection string (see Tutorial 1, Step 4), or copy the NWIND.MDB file to the required location.

Tutorial 1 - Data Schema

Tutorial 2 - Business Logic

Tutorial 3 - Creating Distributed 3-Tier Applications

Tutorial 4 - Virtual Mode: Dealing with Large Datasets


Tutorial 1 - Data Schema

Tutorial 1 – Data Schema

In this tutorial, you will learn the basic concepts of C1DataObjects and how to work with it. This includes:

· Importing your database structure so it becomes a data schema, the basis of all C1DataObjects activities.

· Creating composite tables out of database tables, so you can shape and represent the data the way your users need them.

· Specifying business logic in the form of calculation expressions and constraints. More business logic features will be introduced in other tutorials.

· Creating data set definitions (DataSetDef) consisting of TableView objects exposing data to the user.

· Binding GUI controls to a C1DataObjects data source.

The first step in using C1DataObjects is creating a data schema. A schema is created using ComponentOne Data Schema Designer. Unlike in standard ADO.NET, a schema and associated business logic can be created once and then reused throughout your projects. Normally, you create a new schema by importing a database structure using the schema designer’s Import Wizard. Alternatively, you can import an existing ADO.NET schema. See Converting Schema from Other Sources.

To use the Import Wizard:

1. Create a new Windows Application project. Make sure the C1DataObjects components are added to your Visual Studio toolbox as described in the installation instructions.

2. Place the following components on the form as shown in the figure: c1SchemaDef1 (C1.Data.C1SchemaDef), c1DataSet1-2 (C1.Data.C1DataSet), three grids, c1TrueDBGrid1-2 (C1.Win.C1TrueDBGrid.C1TrueDBGrid) and dataGrid1 (System.Windows.Forms.DataGrid) and two command buttons, button1-2 (System.Windows.Forms.Button):

In this tutorial we intentionally use two different data bound grid controls, ComponentOne TrueDBGrid and Microsoft DataGrid, to show that C1DataObjects can serve as a data source to any data-bound GUI controls adhering to .NET databinding specifications. All other tutorials will use ComponentOne grid controls. Naturally, we recommend ComponentOne presentation controls, both because they are the best and because they are most closely integrated with C1DataObjects. Most C1DataObjects features (all features that rely only on standard .NET data binding) will work with any third-party data-bound control. However, some C1DataObjects features that are extensions of standard .NET data binding, most notably, Virtual Mode (see Tutorial 4 - Virtual Mode: Dealing with Large Datasets) require that you use ComponentOne data bound controls.

3. Right-click the C1SchemaDef1 component, from the context menu, select Schema Designer. ComponentOne Data Schema Designer opens.

4. From the Schema menu in the Schema Designer, select Import database structure. This opens the first dialog of the Import Wizard.

5. In the Import Wizard dialog, press the button to the right of the connection string. It will open the standard OLE DB Data Link Properties dialog.

6. Select the provider, the database and other necessary connection properties in that dialog. In this tutorial, we use the standard MS Access Northwind sample database (NWIND.MDB). Select “Microsoft Jet 4.0 OLE DB Provider” (the default choice) in the Provider tab, and “C:\Program Files\ComponentOne Studio.NET\Common\NWIND.MDB” (or another location, where your database is) in the Connection tab. Press OK. This closes the Data Link Properties dialog, inserting the connection string in Import Wizard.

7. Press the Next button. This brings you to the second Import Wizard dialog where you can select the tables that you want to import into the schema. Press the >> button to select all available tables. Press Finish. Import Wizard will create the schema and close.

8. Let’s look at the schema created by Import Wizard.

The Tables window contains the list of all simple table objects created by the Import Wizard based on the database tables. They are called “simple” because these objects directly correspond to database tables, as opposed to composite tables that we will define later in this tutorial.

The Relations window contains inter-table relations created by the Import Wizard based on the relationships existing in the database.

Each table and relation can be opened for editing by a double-click or by selecting Edit from its context menu. Table Editor gives you access to the properties of the table and its fields. Relation Editor allows you to browse and edit properties of a relation and its join conditions that relate one or more fields of one table (parent) to corresponding fields of another table (child).

Tables and relations are also represented in a graphical form in the center Schema – Simple Tables window. You can rearrange tables to your liking using drag-and-drop.

9. Now we will use the Table Editor to modify some table properties. This step is only needed when you use Microsoft Access as your database, since the MS Access OLE DB provider does not consider Autoincrement fields (row identity fields, their values are automatically assigned and maintained by the database) as read-only, so we need to make an adjustment after import.

Double-click the Categories table and in the Table Editor select the CategoryID field (Fields are in the lower panel of the editor). Change its DataSourceReadOnly property to True.

Note: Switch between the Design and Preview data views of the tables using the tabs at the bottom of the editor window or by using the Shift and F5 keys; press F5 to move from Design to Preview data view or press Shift+F5 to move from Preview data to Design view.

Both a Table and a Field object have many more properties, but we are satisfied with the default values, assigned by the import, for now. The same is true for the Relation objects, we do not need to change anything after import.

10. C1DataObjects allows the developer to associate business logic with Table objects. This logic, once defined on a table level, will be automatically enforced by C1DataObjects in any context where this table is used. This is one of the main features of the C1DataObjects framework: specifying business logic where it belongs, on a data object (table) level and its automatic propagation and enforcement wherever that object is used. C1DataObjects provides a comprehensive set of business logic features, expressions and events, as we will see in the next tutorial. In this tutorial, we will only show the most straightforward way of specifying business logic: using expressions, namely, calculated expressions and constraints.

To specify a constraint expression for the UnitPrice field of the Products table, double-click the Products node in the Tables window, to open the Table Editor for the Products table. In the Table Editor, select the UnitPrice field in the Fields panel, then select the Constraints property in the property grid on the right. Press the ellipsis button on the right side of the property value to open the Constraints editor dialog. In the Constraints editor, press the Add button. That will create a constraint node (a field can have multiple constraints) with properties of the new constraint shown on the right. Type the following expression in the Expression property:

UnitPrice > 0

And the following string in the ErrorDescription:

UnitPrice must be a positive number

11. Click Close.

12. In this next step, we will create several composite tables. A Composite table is a central and unique feature of C1DataObjects allowing you to combine multiple tables in a single aggregate so that they will expose data to the user in the form of a single table. It corresponds to the notion of a database view formed by a SQL statement with joins, but you do not need to create database views or write SQL statements, C1DataObjects will do all the work for you. A composite table is a collection of simple tables connected with relations. It is designed in a Composite Table Editor in a convenient graphical form, as a diagram. For more information about composite tables and other C1DataObjects schema objects, see Schema Objects.

Here we will create a composite table CustOrders consisting of three related tables Customers, Orders and Employees. Press the right mouse button over the Tables window and select Add Composite table from the context menu. In the newly added node, change the default name “CompositeTable” to CustOrders.

A Composite Table Editor opens when you create a new composite table. The editor has two tabs, Diagram and Properties. We will start with the first tab, Diagram, where we will specify which simple tables are used and how they are related. Press the Add tables… button on the top of the editor. The Add Tables dialog opens. In the Add Tables dialog, select tables Customers, Orders and Employees in Existing tables, press the > button to move them to Selected tables, and press OK. This will create a diagram consisting of three tables (rectangles) connected with two relations (arrows). Note: It may be necessary to expand your Diagram display pane to see the tables.

The only change we need to make is to invert the relation between Orders and Employees. We need an employee record (child record) to be uniquely determined by an order record (parent record), whereas in the Employees – Orders relation, it is the other way round: Employees is the parent and Orders is the child. Select the Orders – Employees relation on the diagram, press the right mouse button and select Invert from the context menu. That will make Orders parent and Employees child.

Rename the relation correspondingly: change its Name property (in the property grid below the diagram) to Orders – Employees.

The structure of the composite table CustOrders shown on the diagram can be represented in the following notation:

Customers →(1-∞) Orders →(∞-1) Employees

Here →(1-∞) is a one-to-many relation, and →(∞-1) is a many-to-one relation. Relation cardinality, either OneToMany or ManyToOne, can be seen on the diagram (the infinity symbol designates the “many” part) and in the property grid below when the relation arrow is selected.

According to relation cardinality, each row of the CustOrders composite table consists of a Customers row, an Orders row (one of the child rows of the Customers row) and an Employees row (the single child row uniquely determined by the Orders row).

Now we must create some fields in our new CustOrders composite table. This is done by selecting fields in the constituent tables in the diagram. We have three of them: Customers, Orders and Employees. Select the following fields (check the corresponding check boxes): in Customers: Address, City, Country, CustomerID, PostalCode, Region; in Orders: all except CustomerID (Orders.CustomerID is used in the Customers – Orders relation to connect an order record to a customer record, it has no other purpose and CustomerID is already selected in Customers, so we do not need to include Orders.CustomerID); in Employees: FirstName, LastName (notice that Employees.EmployeeID is not included, for the same reason as Orders.CustomerID). When the fields are created (checked), go to the Properties tab of the Composite Table Editor and you will see the checked fields in the bottom panel with their properties in the property grid on the right.

13. Let’s create another composite table OrderDetailsProducts, combining simple tables Order Details and Products. It is done following the procedure described in the previous step: after adding a new composite table and specifying its name, press the Add tables… button and select tables Orders Details and Products in Existing tables, press the > button to move them to Selected tables, and press OK. This will create a diagram consisting of two tables (rectangles) connected with a relation (arrows). Then invert the relation between Products and Order Details and rename it to Order Details – Products. Then select the following fields (check the corresponding check boxes): in Order Details: all fields except UnitPrice; in Products: ProductName, UnitPrice.

The resulting OrderDetailsProducts composite table has the following structure:

Order Details →(∞-1) Products

A row of the OrderDetailsProducts composite table consists of an Order Details row and a Products row (the single child row uniquely determined by the Order Details row).

Now we will add a new field to the composite table OrderDetailsProducts, a calculated field ExtendedPrice. Go to the Properties tab of the Composite Table Editor. Press the right mouse button in the Fields list and select Add from the context menu, that will create a new field with default name CompositeTableField. Change this default name to ExtendedPrice. While the new ExtendedPrice field is selected in the Fields list, go to the property grid on the right and type in the value of the CalculationExpression property:

Quantity * UnitPrice * (1 - Discount)

Also, in the property grid, select Decimal in the DataType property.

Note that calculated fields can be added to simple tables as well as to composite tables, see Schema Objects for details.

14. Now we will show that composite tables can participate in relations, called composite relations. We will create a relation between composite tables CustOrders and OrderDetailsProducts. In this case, both the parent and the child side of the relation are composite tables. In fact, the parent and the child of a composite relation can be either composite or simple tables, see Schema Objects for details.

Press the right mouse button in the Relations window and select Add from the context menu. Rename the newly created relation from its default name “Relation” to CO – ODP (abbreviation for “CustOrders – OrderDetailsProducts”).

In the Relation Editor, open the Parent combo box that shows the list of all available tables, and select the CustOrders table as the parent for the relation. Then open the Child combo box and select OrderDetailsProducts there.

When you select a composite table in the Parent or Child combo box, the Relation Editor changes, the JoinConditions panel disappears and the set of properties in the property grid changes, all according to the fact that the relation is now a composite relation, as opposed to a simple relation. A composite relation, relation between composite tables (one of them may be simple) is based on a simple relation that connects two tables, one belonging to the parent composite table and the other belonging to the child composite table.

15. The final step before we can use this schema in an application is to create one or more data set objects. A data set, an analog of ADO.NET DataSet, is a collection of tables and relationships as they are exposed to the user.

Tables (both simple and composite) and relations are the building blocks of a data schema. Usually, they are not exposed directly to the user. A schema can contain many tables, as many as there are tables in the database and more, if you add composite tables. A client user application usually does not need all tables, and in most cases fetching data from all tables to the client at once would not be practical. This is why we need a separate object, a data set, specifying which tables are exposed to the client and which relations are used to connect them.

A schema can contain multiple data set objects. A schema object defining a data set is called DataSetDef, see Schema Objects for details. Each data set is an independent, self-contained data unit. User applications use C1DataSet components to connect to data set objects. They retrieve data calling the Fill method or automatically if FillOnRequest = True. All data fetched for a C1DataSet object are retrieved in one call to the server, unless in virtual mode where data retrieval occurs in limited chunks of data, upon request, see Tutorial 4 - Virtual Mode: Dealing with Large Datasets. The user application can then make modifications to the data in a C1DataSet locally, and send modifications to the data source (usually, a database) calling Update (or automatically, using a C1DataTableSource with property UpdateLeavingRow set to True). A data set also serves as a transaction context, modifications made in separate data sets belong to separate transactions, are not visible across data sets. For a detailed description of how a C1DataObjects data set functions in various scenarios, see Application Configurations.

A data set consists of TableView and ViewRelation objects. A TableView is a representation, a view of a table. A ViewRelation is a relation between TableView objects, based on a relation between tables. For details on the object model, see Schema Objects.

In most cases, to create a data set in the Schema Designer is as easy as selecting a set of tables included in the data set:

Press the right mouse button in the DataSets window and select Add in the context menu. For the newly created data set node, change the default name “DataSet” to CustOrders. In the DataSet editor, press the Add tables… button. In the Add tables dialog that opens, select tables CustOrders, OrderDetailsProducts and Employees in the Existing tables list. First two are composite tables, and the last one is a simple table. Press the > button to move them to Selected tables. Press OK. In the DataSet designer, you will see the diagram of the data set consisting of three tables and a relation.

Since a TableView object represents a table, its fields (TableViewField objects) represent table fields. By default, when you create a TableView using the Add tables button or drag-and-drop from the tables window, the TableView fields directly correspond to the Table fields. However, you can override field properties in TableViewField, delete some fields from TableView and change the field order. In this tutorial, we will only do the last, change the fields order in the Employees table view representing the Employees table:

Press the right mouse button on the Employees table in the CustOrders data set diagram and choose Fields… from the context menu. That will open the Fields Editor allowing you to define view table fields and set their properties. Using the Up and Down arrow buttons re-arrange the fields order.

16. In order to demonstrate how multiple data sets can exist in a schema, we will create one more data set, with two composite tables (note that a data set can contain both simple and composite tables, see the previous step). First, create two new composite tables:

Add a new composite table CustOrdersDetails and add the following tables to it, using the Add tables… button: Customers, Orders, Orders Details, Products and Categories. Invert the relation between Products and Order Details. and rename it to Order Details – Products. Invert the relation between Categories and Products and rename it to Products - Categories. Then select the following fields (check the corresponding check boxes): in Customers: Address, City, CompanyName, Country, CustomerID, PostalCode, Region; in Orders: all fields except CustomerIDl; in Order Details: Discount, ProductID, Quantity; in Products: CategoryID, ProductName, UnitPrice, in Categories: CategoryName.

The resulting CustOrdersDetails composite table has the following structure:

Customers →(1-∞) Orders →(1-∞) Order Details →(∞-1) Products →(∞-1) Categories

A row of the CustOrdersDetails composite table consists of a Customers row, an Orders row (one of the child rows of the Customers row), an Order Details row (one of the child rows of the Orders row), a Products row (the single child row uniquely determined by the Order Details row) and a Categories row (the single child row uniquely determined by the Products row).

The second composite table, ProductsOrderDetailsCust, will combine the same tables as CustOrdersDetails, but in a different hierarchy and with different fields. Add a new composite table ProductsOrderDetailsCust and add tables to it using the Add tables… button: Customers, Orders, Orders Details, Products and Categories. Invert and correspondingly rename the following relations: Categories - Products, Orders - Order Details. Customers - Orders. Select the following fields (check the corresponding check boxes): in Products: CategoryID, ProductID, ProductName, UnitsInStock, UnitsOnOrder; in Categories: CategoryName; in Order Details: OrderID, Quantity; in Orders: CustomerID; in Customers: CompanyName.

The resulting ProductsOrderDetailsCust composite table has the following structure:

Products →(1-∞) Order Details →(∞-1) Orders →(∞-1) Customers;

Products →(∞-1) Categories

Note the branching at the Products node. It has two children: Order Details connected one-to-many and Categories connected many-to-one. In general, branching in composite table diagrams is allowed, but only for many-to-one relations. One-to-many relations are not allowed to branch in a composite table, because a composite table data should not form a branched tree, it must be a set of rows having identical structure.

A row of the ProductsOrderDetailsCust composite table consists of a Products row, a Categories row (the single child row uniquely determined by the Products row), an Order Details row (one of the child rows of the Products row), an Orders row (the single child row uniquely determined by the Order Details row) and the Customers row (the single child row uniquely determined by the Orders row).

Finally, create a DataSet, ProductsOrders including two composite tables: CustOrdersDetails and ProductsOrderDetailsCust:

Press the right mouse button in the DataSets window and select Add in the context menu. For the newly created data set node, change the default name “DataSet” to ProductsOrders. In the DataSet editor, press the Add tables… button. In the Add tables dialog that opens, select tables CustOrdersDetails and ProductsOrderDetailsCust in the Existing tables list. Press the > button to move them to Selected tables. Press OK. In the DataSet designer, you will see the diagram of the data set consisting of two tables.

17. Now, our schema is ready, let’s save it and proceed with the tutorial. First, save the schema in a file, using the Schema Designer menu item Save As in the File menu. We will need that file in other tutorials, to reuse the schema in other tutorial projects. Close Schema Designer answering Yes to the question whether you want to save the modified schema. It will save the schema in the c1SchemaDef1 component (in the form resource file).

18. Set up components c1DataSet1 and c1DataSet2, which will serve as data sources for the grid controls. For both of them, select c1SchemaDef1 in the SchemaDef property. That will connect the data set components to the schema. Then choose the data set exposed by each of the two components, setting c1DataSet1.DataSetDef:C1DataSet = CustOrders and c1DataSet2.DataSetDef:C1DataSet = ProductsOrders.

19. A client application usually needs some subset of data fetched to a data set, so we need some means of restricting, filtering data as it is retrieved from the database. This purpose is served by C1DataObjects FilterConditions. In this tutorial, we will restrict product data to only those products that have CategoryID = 1 (beverages). This is accomplished by creating an event handler for the C1DataSet.BeforeFill event. We will only restrict data in c1DataSet2 (the ProductsOrders data set), leave c1DataSet1 (the CustOrders data set) unrestricted. Add an event handler c1DataSet2_BeforeFill and write the following code there:

· Visual Basic

· C#

· Delphi

20. Now we have C1DataObjects data source (c1DataSet1) ready to be used by data-bound GUI controls, such as C1TrueDBGrid and DataGrid. Set the DataSource property of all three grids in Form1 to c1DataSet1 and select the values in their DataMember properties as follows: c1TrueDBGrid1.DataMember = _CustOrders, c1TrueDBGrid2.DataMember = _CustOrders.CO - ODP, dataGrid1.DataMember = Employees.

Data members exposed by a C1DataSet data source represent the TableView objects of the data set. Those that have child table views (relations) can be used in a master-detail hierarchy. They are represented by two data members, one with leading underscore, the other without it. The data member without leading underscore is used to connect to the table view as to an isolated data source, without master-detail hierarchy. The data member with leading underscore is used to connect to it as to the root node (master) of a master-detail hierarchy. Dependent nodes (details) are represented by relation names, such as _CustOrders.CO – ODP.

21. In order to be able to send data modifications to the database, add the following code to the button1.Click event:

· Visual Basic

· C#

· Delphi

22. The second data set, ProductsOrders will be shown in a separate form. Add a new form, Form2 to the project. Add two DataGrid components, dataGrid1-2 to the form, and add the following method to the form code:

· Visual Basic

· C#

· Delphi

To activate Form2, add the following code to the button2.Click event:

· Visual Basic

· C#

· Delphi

Run the Program and Observe the Following:

· The two grids on the left show rows of composite tables CustOrders and OrderDetailsProducts combining data from multiple database tables. Note that this was achieved without creating database views or writing complex SQL statements with joins. It demonstrates how C1DataObjects is used to facilitate database application development, playing the role of a data modeling and query building tool. The most compelling benefits of the C1DataObjects’ structured data model become apparent when you try modifying data. C1DataObjects does not merely present data as independent simple tables of rows. It maintains the specified structure automatically when you modify data – the task universally required in database applications and one that other data frameworks, including ADO.NET, fall short of supporting.

· To observe how C1DataObjects maintains underlying structure on data modifications, try changing the EmployeeID field in the first row of the Customers grid from 6 to 1. The FirstName and LastName fields, dependent on EmployeeID, will change correspondingly. Now go to the Employees grid and change the LastName of the employee with EmployeeID=1. You will see that all rows of the Customers grid that have EmployeeID = 1 reflect this change, show the new LastName value. Alternatively, you can change the LastName or FirstName field in the Orders grid and see the change reflected in the Employees grid. Whatever the change, C1DataObjects recognizes the changes so you can rely on proper structure being maintained for your data at all times.

· C1DataObjects supports master-detail hierarchy, as you can see in the Customers and Orders grids. The Orders grid shows the orders of the customer currently selected in the Customers grid. It also supports sorting: you can click a column header of a grid and the data will be sorted by that column.

· In the Orders grid, you can see the ExtendedPrice column, which is a calculated field we defined in the schema.

· Try entering a negative number in the UnitPrice column of the Orders grid. Negative numbers are not allowed in accordance with the constraint we defined for the Products.UnitPrice field.

· Press button2 (“Products and orders”), Form2 will open with two grids showing the two composite tables defined in the second data set of our schema, ProductsOrders.

· Try entering a negative number in the UnitPrice column of the Orders grid in Form2. Negative numbers are not allowed here as they are not allowed in Form1, because of the same constraint defined in the Products.UnitPrice fields. This demonstrates a very important and powerful feature of C1DataObjects: business logic defined on table level is enforced in all composite tables and in all data sets where this table is used. You define business logic where it belongs, and do it only once, the rest is C1DataObjects’ responsibility.


Tutorial 2 - Business Logic

Tutorial 2 – Business Logic

In this tutorial, you will learn how to:

· create a data library that can be used in multiple projects, and

· define business logic for your data objects that is enforced by C1DataObjects wherever these objects are used

In the previous tutorial, we defined and used data objects in the same project. This is not how C1DataObjects is supposed to be used. The right way to use C1DataObjects is to define your business objects (data objects) in a separate assembly, data library, so it can be used by multiple applications. Although this is not mandatory, your enterprise can assign a special team of “data-oriented” developers to the task of creating business object projects (data libraries) and another team of “GUI-oriented” developers to creating client applications using data libraries. This is how C1DataObjects enables you to benefit from the right design and development technology. However, C1DataObjects fits equally well into smaller development projects, where business objects and client applications are developed by the same team. The main architectural benefit of using C1DataObjects is in clear separation between business logic and presentation layer (GUI), encapsulation of your data model and logic in a centralized place (data library) reused by multiple clients, that makes your applications robust, scalable and fun to develop. This is not to mention numerous tools and enhancements C1DataObjects adds to your data access toolbox, including such powerful and extremely important one as virtual mode (cached access to large recordsets), see Tutorial 4 - Virtual Mode: Dealing with Large Datasets.

A data library is an assembly (DLL) containing C1DataObjects schema and business logic components and code that defines your data objects. These data objects can then be used in any project by simply referencing the library in the project and using a C1DataObjects C1DataSet component to connect to the library. All database access and business logic code is encapsulated in the library, so it can be created and maintained independently of client applications.

1. Create a new Data Library project using the C1DataObjects Data Project Wizard. Select File|New|Project in the Visual Studio menu, and in the New Project dialog select ComponentOne Data Library under Visual C# Projects or Visual Basic Projects, according to your language preference. Enter the project name: Northwind and press OK. The C1DataObjects Project Wizard dialog will open. Leave the default settings there, press Finish. The Northwind data library project is created for you.

2. The main file of the resulting data library project is DataClass.cs (.vb): a component class where you will host the schema and business logic (in large projects, it is also possible to distribute business logic code over multiple files). Open the DataClass file, select the c1SchemaDef component, press the right mouse button and choose Schema Designer from the context menu. The Schema Designer will open.

3. We will use the schema created in Tutorial 1. Select File|Open in the Schema Designer menu and open the schema file that was saved in Tutorial 1. The schema will show up in the designer. Close the Schema Designer and answer Yes to the question whether you want to save the schema.

4. Now, having the schema in place, we can specify business logic. You already saw some elements of business logic, namely, constraint expressions and calculation expressions, in Tutorial 1. Expressions are an easy and straightforward way of defining business logic. However, when expressions are not enough, some code must be written. In this tutorial, we will show how to write business logic code.

Every schema object can be represented by a special business logic component. Business logic components (components C1.Data.C1TableLogic and C1.Data.C1DataSetLogic) have events where you can write code responding to various occurrences in data objects.

Press the right mouse button on the c1SchemaDef component and select Create Business Logic Components from the context menu. This will create a business logic component for each table and each data set in the schema. We will only need three of them, so delete all the rest, leaving the following three components: table_Customers, table_Order_Details, dataSet_ProductsOrders.

Alternatively, you can create the three business logic components manually, from the Toolbox (components C1TableLogic, C1DataSetLogic), but then you will have to set their properties: SchemaComponent = c1SchemaDef, and also Table and DataSetDef.

5. Create an event handler table_Customers_BeforeFieldChange and write the following code there:

· Visual Basic

· C#

· Delphi

This code will be executed each time the value of a field in the Customers table is about to change. As with all other C1DataObjects business logic events, it is triggered at any attempt to change a field of any object, be it a table view or a composite table that will end up changing a Customers field. So the logic we put here will be enforced in any object, in any context where the Customers table is involved.

The code here converts the proposed CustomerID value to upper case.

6. Create an event handler table_Order_Details_BeforeFieldChange and write the following code there:

· Visual Basic

· C#

· Delphi

The code for Quantity turns a negative value to 1 before it is assigned to the Quantity field of the Order Details table.

The code for Discount tests a constraint 0 < Discount < 1 and shows a message if it is not satisfied. It is executed before changing the Discount value.

7. Create an event handler table_Order_Details_AfterFieldChange and write the following code there:

· Visual Basic

· C#

· Delphi

This code executes after the value of the field Quantity in Order Details has changed. It makes necessary changes in the corresponding Products row. There are some important features in this code that warrant an explanation:

You see two classes, Order_DetailsRow and ProductsRow here. These are data object classes generated by C1DataObjects. Class Order_DetailsRow represents an Order Details row, and ProductsRow represents a Products row. Such classes are automatically generated and maintained by C1DataObjects for each table and table view in the schema. For example, ProductsRow is an object (business object, data object) where each field has a corresponding property (ProductsRow.UnitPrice, ProductsRow.UnitsInStock, etc) and each relation has a corresponding method (Products.GetOrder_DetailsRows, etc) allowing you to obtain child rows and the parent row).

Using these classes, you can write your business logic code in a convenient, type-safe way, and benefit from Visual Studio code completion features giving you the lists of properties and methods to choose from.

The data object classes belong to the Northwind.DataObjects namespace (substitute your data library name instead of Northwind, if different). They are hosted in the assembly Northwind.DataObjects.dll. This data objects assembly is generated by C1DataObjects each time you change the schema and save it in the C1SchemaDef component. C1DataObjects Project Wizard adds a reference to this assembly to your data library project References.

8. Create an event handler dataSet_ProductsOrders_AfterEndAddNew and write the following code there:

· Visual Basic

· C#

· Delphi

This code executes after a new row has been added to the CustOrdersDetails table view, and all primary key fields have been specified, so the row is no longer a “temporary new row” (meaning primary key is yet undefined). This code fills shipping attributes given known values of billing attributes. Apart from another example of using data object classes in business logic code, this code shows yet another important C1DataObjects feature, specifically:

You can specify business logic on table level (as in the previous examples), then it will be executed wherever this table is involved. But you can also specify business logic on data set level (in other words, on table view level), as in this example. Such code will be executed only in this data set. Using dataset-level business logic you can enforce rules that are specific to a certain data set.

Intermission: Business Logic Events

This tutorial demonstrates only a limited number of business logic events. Here is a brief list of business logic events available in C1DataObjects (we omit prefixes Before and After pertaining to most events, retain the prefix only if an event occurs only Before or only After):

AddNew | Fired when a new (empty) row is added.
AfterChanges | Fired when all changes initiated by a field change are done and handled by the business logic code, see the FieldChange event.
BeginEdit | Fired when the user starts editing a row (data-bound controls start editing a row immediately after they position on it, even though no changes have been made yet).
CancelEdit | Fired when the user cancels editing a row reverting the changes made to it.
Delete | Fired when a row is deleted.
EndAddNew | Fired when a newly added row becomes a regular row in the rowset. When a row is added, it is added empty, its primary key is unknown. A row with unknown primary key is in special transitory state, it is not a regular rowset row. Only after its primary key is set it becomes a regular (added) row, which is signaled by this event.
EndEdit | Fired when the user finishes editing a row (data-bound controls finish editing a row when they leave that row, even if no changes have been made).
FieldChange | Fired when a field value is set. Inside this event, your code can set other fields triggering recursive FieldChange events, C1DataObjects handles this situation correctly. Only after all changes are done and handled, AfterChanges event is triggered.
FirstChange | Fired when a first change is made to the row (a field value changed) after BeginEdit.
UpdateRow | This event is not fired in a client application, unless it is a direct client, that is a 2-tier application updating the database directly from client, see Tutorial 3 – Developing distributed 3-tier applications. In a 3-tier deployment, it is fired only on the server, when a modified row is committed to the database.

9. Compile the Northwind project. Now we have prepared a data library, so we can use it in a client application.

10. Create a new Windows Application project. Select Project|Add Reference… to add a reference to the compiled Northwind.dll assembly to your client project.

11. Place the following components on the form as shown in the figure: c1DataSet1 (C1.Data.C1DataSet), two grids, c1TrueDBGrid1-2 (C1.Win.C1TrueDBGrid.C1TrueDBGrid) and a command button, button1 (System.Windows.Forms.Button):

12. Select the c1DataSet1 component and set its properties: type the data library name Northwind in the DataLibrary property; select ProductsOrders from the drop-down list of the DataSetDef property. These settings connect c1DataSet1 to the ProductsOrders data set of the data library. Now we can use the c1DataSet1 component as a data source for data bound GUI component grids.

13. Set the DataSource property of the two grids to c1DataSet1 and select the values in their DataMember properties as follows: c1TrueDBGrid1.DataMember = CustOrdersDetails, c1TrueDBGrid2.DataMember = ProductOrderDetailsCust.

14. In order to be able to send data modifications to the database, add the following code to the button1.Click event:

· Visual Basic

· C#

· Delphi

15. As in Tutorial 1, add the following code to the c1DataSet1_Before_Fill event handler, to restrict (filter) the data set:

· Visual Basic

· C#

· Delphi

Run the Program and Observe the Following:

· The two grids show data according to the schema defined in the data library. So, developing a client application, provided that you already have a data library, all you have to do is to connect to it as to a data source. No data-oriented code or business logic code is necessary in a client GUI application. This provides a clear separation between your data and business logic and your GUI (presentation) code, and you can also reuse the business logic-providing data libraries in multiple GUI front end applications without a slightest need of modifying or even knowing the centralized business logic code.

· Try entering a negative number in the Quantity column in both grids. You will see that the business logic code ensuring that the entered Quantity value is positive works in both table views, CustOrdersDetails and ProductOrderDetailsCust containing the Order Details table.

· Changing Quantity value in the two grids you can also see that the business rule changing Products.UnitsInStock on Quantity change is also enforced under any circumstances where the Products table is involved, in this case, in two different table views, CustOrdersDetails and ProductOrderDetailsCust. To see that, you need to find a row in the top grid and a row in the bottom grid containing the same ProductID (to facilitate that, you can sort both grids by ProductID). Then changing quantity in both of them will affect the UnitsOnOrder column.


Tutorial 3 - Creating Distributed 3-Tier Applications

Tutorial 3 – Creating Distributed 3-Tier Applications

Although Visual Studio .NET makes great strides towards facilitating development of distributed applications, it falls short of completely automating it. You still need to add many items to your application to make it a distributed, web application. You need to create web services, write server-side code retrieving and updating data on the server, etc. C1DataObjects fills this gap, makes it incredibly easy to create distributed applications.

In fact, from the developer’s standpoint, it does not require any additional steps whatsoever to use a C1DataObjects data library in a distributed, web environment. You develop your data and business logic code (a data library, see Tutorial 2) in exactly the same way, regardless of whether you will use it in a classic two-tier client-server environment (as we did in Tutorial 2), or in a web distributed environment. It becomes simply a matter of deployment. In this tutorial we will do exactly this, use the Northwind data library as it was built in Tutorial 2, in a distributed environment.

In a distributed scenario, you have your data library assembly deployed on the server and on the client. Deploying it on the client you can use the .NET assembly download facilities, so you will not need a special client installation procedure, the data library and other parts of your application will be automatically downloaded from the server and, if necessary, automatically upgraded. C1DataObjects manages the data library code, so that necessary parts of your business logic code execute on the server and other parts execute on the client. All this is done transparently to the developer, so your business logic code must be concerned with its proper task, business logic, and does not need to organize client-server interaction or event to be aware of it.

In short, C1DataObjects makes developing distributed, web applications very simple. You just create an application as you always do, regardless of whether it is distributed or not, and C1DataObjects makes it distributed for you and manages all server-client interaction according to the actual deployment environment.

Server-side C1DataObjects data libraries work according to the web services architecture, the server is stateless, and they do not maintain live database connections per user. So the distributed application support in C1DataObjects is as effective and scalable as with manually written server-side code, the only difference is that, of course, in C1DataObjects you can do it with no effort at all, C1DataObjects does it for you.

An additional advantage of the C1DataObjects distributed model is that you can use any of the multiple deployment scenarios and options supported by .NET Remoting. You can deploy your data library on the server as a web service, an IIS application, or you can create your own server hosting the data library assembly.

In this tutorial, we have chosen the option of hosting the data library in a special host application (server), instead of hosting it in IIS (Microsoft Internet Information Server), to make the tutorial independent on IIS. Using C1DataObjects over the web as a web service is even easier than the process demonstrated in this tutorial. All you need to do is publish your data library as an IIS application, creating a virtual directory hosting your data library assembly.

1. Create a new Windows Application project. That will be our server, let’s call the project ThreeTierServer.

2. Select Project|Add Reference… to add a reference to System.Runtime.Remoting.dll (the .NET Framework assembly responsible for .NET remoting) to the project.

Select Project|Add Reference… to add a reference to the compiled Northwind.dll assembly, built in Tutorial 2, to the project.

3. Add the following code to the Form_Load event of the form:

· Visual Basic

· C#

· Delphi

Here “ThreeTierServer.soap” is the name we have chosen to identify this data library in its clients, the URI (Unified Resource Identifier). You can choose any unique identifier you like, provided you use the same ID in the client, in C1DataSet.LibraryURL property that specifies the connection.

This code registers C1DataObjects remoting service with .NET remoting framework. In this tutorial, we use TCP/IP channel, not the more popular HTTP channel that you would normally use in a web application, because we want the tutorial to work on machines with no web server running.

Instead of this code, you can use a configuration file for remoting registration. If you are deploying your data library in IIS, a configuration file is the only option. A configuration file web.config for IIS deployment can look, for example, as follows:

<configuration>

<system.runtime.remoting>

<application>

<service>

<wellknown mode="Singleton"
type="Northwind.RemoteService, Northwind"
objectUri="ThreeTierServer.soap"
/>

</service>

</application>

</system.runtime.remoting>

</configuration>

4. Now, that our Northwind data library is deployed on a server, we can use it in a client application. This client application can reside on the same machine, or it can be thousands of miles away, it is just a matter of setting a single property in the client application specifying the connection URL. A client application for distributed use is created in exactly the same way as a regular client application, in fact, it is a regular client application, such as we build in Tutorial 2, the only difference is that we set the connection property, C1DataSet.LibraryURL.

To build a client application, repeat steps 10 –15 of Tutorial 2, or just copy the client project from Tutorial 2. Then open the form, select the c1DataSet1 component and set c1DataSet1.DataLibraryURL = “tcp://localhost:8000/ThreeTierServer.soap”. This will connect it to the server.

Run the Server Application, Then Run the Client Application and Observe the Following:

The client application behaves exactly as the application we built in Tutorial 2. This is C1DataObjects’ transparent distributed application development at work: with no code changes we have deployed our application in a distributed environment. All database access code is executed on the server, and business logic is executed on the client without a single line of code added for that purpose to the client application. The server can be anywhere on the Internet, it is just a matter of changing the URL from localhost to an Internet address, for example, to c1DataSet1.DataLibraryURL = http://www.mycompany.com/ThreeTierServer.soap.


Tutorial 4 - Virtual Mode: Dealing with Large Datasets

Tutorial 4 - Virtual Mode: Dealing with Large Datasets

Visual Studio .NET and its underlying data engine, ADO.NET support only one mode: disconnected access to data. An ADO.NET data set is always pre-fetched in its entirety from the server to the client. Pre-fetching large data sets over the wire creates two serious problems:

· Even distributed web applications often include large data sets, such as, for example, a list of available products and other data originated in database tables with thousands records and more. It is very inefficient and in many cases impossible to transfer such data from server to the client in its entirety. This forces developers to produce makeshift solutions (such as asking the user to enter a few initial letters of the product name before showing the list of products) severely reducing the quality of end user experience, application performance and scalability.

· The absence of large data set support makes it impossible to develop classic client-server and desktop database applications in Visual Studio .NET (without C1DataObjects), which is of course a serious drawback, since many developers still need and will need in the foreseeable future to develop such applications. These applications traditionally require access to large data sets. A popular belief that you only need large data sets if you have not designed your application right, is a misconception due to the lack of tools supporting the right data access modes. Another popular misconception is that disconnected model (also referred to, somewhat loosely, as “web application”, “3-tier application”, etc) necessarily means pre-fetching all the data from the server to the client at once, that any other approach is necessarily the old “live connection per user” that is not scalable.

C1DataObjects fills this gap, offering a solution to the problem of large data sets. It proves the misconceptions mentioned above wrong. It gives you the tool to achieve the best of both worlds, to have data access that is both disconnected (no live connection is maintained on the server for particular users) and therefore scalable, and at the same time, unlimited in data size.

To use a large data set in C1DataObjects is as easy as setting a property, DataAccessMode to Virtual Mode.

Perhaps you are skeptical, you may think that it might work in a demo but never in a real world with huge tables, etc. Well, how about a table of 2.7 million rows? This is exactly what you will see in this tutorial, and you will see this data showing up in a grid (ComponentOne C1TrueDBGrid) with no delay and scrolled through with no noticeable delays either.

Although it is not demonstrated in this tutorial, you can use virtual data access mode in distributed web-based applications (see Tutorial 3) as well, simply by setting the DataAccessMode property to Virtual.

1. Create a new Windows Application project. Place the following components on the form as shown in the figure: c1SchemaDef1 (C1.Data.C1SchemaDef), c1DataSet1 (C1.Data.C1DataSet), c1DataTableSource1-2 (C1.Data.C1DataTableSource), c1TrueDBGrid1-2 (C1.Win.C1TrueDBGrid.C1TrueDBGrid), two labels, label1-2 and a command button button1 (System.Windows.Forms.Button):

Set the label and button Text property as shown in the figure.

2. We will use the schema created in Tutorial 1. Select File|Open in the Schema Designer menu and open the schema file that was saved in Tutorial 1. The schema will show up in the designer

3. To enable virtual mode, we need to set the DataAccessMode property for table view objects that we need to be accessed “virtually” (“virtual”, as opposed to “static”, means we fetch data in increments, on demand, as opposed to fetching everything at once):

Open the ProductsOrders DataSet. In the DataSet Editor select the ProductsorderDetailsCust table view (click the title bar of the rectangle) and choose VirtualAutomatic in the DataAccessMode property combo box, then do the same for the second table view, CustOrdersDetails. Close the Schema Designer and answer Yes to the question whether you want to save the schema.

DataAccessMode = VirtualAutomatic means that fetch is performed in increments (segments) in background mode, asynchronously, while it becomes available to the user and interactive immediately after the first segment is fetched. The user has interactive access not just to the data already fetched in background, but to the whole table, including its physical end, so the user sees data in its entirety, as if all data were transferred to the client, although background fetch may be yet incomplete. To enable this transparency, C1DataObjects performs fetch on demand, when the user requests data not yet fetched from the server, in addition to the background fetch.

DataAccessMode = VirtualAutomatic is appropriate for large tables that are big enough to make it undesirable to fetch all data at startup time (doing so would incur a long delay before application becomes interactive), but not too big, so they still fit in client memory. Later in this tutorial we will also use DataAccessMode = Virtual, which is intended for very large tables, so large that they do not fit in memory.

4. Set up the c1DataSet1 component, the C1DataTableSource components, and bind the grid components to them, specifying the following property setting:

c1DataSet1.SchemaSef = c1SchemaDef1

c1DataSet1.DataSetDef = ProductsOrders

c1DataTableSource1.DataSet = c1DataSet1

c1DataTableSource1.TableView = CustOrdersDetails

c1DataTableSource2.DataSet = c1DataSet1

c1DataTableSource2.TableView = ProductsOrderdetailsCust

c1TrueDBGrid1.DataSource = c1DataTableSource1

c1TrueDBGrid2.DataSource = c1DataTableSource2

Note that we bind the grids to C1DataTableSource components rather than directly to a C1DataSet component. This is essential for virtual mode, it works only if you use C1DataTableSource as your data source.

5. Create a c1DataTableSource1_AsyncFetchComplete event handler and add the following code to it:

· Visual Basic

· C#

· Delphi

Create a c1DataTableSource2_AsyncFetchComplete event handler and add the following code to it:

· Visual Basic

· C#

· Delphi

This ends setting up of the first form, Form1, where we use DataAccessMode = VirtualAutomatic.

6. Now, let’s add a second form to the project, where we will show a really big table, the promised 2.7 million rows. For such huge data amounts we must use DataAccessMode = Virtual.

In this part of the tutorial we will need an SQL Server connection. Up until now a Microsoft Access sample database was enough, but here we must use SQL Server. MS Access, being a desktop database, does not provide sufficient query optimization, so it cannot be effectively used in C1DataObjects virtual mode. We will use the SQL Server sample Northwind database included in the standard SQL Server installation. Note: If you are running the pre-built tutorial projects included in C1DataObjects installation, you will need to change the connection string in this tutorial to point to your SQL Server instance.

Obviously, we do not want to physically fill 2.7 million rows in your SQL Server database, so we will simulate a huge table by creating a composite table with “self-joins”, repeating the same tables, Order Details and Products several times to create the desired effect:

Order Details →(∞-1) Products →(1-∞) Order Details

→(∞-1) Products →(1-∞) Order Details

Add a new form to the project and place the following components on the form as shown in the figure: c1SchemaDef1 (C1.Data.C1SchemaDef), c1DataSet1 (C1.Data.C1DataSet), c1DataTableSource1 (C1.Data.C1DataTableSource), c1TrueDBGrid1 (C1.Win.C1TrueDBGrid.C1TrueDBGrid):

7. As in other tutorials, we start with the schema created in Tutorial 1. Select File|Open in the Schema Designer menu and open the schema file that was saved in Tutorial 1. The schema will show up in the designer. Press the right mouse button over the Tables window and select Add Composite table from the context menu. In the newly added node, change the default name “CompositeTable” to HugeTable. By drag-and-drop from the Tables window to the Composite Table Editor (Diagram page) add five table view objects to the diagram: three instances of Order Detail table and two instances of the Products table. In the resulting diagram, delete redundant relations (select a relation and press the Del key, or select Remove from the context menu) and invert the first and the third relations (select the relation and choose Invert from the context menu), so that the resulting diagram becomes:

Order Details →(∞-1) Products →(1-∞) Order Details

→(∞-1) Products →(1-∞) Order Details

Define composite table fields checking the check boxes for the following fields in the diagram: for the first Order Details table: OrderID, ProductID; for the first Product table: ProductName; for the second Order Details table: OrderID; for the second Products table: ProductName; for the third Order Details table: OrderID.

Press the right mouse button in the DataSets window and select Add in the context menu. For the newly created data set node, change the default name “DataSet” to TheHugeOne. Drag the HugeTable node from the Tables window and drop it in the DataSet Editor, that will create a data set consisting of a single table HugeTable.

And finally, set the DataAccessMode property of the table view (the only table view in TheHugeOne data set) to Virtual.

8. As it was mentioned in Step 6, we need to change the database connection here from MS Access to SQL Server, to the SQL Server sample Northwind database included in the standard SQL Server installation. This is easily done in Schema Designer: double-click the existing Connection node in the Connection window. A Connection Editor will open. Press the button to the right of the Connection string, it will open the standard OLE DB Data Link Properties dialog. Select Microsoft OLE DB Provider for SQL Server on the Provider page, then select your SQL Server server name and the Northwind database.

Close the Schema Designer and answer Yes to the question whether you want to save the schema.

9. Set up the c1DataSet1 component, the C1DataTableSource component, and bind the grid c1DataTableSource1, specifying the following property setting:

c1DataSet1.SchemaSef = c1SchemaDef1

c1DataSet1.DataSetDef = TheHugeOne

c1DataTableSource1.DataSet = c1DataSet1

c1DataTableSource1.TableView = HugeTable

c1TrueDBGrid1.DataSource = c1DataTableSource1

Note that we bind the grid to the C1DataTableSource components rather than directly to the C1DataSet component. This is essential for virtual mode, it works only if you use C1DataTableSource as your data source.

10. To activate Form2, add the following code to the button2.Click event:

· Visual Basic

· C#

· Delphi

Run the Program and Observe the Following:

· The first form demonstrates DataAccessMode =VirtualAutomatic, where C1DataObjects continues to fetch data in the background while the user can interact with the grid as though the data were fetched completely to the client. The labels below the grids show the status of background fetch: they show “Fetching data…” until the fetch is complete. While the label still shows “Fetching data…”, try going to the last row by dragging the scrollbar thumb to the bottom. After a brief delay you will see the last row (CustomerID=” WOLZA”, OrderID=11044). This is the actual last row of the table, and C1DataObjects positions to the end of the table (as well as to any other desired position) correctly, although the background fetch is still in progress, has not yet reached the last row. Unlike asynchronous fetch features in other tools, C1DataObjects implements it transparently to the user, the user does not need to be aware that background fetch is incomplete.

· When C1DataObjects finishes fetching all rows in the background, it automatically switches to the regular in-memory mode, so the scrollbar is now exactly position according to the current row number (while fetch is in progress, the scrollbar position is approximate, because total row count and absolute row numbers are not yet known).

· Now, press the “Huge table” button and enjoy the view of a 2.7 million rows table!

· Try scrolling forward fast by continuously pressing the PageDown key in quick succession. You will notice that after a few keystrokes it pauses for a brief moment. This occurs when C1DataObjects refreshes its cache fetching a new portion of data from the server. Now try scrolling forward a bit slower, making a short pause each time after you press PageDown. You will notice that if you do it this way, the delays disappear, the grid reacts immediately to every keystroke. This is a result of one of the optimization techniques employed by C1DataObjects: if necessary, it fetches additional segments of data during periods of inactivity. Since users rarely scroll through data without at least taking a look, in most cases, this technique creates the impression of continuous smooth scrolling without pauses and delays.

· Try going to the last row by dragging the scrollbar thumb to the bottom. After a brief delay you will see the last row (OrderID=11077, ProductID= 77,…). C1DataObjects only paused for a brief moment necessary to fetch the segment of rows in the end of the table, it did not fetch the whole enormous number of rows as other tools do when last record is requested.


Schema Objects

Schema Objects

A Schema is the basis and starting point of C1DataObjects development. It contains data structure information, defining basic entities, such as tables and relations, with their properties. Normally, a schema is initially created by importing a database structure using the Import Wizard in the Schema Designer, and then customized in the Schema Designer to suit your business logic needs. A schema can also be imported from an ADO.NET schema. See Converting Schema from Other Sources.

A schema is stored in a C1SchemaDef component, in the form of an XML string in the .resx resource file. To create or edit a schema, open the context menu of a C1SchemaDef component and select Schema Designer from the menu.

A C1DataObjects data library always contains a single schema, that is, a single C1SchemaDef component. An application that uses C1DataObjects directly, without a data library (direct client) is allowed to have multiple schemas, each stored in its own C1SchemaDef component.

In most cases, a schema is created at design time in the Schema Designer, and used at run time without modification. However, all schema objects are programmatically accessible at run time through the schema object model, with the Schema class being the root of that object model. Using this object model, it is also possible to modify the schema or even define it from scratch at run time, using the CreateSchema event. This, however, is rarely needed, so you will not need to use schema objects programmatically unless in special cases. Most of the time, you will only deal with schema objects at design time, in the Schema Designer.

Schema objects, classes comprising the Schema object model, are structure-only, they do not contain actual data. They are created when a C1SchemaDef component is initialized and immediately become accessible through its Schema property, before any data is fetched. Moreover, they do not represent the actual data, they only represent the structure. The actual data is fetched and managed by another component, C1DataSet. There can be multiple C1DataSet components bound to a single schema.

A C1DataSet component holds a collection of C1DataTable objects, each one representing a set of rows existing in this data set for a particular schema object. In fact, a C1DataSet has two collections of C1DataTable objects: Tables for data contents of Table schema objects, and TableViews for data contents of TableView schema objects. The SchemaTable property returns the schema object (either Table or TableView) defining the structure of this C1DataTable.

Importing Database Structure

Converting Schema from Other Sources

Database Structure Evolution and the Schema

Database Connections

Connections and Transactions at Run Time

Supporting Distributed (COM+) Transactions

Native and OLE DB Database Access

Simple Tables

Simple Relations

Composite Tables

Composite Relations

Data Sets

Table Views

View Relations

How to Access Table View Data

Data Binding

Programmatic Access


Importing Database Structure

Importing Database Structure

The C1DataObjects Schema Designer provides an Import Wizard that creates a schema based on the structure information stored in a database. It creates simple tables based on database tables, and simple relations between them based on foreign key constraints stored in the database. Tables are created with fields according to the field structure of the database tables. Field properties, such as DataType, PrimaryKey and others are set according to the database field properties. Later, you can customize table fields, change their properties, delete unnecessary fields, change the fields order, and add new fields, not necessarily based on database table fields.

Importing the database structure also creates a database connection (in the Connections window of the Schema Designer), that you can use later to connect to the database while editing the schema. For more information on importing a database structure, see Using the Import Wizard.

After you have imported the database structure, you can modify the schema, add tables (simple and composite), create relations, etc.After import, the Schema Designer is connected to the database, so the Database Tables window is filled with the list of all database tables with their fields.

To connect to the database, select Connect to database... in the Schema menu, and specify the connection and optional parameters in the Connect to database dialog.

Note: It is not necessary to be connected to the database in order to work in Schema Designer, although live connection has some advantages. For example, the DbTableName property of a table and the DbFieldName property of a field show the lists of available tables and fields, respectively, if the designer is connected to the database. Also, in connected mode, it is possible to create schema tables by drag-and-drop from the Schema graph window. Other than that, there is no need to be connected to the database while editing a schema.


Converting Schema from Other Sources

Converting Schema from Other Sources

The C1DataObjects Conversion Wizard allows you to import (migrate) schema information from an existing ADO.NET dataset or from an XML schema file (.XSD). You can convert an existing database project from ADO.NET to C1DataObjects without recreating schema information from scratch. To invoke the wizard, select "Conversion Wizard..." in the context menu of a C1SchemaDef component. This will open the Conversion Wizard dialog box.

Here you can choose the source of the schema information to be imported. It can be an ADO.NET Dataset component located in a form or another file that is currently open in the IDE, or it can be an .XSD file containing ADO.NET dataset structure in XML form. Necessary objects (tables, relations, a data set) will be created automatically in the schema based on the imported information. Once it is done, you can open Schema Designer to view and edit the imported schema.

Additionally, the C1DataObjects Conversion Wizard can facilitate migrating a project from C1DataExpress to C1DataObjects Enterprise. In this case, choose a C1DataExpress component as the source for your schema. It can be either a standalone C1ExpressTable component or a C1ExpressConnection component with C1ExpressTable components attached to it.

For additional information, see Using the Conversion Wizard.


Database Structure Evolution and the Schema

Database Structure Evolution and the Schema

After importing database structure to a schema, the database usually changes with time as the development process progresses. As a result, the schema may be no longer in sync with the database structure. Such discrepancies cause problems at run time and they are hard to keep track of manually. Special Schema Designer menu items and other features help developers to keep the schema in sync with the database.

The schema comparison/differences tool scans the schema and database structure and shows differences between them in the Output window. To use this tool:

1. Select Compare schema with database structure from the Schema menu. The Compare schema with database structure window appears.

2. Select the checkbox next to Compare tables and fields to include tables and fields in the comparison. You can also check which types of objects to import from the database: tables, views, aliases.

3. Select the checkbox next to Compare relations to include relations in the comparison.

4. Select the database connection from the dropdown box next to Connection.

5. Click the Options button to select the warnings to be displayed in the Output window once the comparison has been completed. Click OK to close the Options window and return to Compare schema with database structure.

6. Click OK to close the Compare schema with database structure and begin the comparison. The results appear in the Output window.

Contents of the Output window can be copied to the clipboard using the window's context menu. The tool shows only differences for objects and properties that can be imported from the database structure. In effect, the tool compares two schemas: one is the existing schema and the other is the schema that would result from the import of the database structure if such import would be performed from scratch at the time of comparison. Only tables, fields and relations belonging to the selected connection are processed. So, unbound (calculated) fields are ignored, as are unbound tables, or tables and relations bound to other connections.

The additional import tool (Add absent database objects in the Schema menu) allows you to import additional fields or whole tables and additional relations that could be added to the database after the schema was created from the database structure. This tool does not change any properties of the objects that are already in the schema, so you can safely use it to add new tables, fields and relations as they are added to the database. To use this tool:

7. Select Add absent database objects from the Schema menu. The Add absent database objects window appears.

8. Select the checkbox next to Import tables and fields to import the ones not already in the schema. You can also check which types of objects to import from the database: tables, views, aliases.

9. Select the checkbox next to Import relations to include relations not already in the schema.

10. Select the database connection from the dropdown box next to Connection and click Next to continue. The next Add absent database objects window appears.

11. Select the desired objects from the Available tables and fields window and use the arrows to move them to the Selected tables and fields window. You can click the node next to the tables to view the list of fields in each table.

Note: Clicking the Show only tables present in the schema checkbox displays only the tables already in the schema in the Available tables and fields window.

12. Click Next and use the arrows to move the desired relations from the Available Relations window to the Selected relations window.

13. Click Finish. The Schema Designer appears with the specified tables, views, and aliases.

Finally, there is a Retrieve Fields button in the simple table editor (in the toolbar at the top of the Fields panel). It performs two functions that can be selected in a pop-up menu at the right edge of the button: Retrieve all fields (default) and Add absent fields.

The Retrieve all fields action deletes all existing fields and retrieves fields from database structure. There is a confirmation dialog that warns you that this action will delete all existing fields with all their settings. The second action, Add absent fields, does not change the existing fields or their properties in any way. It adds the fields that exist in the database table but do not exist in the schema table. Usually those are fields that were added to the table after the schema was created.


Database Connections

Database Connections

A Connection object defines a connection to a database. C1DataObjects supports database access through OLE DB, native database access for SQL Server and Oracle, and also any other (custom) .NET data providers, see Native and OLE DB Database Access.

Although, in most cases, a schema contains a single database connection, it is possible to have multiple connections in a schema. To create a connection, click the Add button and choose a connection type or select Add from the context menu in the Connections window of the Schema Designer.

You can also add connections using Import database structure... or Connect to database... in the Schema menu(see Importing Database Structure for details).

Connections are stored in the Connections property of the Schema object. The list of available connections is shown in the Connections window of the Schema Designer.

Each simple table has a Connection property associating it with a certain database connection. Together with the DbTableName property, it determines the database table on which this table is based (if any, see Simple Tables for details).

C1DataObjects uses Connection objects to perform database access operations, fetch and update on the server, freeing developers from the tedious task of writing database access code. Database access is performed automatically by C1DataObjects, and it can be customized with user code in appropriate business logic events, see How the Data is Fetched and Updating the Database. A Connection object also serves as transaction context. Performing database updates, C1DataObjects opens a separate transaction for each connection involved in the operation. In the case of multiple connections, these transactions are managed together in a consistent way, They are either committed or rolled back together, so the whole update operation is performed consistently, as a single, possibly heterogeneous (spanning multiple databases) transaction.

Having multiple connections in a schema allows you to easily switch between different physical databases storing the same logical data, without changing anything else. This is possible both at design and at run time. All that is needed is to change the Connection property in DbTable objects. At run time, it can be done either in the CreateSchema event or using the DynamicConnections run-time property.

Sometimes, Connection objects must be changed at run time, to set a specific database location, user ID, password, connection timeout, or other attributes of the ConnectionString. ConnectionString contains all necessary information to make a database connection. Changing it at run time allows you to adjust that information dynamically. Changing ConnectionString and other connection properties can be done at run time using one of the two methods: in the CreateSchema event or using the DynamicConnections property. In the CreateSchema event you can change any part of the schema, including connections, but that is done only once for the whole application, when the data library is initialized. If you need to change ConnectionString or other connection properties several times or on a per-data set basis, use the DynamicConnections property of C1DataSet.

You may also need to change the ConnectionString at run time for security reasons, because you do not want to expose User ID and Password information to all clients of the data library. A frequently used technique is to clear the ConnectionString in Schema Designer before you deploy the data library and use the DynamicConnections property to specify the ConnectionString at run time.

To edit a connection, double-click the connection object in the Connections window to open the Connection Editor.

Here you can edit the ConnectionString, either manually or in the standard Data Link Properties dialog. Also in the Connection Editor, you can specify SQL syntax rules, properties of the SqlDialectInfo object. These properties determine various specifics of SQL syntax relevant to C1DataObjects that can vary between different databases. Normally, these properties are set automatically to their appropriate values, when you specify ConnectionType or ConnectionString, but, occasionally, they may need manual adjustment, for example, when using a third-party OLE DB provider or a custom .NET data provider.


Connections and Transactions at Run Time

Connections and Transactions at Run Time

In addition to changing ConnectionString at run time, you can also set the database connection (and/or transaction) to a pre-created IDbConnection (IDbTransaction) object. Fetching data and updating the database (in Fill and Update methods), C1DataObjects creates a database connection and transaction for each schema Connection object, if its DbConnection has not been set. If you need to use a pre-created database connection, set the DbConnection property. To prevent C1Data from creating its own connection, it must be set:

for Fill: in or before C1DataSetLogic.BeforeFetch event;

for Update: in or before C1DataSetLogic.BeforeUpdate event.

If you set DbConnection to your own IDbConnection object, C1DataObjects will not close that database connection automatically -- you are responsible for closing it. That is usually done in C1DataSetLogic.AfterFetch/AfterUpdate events.

By default, C1DataObjects opens a database transaction for each database connection before Update.

If you want to use your own transaction object, set the DbTransaction property in or before BeforeUpdate event.

If you set DbTransaction to your own IDbTransaction object, C1DataObjects will not close (commit or roll back) that transaction automatically. You are responsible for committing it in case of success or rolling it back in case of failure, which is usually done in AfterUpdate event.


Supporting Distributed (COM+) Transactions

Supporting Distributed (COM+) Transactions

Distributed (COM+) transactions can span multiple databases and other transactional resources. They are supported in .NET declaratively, using classes marked with a special [Transaction] attribute.

If you need to support distributed transactions, you will have to override the default C1DataObjects behavior: opening and committing an ADO.NET database transaction to update the database.

Using ADO.NET (so called "manual") transactions is incompatible with distributed transaction support.

To disable ADO.NET transactions, override the virtual RemoteDataService.Update method in the RemoteDataService-derived class of your data library. That method has a beginTransaction parameter set to True by default. Set BeginTransaction to False and call a method in an object of a class with appropriate TransactionAttribute. In that method, perform the Update, for example, calling the RemoteDataService-derived object's Base.Update() or calling a business method of that object.


Native and OLE DB Database Access

Native and OLE DB Database Access

C1DataObejcts supports several options for database connectivity. You can use OLE DB to connect to any database having an OLE DB provider, or you can use native .NET data providers for SQL Server or Oracle, or you can use any other (custom) .NET data provider.

For native SQL Server access, System.Data.SqlClient classes are used. For native Oracle access, there are two options: Oracle and MSOracle, where Oracle option uses the Oracle Data Provider for .NET (namespace Oracle.DataAccess; you need to install Oracle.DataAccess.dll), and MSOracle option uses Microsoft .NET Framework Data Provider for Oracle available as an MSDN download (namespace System.Data.OracleClient, you need to install System.Data.OracleClient.dll).

For BorlandDataProvider connectivity, Borland.Data.Provider namespace is used, and you need to install Borland Data Provider (BDP). BDP provides connectivity to a range of popular databases.

For other (custom) .NET data providers, you need to install the data provider and specify necessary properties in CustomProviderInfo.

The six options in the ConnectionTypeEnum enumeration are: OleDb, SqlServer, Oracle, MSOracle, BorlandDataProvider and Custom. The corresponding classes, all derived from C1.SchemaObjects.Connection are: C1OleDbConnection, C1SqlServerConnection, C1OracleConnection, C1MSOracleConnection, C1BorlandDPConnection, and C1CustomConnection.Creating a Connection object in Schema Designer, you can select one of the five ConnectionTypeEnum options in a combo box. In C1DataExpress, database access type is specified in the ConnectionType or ConnectionType properties. The latter is used with stand-alone C1ExpressTable components that are not attached to a C1ExpressConnection component.

At run time, you can retrieve the native IDbConnection and IDbTransaction objects from the DbConnection and DbTransaction properties of a C1.SchemaObjects.Connection object. DbConnection contains a non-null object only while the database connection is open. DbTransaction contains a non-null object only while the database connection is open and is performing a transaction while updating the database. You can cast the values of DbConnection, DbTransaction and event arguments representing IDbCommand to the actual type of the native database access objects. For example, for a SQL Sever connection, you can cast DbConnection to SqlConnection, or RowUpdateEventArgs.UpdateCommand to SqlCommand.

A Field object in the schema has a NativeDbType property. This property is used for database update, to specify the type of command parameters containing field values that are written to the database. Sometimes it is essential to specify the type for database update more exactly than it can be inferred from the .NET type of the field (from Field.DataType). For example, DataType = String can be further specialized to be a Unicode or ASCII string. When you create a schema importing it from database structure, NativeDbType is automatically set to the actual type of the database field. In those rare cases when you need to change it, you can set the NativeDbType property to a specific native type you need, or you can use NativeDbType = Any (-1) to indicate that inferring parameter type from Field.DataType is good enough (or not needed at all, as, for example, in calculated fields). The type of the NativeDbType is Integer. It contains the numeric value corresponding to one of the values of the enumerated type describing all possible data types for the database access provider. These enumerations are:

for OleDb: System.Data.OleDb.OleDbType,

for SqlServer: System.Data.SqlDbType,

for Oracle: Oracle.DataAccess.Client.OracleDbType,

for MSOracle: System.Data.OracleClient.OracleType,

for BorlandDataProvider: Borland.Data.Common.BdpType,

for others (Custom): enumeration type must be specified in the NativeTypeTypeName property.

Note: Using native database access does not automatically mean your application will have better performance comparing to using OLE DB. Native providers are indeed better optimized, they avoid unnecessary overhead imposed by OLE DB middleware. However, it depends on the relative weight this overhead has in the overall performance of your application. For a very simple application that just uses IDbReader to read database values and does not fill any data set, the performance boost can be very noticeable. But for filling a C1DataSet, the overhead from OLE DB is nearly negligible, so eliminating it will hardly matter. However, using native database access in C1DataObjects can be important. When you write code, you may need native provider to improve performance or to perform operations that are not supported by the OLE DB provider for .NET (such as ref cursors in Oracle, etc). When you do it in your code in conjunction with C1DataObjects, you will need C1DataObjects to give you native database connections, not an OLE DB connection.


Using Other (Custom) .NET Data Providers

Using Other (Custom) .NET Data Providers

In addition to the built-in providers (OleDb, SqlServer, Oracle, MSOracle, BorlandDataProvider) you can use any other .NET data provider by selecting the Custom option in the connection type combo box. For example, the CustomDataProvider sample in the Samples directory uses Microsoft ODBC .NET Data Provider.

Setting ConnectionType = Custom (selecting Custom when you create a new Connection), you indicate that you will use a .NET data provider C1DataObjects does not know about. There are two differences in using a custom (generic) data provider comparing with using one of the four providers included in the ConnectionType list:

· You cannot create a whole schema by importing database structure. But you can manually define tables one-by-one and retrieve their field from the database structure, and, of course, you can manually create relations and data sets.

· You need to specify necessary information about the provider, such as its assembly name, several type names, etc, in CustomProviderInfo, telling C1DataObjects how to use the provider.

For an example of using a custom .NET data provider, see the CustomDataProvider sample in the Samples directory.


Simple Tables

Simple Tables

Simple tables are the basic, elementary data objects in a schema. We distinguish between simple and composite tables, although both are Table objects and for the most part can be used interchangeably. Composite tables combine multiple simple tables in a single Table object. A composite table row contains fields from different tables, see Composite Tables for details.

The Table class is abstract, actual Table objects are either simple tables (DbTable) or composite (CompositeTable).

A simple table usually corresponds to a database table (or view), that is, if it has a non-empty DbTableName. In this case, we say that the simple table is based on the database table. This is enough to satisfy most application needs, because in addition to this, the composite table mechanism provides the ability to combine simple tables to form complex objects. However, there is also an option to use SQL-based and unbound tables that are not based on a single database table. A SQL-based table is based on a SQL statement or stored procedure, either by setting the SelectCommandText property or by setting the SQL statement in code. An unbound table is filled with data entirely by code. See Bound, SQL-Based and Unbound Tables for details.

At run time, each simple table has data in a collection of rows. However, this collection of rows is not usually exposed to the user directly, but through another schema object, a TableView. One simple table can participate in many table views, presenting the table’s data to the user in different structure arrangements. This is one of the most powerful features of C1DataObjects: structured data consistently maintained without manual coding. This also means that a simple table does not necessarily include all rows of the underlying database table. The process of filling simple tables with rows (fetching rows) is initiated by TableView objects, each table view making its contribution. See the details in Structured Data Storage: Tables and Table Views.

Each table, both simple and composite, has the Fields collection. Table fields define the structure of a table row. Field properties affect the way the field data is stored and manipulated, and how modifications are sent back to the database. A table’s Fields collection is not necessarily in one-to-one correspondence with the database fields, the fields of the database table on which the table is based. The fields can have different order, some fields can be deleted, and some fields can be added that are not based on a database field (unbound fields). See Table Fields for more details.

Creating and Modifying Tables

Using Table Properties

Table Business Logic Events

Table Fields

Structured Data Storage: Tables and Table Views

How the Data is Fetched

How the Data is Modified

How to Access Table Data

Bound, SQL-Based and Unbound Tables


Creating and Modifying Tables

Creating and Modifying Tables

Simple tables are usually created during database structure import, see Importing Database Structure. Any new tables can be added to a schema later. If necessary, there can be more than one table based on a single database table, although that is not the usual practice. Also, you can create tables that are not based on a database table, SQL-based and unbound tables, see Bound, SQL-Based and Unbound Tables.

To add a new simple table to an existing schema, you can either

· drag and drop a table from the Database Tables window to the Tables window, creating a bound table based on the database table, or

· press the Add button or click the dropdown arrow next to the Add button and select Simple Table from the context menu in the Tables window.

When a new table is added, the Table Editor appears:

The Table Editor has two panes: the upper pane shows table properties while the lower pane shows the properties of table fields.

Set the Connection and DbTableName properties of the newly created table in the Table Editor. For a SQL-based table, instead of setting DbTableName property, set the DataMode property to SqlBased and set the SelectCommandText property.

When you set the DbTableName or SelectCommandText property, the Schema Designer retrieves table fields from the database. You can also retrieve fields later, using the Retrieve Fields button on the Fields panel of the Table Editor.

To modify properties and fields of an existing table, double-click the table node in the Tables window or right-click the table node and select Open from the context menu. The Table Editor appears.


Using Table Properties

Using Table Properties

Connection and DbTableName properties define the database identity of a table. If both properties are non-empty, the table is considered bound to a database table (for a SQL-based table, SelectCommandText is used instead of DbTableName). In this case, all database operations are performed automatically by C1DataObjects. This is the most commonly used option. SQL-based tables can also be managed automatically by C1DataObjects, if you create DataAdapter components for them. There are also advanced options for SQL-based and unbound tables, where database access is performed with custom SQL statements or entirely from code, see Bound, SQL-Based and Unbound Tables.

The PrimaryKey read-only property returns the table primary key consisting of one or more fields whose PrimaryKey property is set to True. Primary key values must be unique in table rows, an attempt to set a duplicate primary key generates an exception. Normally, every table must have a primary key, that is, at least one field with PrimaryKey property set to True. Although tables without primary key are allowed (such tables usually have an empty DbTableName, see Bound, SQL-Based and Unbound Tables), they have to be read-only, and they cannot be used in composite tables.

ReadOnly, AllowAddNew and AllowDelete properties control table updatability.

ConstraintsFieldLevel and ConstraintsRecordLevel are collections of table constraints, ConstraintInfo objects. Constraints are expressions, see C1DataObjects Expressions. ConstraintsRecordLevel contains record level constraints, those that are evaluated when the user finishes editing a row, before the C1TableLogic BeforeEndEdit event. If one of the constraints is not satisfied, an exception is thrown. The exception message is determined by ErrorDescription.Constraints with Condition expression (if non-empty) evaluating to False, are skipped, not tested. ConstraintsFieldLevel contains field level constraints, those that are evaluated on every field change. Usually, a field level constraint belongs to a certain field, not to the table as a whole, in which case it resides in Constraints. ConstraintsFieldLevel should contain only field level constraints that cannot be associated with a particular field. Constraints in ConstraintsFieldLevel are evaluated each time any table field changes, whereas constraints in Constraints are evaluated on the owner field change.

Properties IgnoreDeleteError, UpdateLocateMode, UpdateRefreshMode control the process of updating table rows, committing changes to the database, see Updating the Database.


Table Business Logic Events

Table Business Logic Events

C1DataObjects allows developers to specify business logic in code on table level. This is the main power feature of the C1DataObjects framework: specifying business logic where it belongs, on a data object (table) level and its automatic propagation and enforcement wherever that object is used.

C1DataObjects executes table-level business logic code wherever the table is involved: in a composite table including this table and in a table view based on this table.

You can also specify business logic on data set level. Such code will be executed only in a particular data set. Using dataset-level business logic allows to enforce rules that are specific to a certain data set. For more information, see Data Sets.

Developers write table-level business logic code in the events of a special C1TableLogic component. Only one C1TableLogic component is allowed for each table. To create C1TableLogic components, right-click the C1SchemaDef component and select Create Business Logic Components from the context menu. The C1TableLogic components are automatically added to your form. You can also add them manually from the Toolbox by double-clicking the C1TableLogic component and setting their SchemaComponent and Table properties.

Once you have added the C1TableLogic components, you can attach event code by either selecting the components on the designer surface, or by using the Business Logic Events tool window. Right-click the C1SchemaDef component and select Business Logic Events from the context menu to open the tool window:

The Business Logic Events tool window shows the list of all tables and data sets. When you select a table in the tool window, the table’s business logic events appear in the Properties Window (in Visual C#, when the Events radio button is selected in the Properties Window; in Visual Basic use the Method Name combo box in the code editor).

C1DataObjects also allows you to associate business logic code with table views instead of tables. This is done to specify data set-specific (table view-specific) logic, rules that must be enforced in the context of a particular data set and table view, but do not always apply to the underlying table. In this case, a C1DataSetLogic component is used, see Table View Business Logic Events.

The following is a brief list of business logic events available in C1DataObjects (we omit prefixes Before and After pertaining to most events, retain the prefix only if an event occurs only Before or only After):

AddNew | Fired when a new (empty) row is added.
AfterChanges | Fired when all changes initiated by a field change are done and handled by the business logic code, see the FieldChange event.
BeginEdit | Fired when the user starts editing a row (data-bound controls start editing a row immediately after they position on it, even though no changes have been made yet).
CancelEdit | Fired when the user cancels editing a row reverting the changes made to it.
Delete | Fired when a row is deleted.
EndAddNew | Fired when a newly added row becomes a regular row in the rowset. When a row is added, it is added empty, its primary key is unknown. A row with unknown primary key is in special transitory state, it is not a regular rowset row. Only after its primary key is set it becomes a regular (added) row, which is signaled by this event.
EndEdit | Fired when the user finishes editing a row (data-bound controls finish editing a row when they leave that row, even if no changes have been made).
FieldChange | Fired when a field value is set. Inside this event, your code can set other fields triggering recursive FieldChange events, C1DataObjects handles this situation correctly. Only after all changes are done and handled, AfterChanges event is triggered.
FirstChange | Fired when a first change is made to the row (a field value changed) after BeginEdit.
UpdateRow | This event is not fired in a client application, unless it is a direct client, that is a 2-tier application updating the database directly from the client, see Application Configurations. In a 3-tier deployment, it is fired only on the server, when a modified row is committed to the database. See also, Updating the Database.


Table Fields

Table Fields

Table fields determine the structure of a table row. In a bound table (see Bound, SQL-Based and Unbound Tables), fields usually correspond to database fields of the database table. However, they do not have to be in exact one-to-one correspondence with database fields. Fields order can be changed, some fields can be deleted from the table, and new fields can be added. If necessary, multiple fields can represent a single database field. The database field represented by a table field is determined by the DbFieldName property. This property can be empty, which means that the field is not based on (not bound to) a database field. Such fields are called unbound, or calculated.

A field has a name that must be unique in the table. A field can be renamed by renaming the field node in the Fields list. The name is used to identify the field as a property of the business object associated with the table, see Using Typed Data Objects in Business Logic. It is also used as the name of the column exposed to the users, and as the default display name (caption) of the column.

The DataType property determines the field .NET type, and NativeDbType – its native database or OLE DB type. Both DataType and NativeDbType are set by Import Wizard when a table is first created in database structure import, see Importing Database Structure. DataType is the field’s most important characteristic, it affects all C1DataObjects functions. Normally, Field.DataType should not be changed after importing structure from the database. Adding a new field to a table, you must set its DataType property. NativeDbType is used only for updating values in the database, and can be set to Any (-1), in which case its value is effectively ignored. When in doubt, use Any (-1) as the default value for NativeDbType.

The following properties determine the field’s additional storage characteristics:

AllowDbNull | Gets or sets a value indicating whether null or empty string values are allowed in this field. If it is set to False, an attempt to assign null or empty string value to this field generates an exception.
AutoIncrement | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed | Gets or sets the starting value for a field with AutoIncrement not None.
AutoIncrementStep | Gets or sets the increment a field with AutoIncrement not None.
MaxLength | Gets or sets the maximum length of a string field, in characters. If the length is unlimited, the value is 0 (default).
Precision | For numeric fields (NativeDbType is Numeric, Decimal or DbTimeStamp), this property sets or gets the maximum number of digits representing values.
Scale | For numeric fields (NativeDbType is Numeric, Decimal or DbTimeStamp), this property sets or gets the scale of numeric values, that is, how many digits to the right of the decimal point are used to represent values.
Unique | Gets or sets a value indicating whether the values of this field in each row must be unique. If it is set to True, an attempt to assign a duplicate value to this field generates an exception.

The PrimaryKey property determines whether the field belongs to the table’s primary key. The table’s primary key, the sequence of field names constituting the primary key, is returned by the read-only property PrimaryKey. Each modifiable table must have primary key, that is, at least one field where the PrimaryKey property is set to True. Primary key values must be unique in table rows, an attempt to set a duplicate primary key generates an exception.

Each field can have one or more calculation expressions associated with it in the Calculations property, a collection of FieldCalculationInfo objects. Usually, calculation expressions are used in calculated (unbound) fields, although they can be useful in bound fields as well. A field is called unbound if its DbFieldName property is empty. C1DataObjects automatically computes calculated field values and automatically refreshes them when any of the arguments of its calculation expression(s) changes. Calculation expressions can contain fields of the same table as well as of its parent and child tables with respect to relations. Child fields are used with aggregation functions to perform grouping and aggregation. See C1DataObjects Expressions for a description of C1DataObjects expression language.

Each calculation (FieldCalculationInfo) contains Expression, which is the expression used to obtain field values, and two additional properties: Condition and FireEvent. Condition is an optional boolean expression determining the calculation’s applicability. If Condition evaluates to False, the calculation expression is not evaluated. If a field has multiple calculations, C1DataObjects applies the first with the Condition expression evaluating to True. If none is applicable, the field value is left unchanged. FireEvent is a boolean property set to False by default. If it is set to True, setting the value from calculation expression triggers the same sequence of events (BeforeFieldChange, AfterFieldChange, AfterChanges) as if the value has been modified by the end user.

Field calculations are useful for bound fields as well as for calculated fields. In this case, they are usually qualified by Condition expressions. Depending on the conditions, a field’s value can be derived from a value stored in the database, or it can be calculated. For instance, if field A is non-empty, field B always returns the same value as A, but if A is empty, B can be set independently of A.

The following properties control field value modifications:

ReadOnly | Gets or sets a value indicating whether the field value can be changed by the end user or from event code. If set to True, an attempt to change the field throws an exception.
ReadOnlyUnlessNew | Gets or sets a value indicating whether the field value can be changed after the row has been added to the table (after EndAddNew event). If set to True, an attempt to change the field throws an exception unless it is done in a newly added row, before the EndAddNew event.
Constraints | Returns the collection of field-level constraints, ConstraintInfo objects. Field-level constraints are evaluated (tested) when the value of the field changes. For a change to be successful, all constraint expressions (Expression) must evaluate to True. If one of the constraints is not satisfied, an exception is thrown. The exception message is determined by ErrorDescription. Constraints with Condition expression (if non-empty) evaluating to False, are skipped, not tested. See also, C1DataObjects Expressions for a description of C1DataObjects expression language.
DefaultValue | Gets or sets the default value, in string representation, for the field in a newly created row.

The following properties control field behavior in updating the database (they only have effect for bound fields, that is, if DbFieldName is not empty):

DataSourceReadOnly | Gets or sets the value indicating whether the field value in the database can be changed. If this property is set to True, the field value will not be set in the database update operation (as with UpdateSet = Never) and it cannot be modified unless it is done in a newly added row, before the EndAddNew event (as with ReadOnlyUnlessNew = True).
UpdateIgnore | Gets or sets the value indicating whether the field value is sent to the database (to the server) for update. If this property is set to True, the field value is not sent to the server for update, even if it has been modified by the user. The default is False.
UpdateLocate | Gets or sets the value indicating whether the field value is used to locate the database record that is going to be updated. If it is set to False, the field is not used for locating the database record, regardless of the value of UpdateLocateMode. If it is set to True (default), this is determined by the value of the UpdateLocateMode property. See Updating the Database for details on locating database record for update.
UpdateRefresh | Gets or sets the value indicating whether the field value is refreshed, retrieved from the database after updating the database record. If it is set to False, the field value is not refreshed, regardless of the value of UpdateRefreshMode. If it is set to True (default), this is determined by the value of the UpdateRefreshMode property.
UpdateSet | Gets or sets the value indicating whether the field value is set in the database record. If it is set to Always, the value in the database is always modified, set to the current field value. If it is set to Never, the value in the database is always left unchanged. If it is set to IfChanged (default), the value in the database is set to the current field value if the current field value is different from the original field value as it was last fetched from the database (the original value can be retrieved using Item (field, DataRowVersionEnum.Original)).

C1DataObjects can perform automatic conversion from DbNull to empty string when returning string field values and back from empty string to DbNull when saving string field values. To enable this automatic conversion, set ConvertNullToEmpty/ConvertEmptyToNull for individual fields, or set FieldDefaults:DataSetDef in a data set in the schema (in C1DataExpress, FieldDefaults) to enable it by default for a whole data set.


Structured Data Storage: Tables and Table Views

Structured Data Storage: Tables and Table Views

One of the main advantages of C1DataObjects over other data frameworks is its ability to represent structured data. For example, suppose we have tables Customers, Orders and Employees (as in the standard MS Access sample database Northwind), and we have defined a composite table CustOrders (see Tutorial 1) that combines all three tables in a single table according to the following diagram:

Customers [image] Orders [image] Employees

(The Orders – Employees many-to-one relation is defined by the join condition Orders.EmployeeID = Employees.EmployeeID, where EmployeeID is the primary key of the Employees table.)

Suppose the user navigates to a CustOrders row (containing fields from all three tables), and changes the value of Orders.EmployeeID. Then C1DataObjects, knowing the structure behind the composite table, changes the employee name (fields Employees.FirstName and Employees.LastName) and other employee attributes according to the changed EmployeeID value.

Or the user can change the value of Employees.FirstName or another Employees field in the simple Employees table. In this case we expect that all CustOrders rows including this Employees rows will show the modified value in the corresponding field.

Or let’s take another example: two table views (TableView) showing the data of a single table (in different order, with different filter conditions, different fields, etc). Here also, once a table row is modified in one table view, the corresponding row will be automatically changed in another.

In other words, C1DataObjects always maintains and enforces the structure, relations between tables, composite tables and table views, exactly as you need it to be maintained. What mechanism is responsible for this, how C1DataObjects does this? The answer to this question lies in the way C1DataObjects stores data. C1DataObjects storage is organized according to the structure and role of schema objects, enabling C1DataObjects to maintain the correct structure at all times.

The data is stored on the simple table level (except unbound fields). Each table has its own cache, rowset. Table views do not store actual data, instead they store pointers to table rows. In the same way, composite table rows do not store actual data, they also store pointers to simple table rows. This storage structure serves a dual purpose: to eliminate data redundancy and thus conserve memory, and to ensure that the structure is preserved when the user modifies data. Composite table rows and table view rows pointing to the same simple table row share the same data, since the actual data is stored in one place, in a simple table row. When the shared data is modified through one of the composite table rows or through one of the table view rows, all other rows pointing to the same simple table row are notified of the change and display the modified data.

C1DataObjects storage is illustrated in the following figure showing how it stores the simple table rows of tables Customers, Orders, Details, and the rows of the CustOrders composite table:

In this figure, you can see that pointers to simple table rows exist only for two tables: Customers and Orders, there are no pointers to Employee rows. This is because the Employees table is connected to its parent in the CustOrders diagram, the Orders table, with a many-to-one relation. In this case, the Employees row is uniquely defined by the Orders row, therefore we do not need a separate pointer for it.

Now you can see how C1DataObjects ensures that the correct data structure is maintained at all times regardless of where, in which table view, a medication is made: Any data modification made in a table view ends up in a simple table row. If the table view represents a simple table, this row is found using the single pointer that this table view row contains. For more information, see Table Views. If the table view represents a composite table, the table view uses one of its pointers to simple table rows associated with one-to-many relations, and, if necessary, foreign key values, such as Orders.EmployeeID in the above example, to resolve many-to-one relations. Once the simple table row is found, it is modified. Then C1DataObjects notifies all table views (both simple and composite) whose rows point to the modified row, that the row has changed. When, in response to this notification, a client requests the values of those table view rows, they return the changed value, because they always return the current value of the simple table row, using their row pointers.

There is one exception to this storage scheme, that is unbound fields (also known as calculated) in a table view. These are table view fields that do not correspond to any table field, they were specifically added to the table view by the developer. For more information, see Table View Fields. A table view can have unbound fields, and a composite table can have unbound fields of its own. Unbound composite table fields are those that do not correspond to any field of constituent simple tables, they were added to the composite table by the developer. For more information, see Composite Table Fields. Unbound field values are stored do not belong to simple tables, so they cannot be stored in simple table rows. C1DataObjects stores unbound field values in table view rows where they are defined.


How the Data is Fetched

How the Data is Fetched

Filling Data Sets with data (executing Fill), C1DataObjects performs fetch for every table view in that data set. Simple tables themselves are not fetched, because all simple table rows may not be needed. C1DataObjects exposes table views to the user, not simple tables, so it fetches only those rows that occur in the table views. You must take this fact into account when designing the data set structure. Sometimes, it is necessary to ensure that all rows of a certain simple table are present in the dataset. For example, if you want the end user to be able to select an employee in an Orders row (see the example in Structured Data Storage: Tables and Table Views), you must have all Employees rows available in the data set. To ensure that all simple table rows are fetched, make sure that the data set includes a table view based on that simple table, add this table view to the data set if it is not already present, and do not specify a filter condition for this table view calling the Fill method.

Sometimes it is necessary to control the order in which table views are fetched. Specifically, it can be necessary when custom code is used in fetching and some parameters in this code depend on the fact that some other table view has already been fetched. To specify fetch order, set FetchIndex (usually in the Schema Designer) or FetchIndex (only in the BeforeFetch event).


How the Data is Modified

How the Data is Modified

Structured storage also allows C1DataObjects to solve another very important problem that other data frameworks fall short of solving in full: the problem of updateable views. Virtually all database applications, especially their GUI front ends, encounter this problem in one way or another. In ADO.NET, as in most previous SQL-based frameworks, it is solved by placing the responsibility for updating a multi-table data view (rowset) on the developer. Unless a rowset (ADO.NET DataTable) is based on a single database table (which is rarely the case in GUI applications), developers must write custom code to send modifications to the database. This is almost taken for granted, as if there is no other solution to this problem causing a lot of tedious manual coding. In fact, the solution exists and has been known for a long time to previous generations of application builder tools. Unfortunately, it has been abandoned if not forgotten. C1DataObjects restores the data structure paradigm to its rightful place and with it comes the solution to view updatability.

As we already know, imposing structure on rowsets (composite tables) originating from multiple database tables (as opposed to structureless DataTable of ADO.NET) ensures data consistency and synchronization that would otherwise require manual coding. The same structure helps to solve the update problem. In fact, using C1DataObjects, you will rarely write any code related to database updates at all. In most cases, database updates will be performed automatically by C1DataObjects in the exact way they are required by the data model. When your application sends updates to the database (Update), C1DataObjects collects all modified simple table rows and sends them to the server for update (commit).

Note that simple table modifications are sufficient for the update process. We do not need to be concerned with where those modifications came from. The user might use a simple table view or a composite table view to modify a row of a simple table, it does not matter. All that matters is that a simple table row has been modified (or inserted, or deleted). Before the update, C1DataObjects has already resolved the problem that other tools must resolve during Update: using the data structure, it has already determined which rows of which simple tables have been modified by the end user changes. Therefore, all that remains is to send those simple table modifications to the database, applying each of these modifications to the corresponding database table. Only simple table rows are involved in this process. Complex objects, such as composite tables and table views are not involved in update.

Consider the Customer-Orders-Employees example of Structured Data Storage: Tables and Table Views, the user could modify some rows of the CustOrders composite table (using a grid control showing the combined customer-order-employee information), and also add and delete some rows. Since CustOrders is a composite table, it means that some Customers rows could have been modified, as well as some Orders and some Employees rows. Additionally, other modifications to these simple tables can be made in the same session via other table views. All these modifications are basically modified rows of the simple tables. Therefore, C1DataObjects already knows what database table rows must be modified, added or deleted to commit this transaction. It goes to the server and does just that, applies the modifications to the database tables Customers, Orders and Employees.

For details on the process of committing changes to the database, including possible customization of the update process with your business logic code, see Updating the Database.

Note that in addition to the batch update mode, standard in distributed applications, where database updates are performed only when explicitly requested by a special method call (when user presses a button, for example), C1DataObjects also supports the classic automatic update mode. This mode, familiar to developers of classic client-server and desktop applications, ensures that all changes made in the current row are committed to the database when the end user leaves this row, moves to another row in a table. This mode is not supported in ADO.NET and standard Windows Forms data binding. It is correct that this mode is unsuitable for distributed applications. However, many existing designs depend on it, and it is very well suited for desktop applications. C1DataObjects adds yet another enhancement to the .NET data framework by implementing the automatic update mode. By default, all C1DataObjects data sources work in batch update mode. But if you use C1DataTableSource as your data source, and set its UpdateLeavingRow property to True, it will perform update automatically when the end user leaves a row after modifying it.


How to Access Table Data

How to Access Table Data

Data Binding

As described in Schema Objects, fetched data is contained in a C1DataSet object. By using a C1DataSet component as your data source, you can bind data-aware components such as a grid or a text box to the fetched data. The C1DataSet component exposes table view rowsets. Data-aware controls can bind to any of these rowsets. A table view represents a table, but there can be multiple table views representing the same table. Also, table views can represent composite tables as well as simple tables. C1DataSet also supports master-detail hierarchy in data binding. See How to Access Table View Data for details.

C1DataObjects also allows you to bind directly to a simple table rowset, bypassing table views. This can be done at run time by setting the DataSource property of a data bound control to a C1DataTable object representing a table rowset. To obtain this C1DataTable object, use the Tables collection property of the C1DataSet component.

This can also be done, both at run time and at design time, by using the C1DataView component. It can represent either a table view, if its TableViewName property is set, or a simple table, if its TableName property is set.

Programmatic Access

To access a table rowset (both for simple and composite tables), obtain a C1DataTable object from a C1DataSet component (using the Tables collection property), and use the Rows collection containing C1DataRow objects representing table rows. To perform actions on table rows or table data as a whole, use the appropriate methods and properties of the C1DataTable and C1DataRow classes. Their object model is similar to that of ADO.NET.

C1DataObjects also allows typed access to table and table view rows. For each table and table view, C1DataObjects generates a class representing its row. For example, ProductsRow is an object (business object, data object) where each field has a corresponding property (ProductsRow.UnitPrice, ProductsRow.UnitsInStock, etc.) and each relation has a corresponding method (Products.GetOrder_DetailsRows, etc.) allowing you to obtain child rows and the parent row. Using these classes, you can write your business logic code in a convenient, type-safe way, and benefit from Visual Studio code completion features giving you the lists of properties and methods to choose from. See Using Typed Data Objects in Business Logic, for details about these data object classes.

To use a data object class in your code, call the static Obj method implemented in every data object class. It obtains a business object given a C1DataRow object as its argument. For example, the following code obtains a ProductsRow business object from a C1DataRow:

· Visual Basic

· C#

· Delphi

Sometimes it may be necessary to obtain C1DataRow objects from the rows (items) received by bound controls from C1DataObjects. For example, you may need to access the current row obtained from CurrencyManager.Current as a C1DataRow. Row objects (also called data items) used in data binding are not C1DataRow objects, but each of them refers to a single C1DataRow object, and you can use a static C1DataRow.FromDataRow method to obtain that C1DataRow object.


Bound, SQL-Based and Unbound Tables

Bound, SQL-Based and Unbound Tables

The most common case is a bound table (DataMode = Bound) where a table has non-empty Connection and DbTableName properties. In this case, a table is based on a database table, so all database access operations can be performed by C1DataObjects automatically. There is no need to write custom code fetching and updating the table data (although it is possible to customize the default behavior in code).

In more complicated cases, there may be a need for more flexibility. For example, you may need to use a complex, non-standard SQL statement to fetch table data, or to use a stored procedure. Normally, for a bound table, the SQL statements fetching and updating data are generated by C1DataObjects. If that is not adequate, you can use a SQL-based table (DataMode = SqlBased). A SQL-based table has non-empty Connection property and empty DbTableName property. Instead of DbTableName it uses the SelectCommandText property where you can specify a SQL statement or a stored procedure depending on the SelectCommandType property setting.

To define a SQL-based table, set the DataMode property to SqlBased, set the Connection property, leave the DbTableName property empty, and specify the SelectCommandType and SelectCommandText properties.

Using a SQL-based table can be almost as easy as using a bound table, if you create a DataAdapter component for it. A DataAdapter component can be created in a C1TableLogic component associated with the table by selecting Create DataAdapter from its context menu. The DataAdapter component will then perform both fetch and update without custom code (but you can customize the default fetch and update behavior in event code if needed).

See the SQLBasedTablesEasy sample in the Samples directory for an example of using a SQL-based table with DataAdapter.

Although SQL-based tables are almost as easy to use as bound tables, bound tables should be always preferable when you have a choice. Bound tables are more intimately related to database tables, so C1DataObjects can support features that are impossible for SQL-based tables, namely

· Only bound tables can be combined to form a composite table. SQL-based tables cannot be used in a composite table.

· Only bound tables can be used in virtual mode (with large data sets), SQL-based tables cannot.

· FilterCondition in Fill does not work with SQL-based tables without additional coding, because C1DataObjects does not generate SQL statements in this case, so it cannot automatically modify the SQL statement by adding the condition to its WHERE clause. You need to do it in code, in the AfterGenerateSql event.

If you want even more control over fetch and update process, you can use a SQL-based table without DataAdapter component and even without setting the SelectCommandText property. In this case you perform fetch and update by generating SQL statement(s) in code:

· To fetch data for an SQL-based table, write code in the BeforeGenerateSql event setting the Sql event argument to the SQL statement fetching data and set the Status argument of the event to Skip. Note that since it resides in a C1DataSetLogic component, this code is attached to table views based on this table, rather than to the table itself. This is in keeping with the general rule that data is fetched by table views, not by tables, see How the Data is Fetched.

· If the table is updatable, write code in the C1TableLogic BeforeUpdateRow event. In that code, you can specify update, insert and delete commands, or perform the update in any desirable custom fashion.

See the SQLBasedTables sample in the Samples directory for an example of using SQL-based tables without DataAdapter.

You can also combine these options, use these custom SQL statements created in code with a SQL-based table with DataAdapter, or, for that matter, event with a bound table. For example, you can fetch data without custom code, using DbTableName or SelectCommandText properties, and update with custom code.

If you need even more flexibility than provided by SQL-based tables, for example, when working against a non-SQL data source, you can use an unbound table, An unbound table is a table with both DbTableName and Connection properties empty (set the DataMode property to Unbound). Fetching and updating data for an unbound table is done in code:

· To fetch data for an unbound table, write code in the BeforeFetch event. In that code, create a reader object implementing the System.Data.IDataReader interface (either use a standard .NET Framework implementation such as OleDbReader or SqlDataReader, or, for custom data, create an UnboundDataReader object), fill the reader with data, assign it to the Reader event argument and set the Status argument of the event to Skip. Note that, as in SQL-based tables, this code is attached to table views based on this table, rather than to the table itself, according to the general rule that data is fetched by table views, not by tables. For more information, see How the Data is Fetched.

· If the table is updatable, write code in the C1TableLogic BeforeUpdateRow event. In that code, perform the necessary update programmatically and set the Status event argument to SkipCurrentRow, indicating that the update has been done.

See the UnboundTables sample in the Samples directory showing how to use unbound tables.


Simple Relations

Simple Relations

A simple relation (class SimpleRelation) is an object establishing a parent-child relationship between two simple tables. The concept of relationship is common in database modeling. It is reflected in a database structure, for example, by foreign key relationships where the primary key of one table (parent) corresponds to a foreign key of another table (child).

A simple relation relates the two tables by creating a correspondence between a field (or several fields) of the parent table (parent fields) and a field (or several fields, the same number of fields as in parent) of the child table (child fields). For example, in a Customers – Orders relation, the Customers table is the child and the Orders table is the parent. They are related by the equality

Customers.CustomerID = Orders.CustomerID

where Customers.CustomerID is the parent field and Orders.CustomerID is the child field.

For each parent (Customers) row there can be multiple child (Orders) rows with the same value of the CustomerID field. For each child (Orders) row there is only one parent (Customers) row with the same value of the CustomerID field. This is why this is a one-to-many relation (one parent row to many child rows), which is represented by the following notation:

Customers [image] Orders

We can also define an Orders – Customers relation where Orders is the parent and Customers is the child. This will be a many-to-one relation:

Orders [image] Customers

In a many to one relation, there is only one child row for each parent row, and there can be many parent rows for a child row.


Creating and Modifying a Simple Relation

Creating and Modifying a Simple Relation

When you import database structure to a schema, C1DataObjects Import Wizard automatically creates simple relations for you based on foreign key information in the database. After the initial step of importing the database structure, you can delete redundant relations, create new relations and modify the existing relations.

To create a new simple relation, press the Add button or select Add from the context menu in the Relations window, which will create an empty relation and open it for editing in a new Relation Editor page.

The Relation Editor has two panes. The top pane contains the relation properties, the bottom pane contains Join Conditions defining the relation (such as Customers.CustomerID = Orders.OrderID).

Set the relation’s Name either by setting the Name property or by renaming the newly added node in the Relations window.

Set the Parent property by selecting a simple table from the list of all simple tables available in the schema. Set the Child property by selecting a simple table from the list of all simple tables. Note that if you select a composite table for either Parent or Child, the relation will automatically become composite relations, which will be apparent by the elimination of the bottom panel, Join Conditions, which are not applicable to composite relations.

When creating a simple relation, it is your responsibility to assign the correct value to the Cardinality property, that determines whether this relation is one-to-one or one-to-many. C1DataObjects relies on and makes extensive use of relation cardinality, and it cannot derive its value from other relation properties, unless for relations it creates while importing structure from the database.

The recommended practice is to define all your simple relations as one-to-many (but make sure they are really one-to-many, C1DataObjects cannot check this). For example, if you need a relation between Customers and Orders, you may be uncertain as to which table to choose as parent and which as child. Both choices are possible, only Cardinality value depends on the choice. We recommend to make the choice that leaves Cardinality at one-to-many. So, in our example, Customers is the Parent, and Orders is the Child.

If you have a Customers – Orders relation, there is no need to define the inverse relation, Orders – Customers. In your code, you can always navigate in both directions, from parent to child and from child to parent. When you use this relation in a diagram (in Composite Tables or in Data Sets) to specify view relations, you can use it in direct or inverse direction, as needed.

The last step in defining a simple relation is specifying its join conditions, equalities connecting parent fields with child fields. For each parent/child field you need one join condition. To add a join condition, press the Add button or select Add from the context menu in the Join Conditions pane.

Then, in the properties grid on the right, select the ParentField and ChildField for this join condition.


Simple Relation Properties

Simple Relation Properties

EnforceConstraints

If this property is set to True (default), then this relation will not allow child records without parent. For example, the Customers – Orders relation will not allow to set Orders.CustomersID to a value that does not exist in the Customers table.

DeleteCascadeRule

This property specifies what happens to child rows when their parent row is deleted. None means that child rows are left unchanged. As a result of deleting the parent row, they become orphan rows, without parent. The Cascade value means that child rows are deleted. Set this property to Cascade when child rows belong to their parent, should not exist without it. There are also two less frequently used values: SetNull meaning that child rows remain with related field(s) set to Null, and SetDefault meaning that child rows remain with related field(s) set to its default value.

UpdateCascadeRule

This property determines what happens to child fields when parent field values are changed. If it is set to Cascade (default), the child fields are changed correspondingly. If it is set to None, the child fields are left unchanged. If it is set to SetNull, the child fields are set to Null. If it is set to SetDefault, the child fields are set to their default values.

UpdateCascadeServer

Cascade update, equivalent to what happens if UpdateCascadeRule is set to Cascade, can also be performed by the database itself. If this is the case, C1DataObjects must know that and adjust the process of updating the database. If this is not done, cascade update occurring in the database will conflict with cascade update already performed by C1DataObjects (if UpdateCascadeRule=Cascade). To prevent this conflict, if your database performs cascade updates for this relation, set the UpdateCascadeServer property to True. Note that there is no corresponding property for cascade delete, although cascade delete can also be performed by the database. If both a simple relation and the database perform cascade delete, make sure the IgnoreDeleteError property is set to True (default value). That will prevent conflicts between cascade deletes in C1DataObjects and in the database. The only possible conflict is that C1DataObjects tries to delete database records in the child table already deleted by the database as a result of deleting their parent record. If IgnoreDeleteError is set to True, this error (trying to delete already deleted record) will be ignored.


Composite Tables

Composite Tables

A composite table is several simple tables bundled in one. A composite table row represents a row of each constituent simple table, as shown in the following figure:

Composite table rows do not actually store the data shown on the figure, data belonging to the simple tables, they store pointers to simple table rows instead. See Structured Data Storage: Tables and Table Views for explanation on how data is stored in simple and composite tables.

Composite table support is one of the main power features of C1DataObjects. It allows you to define business objects with data stored in multiple database tables, objects whose structure is determined by the inherent business domain logic, not by the physical database structure that is often far from the logical structure, due to normalization and other database-specific techniques. Composite tables bridge the gap between physical database structure and logical structure that is needed in business logic and user interface design.

Composite tables represent business objects just as simple tables do. Developers can associate business logic code with composite tables, as with simple tables, using the C1TableLogic component events, see Table Business Logic Events. Each composite table has a class associated with it, with properties corresponding to composite table fields, see Using Typed Data Objects in Business Logic.

A composite table is defined by a diagram with simple tables as nodes connected with arc – relations. For example, the following is a diagram of the composite table shown in the figure above:

or, in brief notation:

Customers [image] Orders [image] Employees

Composite Table Diagram

Creating and Modifying Composite Table Diagrams

Composite Table Fields

Composite Table Properties and Business Logic Events

How Composite Table Data is Fetched, Stored and Updated

How to Access Composite Table Data


Composite Table Diagram

Composite Table Diagram

Not every diagram defines a valid composite table. First, it must contain only bound tables, unbound and SQL-based tables are not allowed, see Bound, SQL-Based and Unbound Tables. The diagram must also satisfy the following conditions ensuring that it represents a plain table, a rowset:

· It must be a tree, that is, a connected graph without loops: every two nodes are connected with an arc path, and there are no cyclic paths in the graph.

· One-to-many arcs must not branch. In formal terms, in means that for each group of nodes that are connected with many-to-one arcs to each other (or for a single node if it does not have adjacent many-to-one arcs), there can be only one (or none) outgoing one-to-many arc.

For example, the following diagram represents a valid composite table (one-to-many relations highlighted blue; groups of nodes interconnected many-to-one filled with the same pattern):

and the following three diagrams do not represent valid composite tables:

Diagram is not connected, consists of two independent parts

One-to-many relations branching

Diagram is not connected, there is no path from B to C and vice versa.

To make this diagram a correct composite table, invert one of the relations

Diagram is not connected and contains a loop


Creating and Modifying Composite Table Diagrams

Creating and Modifying Composite Table Diagrams

To create a composite table, press the Add button or click the dropdown arrow next to the Add button and select Composite Table from the context menu in the Tables window.

The empty new composite table will open as a new Composite Table Editor page. The Composite Table Editor has two tabs: Diagram and Properties.

The Diagram tab contains the diagram (graph) of constituent simple tables connected with relations. It also allows you to set properties of the graph’s nodes, table views (CompositeDefView objects), and of the graph’s arcs, view relations (CompositeDefRelation objects). The Properties tab consists of two panes: the upper pane showing the composite table properties and the lower pane showing the composite table fields and their properties.

Immediately after creating a new composite table, it should be renamed by setting its Name property in the Properties tab or by renaming the composite table node in the Tables window.

Setting up a composite table starts with adding some simple tables to its diagram. Tables can be added to the diagram by clicking the Add tables button in the Diagram of the Composite Table Editor. The Add tables dialog box appears.

Select tables from the list of Existing tables and use the arrows to move them to the list of Selected tables.

Table can also be added by dragging and dropping them from the Tables window onto the Diagram of the Composite Table Editor. When you add a table view to the diagram, relevant relations connecting it to other table views in the diagram are also added, unless suppressed by unchecking the "Create view relations" check box in the Add tables dialog or by unchecking the "Automatically create relations adding tables to diagrams" check box in the Options dialog (select Options in the Schema menu). Redundant relations can then be deleted by selecting a relation arrow in the diagram and pressing the Del key or by right-clicking it and selecting Remove from the context menu.

You can also add tables to the diagram using the Table button on the top bar of the Diagram tab, but then you will have to set the Table property manually, selecting the newly created table view (a CompositeDefView object) and setting its Table property in the property grid below the diagram.

It is also possible to add relations to the diagram manually. Press the Relation button on the top bar of the Diagram window and draw an arrow connecting parent and child tables using drag-and-drop from parent to child. The Schema Designer will try to find an appropriate relation connecting these two tables (inverting the relation, if necessary). When the new view relation is created, select it and look at popup box or the value of the Relation property in the property grid below the diagram. If this property is empty, it means that the Schema Designer could not find an appropriate relation.

The objects shown on the diagram are CompositeDefView and CompositeDefRelation objects.

A table view (CompositeDefView object) represents a table, determined by its Table property, as a part of a composite table, as well as properties of its own. CompositeDefView properties in a composite table diagram can be used to override simple table properties. For example, you can set ReadOnly to True. This will make this table a read-only part of the composite table, although the simple table itself may be modifiable. The following CompositeDefView properties override Table properties: AllowAddNew, AllowDelete, ReadOnly.

A composite table can contain multiple table views based on a single table. In other words, a simple table can occur several times in a composite table diagram. Although it is not common, this is sometimes useful to represent relations of a table with itself, what is called “self-joins” in SQL, as in Employee1.SupervisorID = Employee2.EmployeeID, where Employee1 and Employee2 are both aliases for the same table Employee. This feature is fully supported in composite tables, with a single restriction that if this table duplication occurs on the last level (the last table that is a child in a one-to-many relation is duplicated somewhere else in the same diagram), then adding new records to the composite table is not allowed, since it would lead to abnormal results.

A CompositeDefRelation object represents a relation, determined by its Relation property, as a part of a composite table diagram, an arc in the graph. The CompositeDefRelation class is derived from ViewRelation. Only simple relations can be used in a composite table diagram, its CompositeDefRelation objects cannot be based on composite relations. Note: general ViewRelation objects can be based on any relation. For more information, see View Relations. A view relation, as an arc in a composite table diagram, can have direction opposite to the direction of the relation on which it is based. For example, having a one-to-many relation Customers – Orders, we can create a many-to-one view relation Orders – Customers, based on Customers – Orders, but in inverse order (direction). So, if the Relation object Customers – Orders has Parent = Customers, Child = Orders, the view relation, if inverted, will have Parent = Orders, Child = Customers. This inversion does not change the original Relation object. The usual practice is to define all simple relations, Relation objects shown in the Relations window as one-to-many, and then apply them in diagrams, create view relations based on them, in direct (one-to-many) or inverse (many-to-one) order. To invert a view relation, select it in the diagram, press the right mouse button and select Invert from the context menu.

A CompositeDefRelation object has a number of properties in addition to the properties Relation, Parent and Child that determine the relation it represents and in which direction, direct or inverse, it is applied. In addition to that, it only has a read-only Cardinality property, returning OneToMany or ManyToOne according to the relation’s Cardinality and the direction (if inverse, Cardinality is inverted), and the OuterJoinInManyToOne property affecting the process of generating SQL for data fetch. For more information, see How Composite Table Data is Fetched, Stored and Updated.


Composite Table Fields

Composite Table Fields

After creating a composite table diagram and selecting simple tables and connecting them with relations, you must create composite table fields. Composite table fields define the structure of a composite table row. A composite table field is based either on a constituent simple table field, or on a calculated (unbound) field.

To define a composite table field based on a simple table field, use the Diagram tab of the Composite Table Editor. Every field of every simple table in the diagram has a check box. Check this check box to include it in the composite table field collection.

Checking the check box creates a CompositeTableField object referring to the simple table field via the TableViewField property. Primary key fields are always checked, they must be present in the composite table to form its primary key, so you cannot uncheck them. Child relation fields (fields that appear on the child side of a relation connecting simple tables) are always unchecked, they are not allowed to be included in the composite table because they have no independent meaning, their values are always the same as the values of the corresponding parent keys.

The composite table field collection is shown in the Properties tab of the Composite Table Editor, in its bottom panel (its top panel shows the CompositeTable properties).

In addition to fields based on simple table fields, a composite table can contain unbound (calculated) fields. A composite table field is unbound if its TableViewField property value is empty. Unbound fields are usually calculated either by Calculations (expressions) or in code. Unbound field values are stored in composite table rows, see Structured Data Storage: Tables and Table Views. To create an unbound field, click the Add button or select Add from the context menu in the Fields list.

A composite table field has a name that must be unique in the composite table. It has the same function as the name of a simple table field, see Table Fields. A field can be renamed by renaming the field node in the Fields list. Using this list and its button bar, you can add, delete and reorder composite table fields.

CompositeTableField properties are the same as the properties of a simple table field, although some properties are not applicable in composite table, and thus are hidden. For an unbound (calculated) composite table field, its properties have exactly the same meaning as simple table field properties, see Table Fields. For a bound composite table field (one based on a simple table field), its properties have some special inheritance-like features:

· Some properties inherit their value from the corresponding property of the simple table field (determined by the value of the TableViewField property) and that value cannot be changed unless it is changed in the original simple table field. Such properties are: DataType, NativeDbType, AutoIncrement, AutoIncrementSeed, AutoIncrementStep, DefaultValue, MaxLength, Precision, Scale, Unique.

· Some properties can be changed, but their effective value at run time is determined by the conjunction of their value and the value of the property of the base simple table field. Such properties are: ReadOnly, ReadOnlyUnlessNew, AllowDbNull.

· The remaining properties can be specified in a composite table field independently of their value in the base simple table field. Such properties are: CalculationCondition, CalculationExpression, Calculations, Constraints.

Every modifiable table in C1DataObjects must have a primary key, composite tables are no exception. A composite table’s PrimaryKey is composed of bound composite table fields that belong to the primary key of their simple table (have PrimaryKey = True), except child relation keys (fields that appear on the child side of a relation connecting simple tables). This is the rule determining the value of the PrimaryKey property of a composite table field and the value of CompositeTable.PrimaryKey.


Composite Table Properties and Business Logic Events

Composite Table Properties and Business Logic Events

A CompositeTable object has the same properties as the Table object (see Table Properties), except some that are not applicable to composite tables and thus hidden. There is also a AllowMultipleConnections property specific to CompositeTable, see How Composite Table Data is Fetched, Stored and Updated.

Business logic code can be associated with a composite table as well as with a simple table, in the form of event handlers of a C1TableLogic component, see Table Business Logic Events.


How Composite Table Data is Fetched, Stored and Updated

How Composite Table Data is Fetched, Stored and Updated

As with simple tables, fetching data for composite tables originates from table views based on the composite table, see How the Data is Fetched. The resulting composite table rowset is the union of rowsets fetched by table views based on this composite table.

Fetching composite table data, C1DataObjects generates a SQL statement joining all involved simple tables with SQL joins. This is only possible if all constituent simple tables are bound tables sharing the same Connection. For more information, see Bound, SQL-Based and Unbound Tables. By default, this is a necessary condition for a composite table, it will throw an exception if this condition is not satisfied. However, setting a special property AllowMultipleConnections to True you can override this restriction. Then C1DataObjects will apply a nested loop algorithm to fetch the composite table data from different database connections and/or from unbound data sources. The result will be the same as if all data were stored in the same database, with the same connection, but performance may be much slower than with a single SQL statement.

The process of generating the SQL statement fetching data is automatic, but it can be affected by a few properties:

OuterJoinInManyToOne (default: True): By default, many-to-one relations in a composite table diagram generate outer joins in the SQL statement. This ensures the standard interpretation of many-to-one links, where the child table contains one row corresponding to the parent row, or none. If there is no corresponding row, the child fields receive null values. However, some databases do not implement outer joins, or implement them inadequately, with various limitations. In this case, and when outer joins are undesirable for other reasons, you can set this property to False. C1DataObjects will use inner joins for this view relation in the composite table diagram. Note that one-to-many relations always produce inner joins in the generated SQL statement. This is because every composite table row must contain non-null values for all its primary key fields, and that requires that for every one-to-many relation at least one child row exists for every parent row.

Alias (default: empty string): A generated SQL statement must use aliases for constituent simple tables, because a table can occur more than once in a composite table diagram, so its name may be not unique in the statement, in which case it needs aliasing. For more information, see Creating and Modifying Composite Table Diagrams. By default, view table names are used as aliases, but if you want to change the default alias, you can set it for a table view in the Alias property. This is rarely needed, this property is added only for completeness, since all other names in the generated SQL statement can be controlled by developers using DbTableName and DbFieldName.

If you want to see the generated SQL statement, set up a C1DataSetLogic component and attach a handler to its AfterGenerateSql event. The generated SQL statement is passed as an argument to that event.

Once the data is fetched, it is stored as described in Structured Data Storage: Tables and Table Views. This structured storage ensures that data is always kept in sync, with the schema structure preserved on all modifications, whether modifications are made from a simple table or from a composite table including that simple table.

When updating data, committing changes to the database does not involve composite tables. As described in How the Data is Modified, all changes end up in simple tables, so it is this simple table data that is sent to the server to update the database.


How to Access Composite Table Data

How to Access Composite Table Data

Composite tables do not differ from simple tables in the way their data is accessed. See How to Access Table Data and How to Access Table View Data for information on how to use data in data bound controls and programmatically from code.


Composite Relations

Composite Relations

A composite relation (class CompositeRelation) defines a parent-child relationship between two tables one of which is a composite table. See Simple Relations about parent-child relationships between tables. If both parent and child are simple tables, we use a simple relation to connect them. If at least one of them, or both, are composite, we use a composite relation.

A composite relation is based on a simple relation connecting one of the parent’s constituent tables to one of the child’s constituent tables, as in the following figure:

More exactly, it connects one of the parent’s table views to one of the child’s table views. The distinction between simple tables and table views must be made because a composite table can have multiple table views (CompositeDefView objects) based on the same table in its diagram. In this case, we need to know which of the table views actually participates in the relation.

Creating a composite relation starts in exactly the same manner as creating a simple relation. When you set either its Parent or its Child property to a composite table, the relation will become a composite relation.

When you set both Parent and Child of a composite relation, the Schema Designer looks for a simple relation connecting a parent’s table view with a child’s table view. If one is found, and if it is the only one possible simple relation, the SimpleRelation property is automatically set to this simple relation. If more than one simple relation is possible, the SimpleRelation property will not be set automatically, you will need to open the property combo box and select one of the applicable simple relations.

Once you select a SimpleRelation (or it is set automatically), the Schema Designer sets the properties ParentTableView and ChildTableView to the parent’s and child’s table views connected by the simple relation. This, however, is done only if the choice of such table views is unambiguous, that is, if both parent and child composite tables have only one table view based on the corresponding table. If the choice is non-trivial, i.e., there is more than one table view to choose from, the properties ParentTableView/ ChildTableView are not set automatically, you will need to choose a table view in the property combo box.


Data Sets

Data Sets

A C1DataSet is a self-contained data and code unit filled with data according to the schema. It is the data as it is exposed to the user, that can be used both by data bound controls and programmatically. Any C1DataObjects client works with a C1DataSet. A data set also serves as a transaction context, modifications made in separate data sets belong to separate transactions. Modifications are not visible across data sets.

The structure of a data set is defined in the schema as a DataSetDef object. A schema can contain multiple data set definitions.

To fill a C1DataSet with data, you can either explicitly call Fill from code or set FillOnRequest property to True (the default value), making a data set fetch data at startup, when the data is requested.

When filling a data set with data, you must be aware that unless you specify filter conditions in code before calling Fill or in BeforeFill event, each table view will fetch all existing table data unrestricted. To restrict fetch, you must specify filter conditions for each table view separately. Restricting one table view does not automatically restrict any other.

All data fetched for a C1DataSet object are retrieved in one call to the server, a Fill call, unless in virtual mode where data retrieval occurs in limited chunks of data, upon request, see Virtual Mode - Dealing with Large Datasets. The user application can then make modifications to the data in a C1DataSet locally, and send modifications to the data source (usually, a database) calling Update, or automatically, using a C1DataTableSource with UpdateLeavingRow property set to True.

A data set is a collection of table views (TableView objects) optionally connected with view relations (ViewRelation objects). Each table view represents a certain table, either simple or complex. There can be multiple table views representing a single table in a data set. It is most common for a table view to represent a table without changing anything, without modifying business logic and properties, and with table view fields exactly corresponding to the table fields. In this case, creating a data set definition in the Schema Designer is a simple matter of selecting tables that need to be represented by the data set (use the Add Tables button). However, in more advanced cases you can use the ability of a table view to override and modify the table’s business logic and properties, and customize table view fields, see Table Views.

The set of table views you include in a data set determines what tables are filled with data in this data set. It is the developer’s responsibility that all tables that are used by business logic code of a data set are present in the data set, otherwise an exception may occur when the code tries to access tables that have not been fetched. See How the Data is Fetched for details.


Creating and Modifying a Data Set Definition

Creating and Modifying a Data Set Definition

To create a data set, open the Schema Designer and select View, DataSets. In the DataSets window, press the Add button [image] or select Add from the context menu. The empty new data set will open as a new DataSet Editor page.

The DataSet Editor Diagram looks similar to the Diagram tab of the Composite Table Editor – it contains a diagram (graph) of table views connected with relations. It also allows you to set the properties of the graph’s nodes: TableView and ViewRelation objects. Unlike the Composite Table Editor, it also allows you to set the properties of table view fields (TableViewField objects).

Immediately after creating a new data set, rename it by renaming the DataSet node in the DataSets window.

The first action when setting up a data set is creating table views and adding them to the diagram. Table views can be added to the diagram by clicking the Add tables button in the DataSet Editor Diagram. The Add tables dialog box appears.

Select tables from the list of Existing tables and use the arrows to move them to the list of Selected tables.

Table views can also be added by dragging and dropping them from the Tables window onto the Diagram of the DataSet Editor.

When you add a table view to the diagram, relevant relations connecting it to other table views in the diagram are also added, unless suppressed by unchecking the "Create view relations" check box in the Add tables dialog or by unchecking the "Automatically create relations adding tables to diagrams" check box in the Options dialog (select Options in the Schema menu). Redundant relations can then be deleted by selecting a relation arrow in the diagram and pressing the Del key or by right-clicking it and selecting Remove from the context menu.

You can also add tables using the Table button on the top bar of the Diagram. Simply click the Table button, then click the diagram, and the table is added. In this case, you will have to set the Table property manually, selecting the newly created table view and setting its Table property in the property grid below the diagram.

It is also possible to add relations to the diagram manually. Click the Relation button on the top bar of the Diagram and draw an arrow connecting parent and child tables using drag-and-drop from parent to child. The Schema Designer will try to find an appropriate relation connecting these two tables (inverting the relation, if necessary). When the new view relation is created, select it and look at popup box or the value of the Relation property in the property grid below the diagram. If this property is empty, it means that the Schema Designer could not find an appropriate relation.

The objects shown on the diagram are TableView and ViewRelation objects. See Table Views and View Relations for detailed descriptions. To set properties of any object on the diagram, including table views, table view fields and view relations, select the object on the diagram and browse/set its properties in the property grid below the diagram. To select a view relation, select the arrow representing the view relation. If it represents multiple view relations, you will need to choose one of them from a context menu that pops up when you select the arrow. To select a table view field, select an item in the list of fields shown inside a table view.

By default, when you add a table view, its Fields collection is filled with all fields of the corresponding table. More exactly, since TableViewField and TableField are different objects, it means that the table view contains a TableViewField representing each TableField of the corresponding table.

If you need to add a table view field (for example, a calculated, unbound field, see Table View Fields), or delete some table view fields or re-arrange their order, right-click the table view and open the Fields dialog by selecting Fields… from the context menu. In the Fields dialog you can also set properties of table view fields, although that can be done in the diagram too, in the property grid below the diagram.

If you want to restore the collection of table view fields to its initial state, as if the table view has just been added to the diagram, right-click the table view and select Retrieve Fields from the context menu. This will create TableViewField objects anew, one table view field for each table field.


Table Views

Table Views

A TableView object represents a table in a data set. It can represent a simple or a composite table. The table is determined by its Table property.

TableView also has properties of its own. Some TableView properties can be used to override table properties. For example, you can set ReadOnly to True, which will make the table view read-only, although the table itself may be modifiable. The following TableView properties override Table properties: AllowAddNew, AllowDelete, ReadOnly.

Other TableView properties work independently of or in addition to Table properties:

The PrimaryKey property is read-only. It shows the field name(s) constituting the primary key of the table on which the table view is based. Multiple field names are separated with commas. A table view’s primary key is the same as the corresponding table’s primary key. The only purpose of having a special PrimaryKey property in TableView is that table view field names can differ from table field names, so the string value may not be the same. Note that primary key table fields are always represented by table view fields, such table view fields are not allowed to be deleted. This insures that each table view has proper primary key.

The FillSort property controls the order in which data rows are sorted after fetch. The order can also be specified at run time, calling Fill method, by specifying FillSort in a FilterCondition. By default, fetched data is sorted by primary key. If a different sort is required, set the FillSort property to the sort field name(s). To specify sort order (ascending/descending), add “ASC” (ascending) or “DESC” (descending) after the field name. If no order is specified, the order is “ASC” (ascending). Multiple field names are separated with commas.

Example: “CustomerID DESC, OrderID”.

ConstraintsFieldLevel and ConstraintsRecordLevel are collections of table view constraints, ConstraintInfo objects. Constraints are expressions, see C1DataObjects Expressions. These constraints are tested in addition to table constraints when data is modified in this table view, see Table Properties. If you have a constraint that must always be enforced for a given table, must be satisfied in all table views representing that table, put it in the table’s constraint collection. If, on the other hand, you have a constraint that is specific to a particular table view, then it belongs to the table view’s constraint collection.

ConstraintsRecordLevel contains record level constraints, that are evaluated when the user finishes editing a row, before the C1DataSetLogic BeforeEndEdit event. If one of the constraints is not satisfied, an exception is thrown. The exception message is determined by ErrorDescription. Constraints with Condition expression (if non-empty) evaluating to False, are skipped, and not tested.

ConstraintsFieldLevel contains field level constraints, that are evaluated on every field change made in this table view. Usually, a field level constraint belongs to a certain field, not to the table view as a whole, in which case it resides in Field.Constraints. ConstraintsFieldLevel should contain only field level constraints that cannot be associated with a particular field. Constraints in ConstraintsFieldLevel are evaluated each time any table view field changes, whereas constraints in Field.Constraints are evaluated on the owner field change.

The AutoEndAddNew property determines behavior of newly added rows. If it is set to True (default), setting the row’s primary key triggers adding the new row to the table. If it is set to False, the newly added row is considered temporary, not belonging to the table, until the EndAddNew method is explicitly called.

The DataAccessMode property determines whether the table view functions in virtual mode, and specifies which of the three possible virtual modes is used. C1DataObjects virtual mode allows you to use large datasets in .NET Windows Forms applications, a feature that is not supported in Visual Studio .NET and ADO.NET without C1DataObjects. In virtual mode, data retrieval occurs in limited chunks of data, upon request, instead of pre-fetching all data at once. See Virtual Mode - Dealing with Large Datasets for detailed description.

· The default DataAccessMode value, Static means that virtual mode is not used.

· Data access mode Virtual means that data is fetched in chunks (called segments) of limited size (the size of each segment is determined by the VirtualSegmentSize property, default: 400), and the number of segments cached at the client at any given time is limited (this number is determined by the VirtualSegmentCount property, default: 4). Mode Virtual works for rowsets of virtually unlimited size, for example, in Tutorial 4 we demonstrate how it can be used to display 2.7 million rows in a grid.

· Data access mode VirtualUnlimited is similar to Virtual in that data is fetched in segments, but the number of segments in the cache is unlimited, the VirtualSegmentCount property value is ignored. Once a segment is brought into cache, it remains there. This setting is appropriate when you want to enhance performance by eliminating redundant roundtrips to the server, but it should not be used with very big rowsets if the user is expected to fetch many segments into memory.

· In VirtualAutomatic mode, data is fetched in segments, as in the previous two modes, and the number of segments in the cache is unlimited as in VirtualUnlimited mode, and, in addition to that, fetch is continually performed in background mode, asynchronously, until all data is fetched. This mode is appropriate for large rowsets that are big enough to make it undesirable to fetch all data at startup time, but not too big, so they still fit in client memory. This mode is additionally qualified by a boolean VirtualConsolidateRows property. If it is set to True (default), then C1DataObjects will rebuild the rowset when fetch is complete. While fetch is incomplete, Rows contains only rows of the current segment. Once fetch is complete, Rows contains all fetched rows, the whole rowset. In the other two virtual modes, Rows always contains only rows of the current segment.

The following properties are performance tuning settings for virtual mode, must be changed only if default values are unsatisfactory: VirtualAsyncThreshold, VirtualConsolidateRows, VirtualSegmentCount, VirtualSegmentSize, VirtualSyncThreshold, see Virtual Mode - Dealing with Large Datasets for details.


Table View Fields

Table View Fields

Table view fields (TableViewField objects) define the structure of a table view row. A table view field is either based on a table field (a field of the table on which this TableView is based, according to its Table property), or it is a calculated (unbound) field.

By default, table view fields are in one-to-one correspondence with table fields. To customize the table view Fields collection, select the table view, press the right mouse button and open the Fields dialog selecting Fields… from the context menu. There you can add new fields, including unbound (calculated), delete fields and re-arrange their order (note that primary key fields can be deleted; primary key table view fields are always present to ensure that the table view has proper primary key). The Fields dialog also allows to set properties of table view fields. If you want to restore the collection of table view fields to its initial state, select the table view, press the right mouse button and select Retrieve Fields from the context menu.

In addition to fields based on table fields, a table view can contain unbound (calculated) fields. A table view field is unbound if its TableField property value is empty. Unbound fields are usually calculated either by Calculations (expressions) or in code. Unbound field values are stored in table view rows, see Structured Data Storage: Tables and Table Views. To create an unbound field, push the Add button or select Add from the context menu in the Fields list.

A table view field has a name that must be unique in the table view. It has the same function as the table field name, see Table Fields. A field can be renamed by renaming the field node in the Fields list.

TableViewField properties are the same as the properties of a simple table field (see Table Fields), except some field properties do not apply to table view fields, for examples, properties controlling database update, such as UpdateIgnore, UpdateSet, etc; table views do not participate in updating the database, see How the Data is Modified). Such properties are hidden. For an unbound (calculated) table view field, its properties have exactly the same meaning as table field properties, see Table Fields. For a bound table view field (one based on a table field), its properties have some special inheritance-like features:

· Some properties inherit their value from the corresponding property of the table field (determined by the value of the TableField property) and that value cannot be changed unless it is changed in the original simple table field. Such properties are: DataType, NativeDbType, AutoIncrement, AutoIncrementSeed, AutoIncrementStep, DefaultValue, MaxLength, Precision, PrimaryKey, Scale, Unique.

· Some properties can be changed, but their effective value at run time is determined by the conjunction of their value and the value of the property of the base table field. Such properties are: ReadOnly, ReadOnlyUnlessNew, AllowDbNull.

· The remaining properties can be specified in a table view field independently of their value in the base table field. Such properties are: CalculationCondition, CalculationExpression, Calculations, Constraints.


Table View Business Logic Events

Table View Business Logic Events

You can associate business logic code with table views using the C1DataSetLogic component. Use this component when you need data set-specific (in other words, table view-specific) logic rules that must be enforced in the context of a particular data set and table view, but do not always apply to the underlying table.

Only one C1DataSetLogic component is allowed for each data set. To create C1DataSetLogic components, use the Create Business Logic Components menu item of the C1SchemaDef component, or add it manually from the Toolbox and set its SchemaComponent and DataSetDef properties. Then you can attach event code either selecting the components on the designer surface, or using the Business Logic Events toolwindow (select Business Logic Events from the C1SchemaDef context menu to open the toolwindow). The Business Logic Events toolwindow shows the list of all tables and data sets. When you select a data set in the toolwindow, the data set’s business logic events appear in the Properties Window (in Visual C#, when the Events radio button is selected in the Properties Window; in Visual Basic use the Method Name combo box in the code editor).

See Table Business Logic Events for the list of event handlers that can be used to specify business logic.


View Relations

View Relations

View relations (ViewRelation objects) are depicted in a data set diagram with arrows connecting nodes - table views. View relations are optional; it is possible to have a data set without them. View relations play the following roles:

· They define the master-detail (parent-child) hierarchy between table views. When you use a data set with view relations as the DataSource for data bound controls, you can bind one grid to a master (parent) table view and another grid to a detail (child) table view. Then the detail grid will show the child rows related to the parent row that is current in the master grid at the moment. See also, How to Access Table View Data.

· They allow programmatic access to parent and child rows of a table view row, using methods GetParentRow and GetChildRows. Note that even without view relations; it is possible to navigate from parent to child rows and vice versa between tables, for table rows, using the same C1DataRow methods GetParentRow / GetChildRows and relations between tables. See Simple Relations and Composite Relations.

A view relation between table views is usually based on the relation (Relation object) between the two tables represented by those two table views (except for custom view relations, see below). This relation can be simple or composite (see Simple Relations and Composite Relations). It is determined by the ViewRelation.Relation property. A view relation, as an arc in the data set diagram, can have direction opposite to the direction of the table relation on which it is based. For example, having a one-to-many relation Customers – Orders, we can create a many-to-one view relation Orders – Customers, based on Customers – Orders, but in inverse order (direction). So, if the Relation object Customers – Orders has Parent = Customers, Child = Orders, the view relation, if inverted, will have Parent = Orders, Child = Customers. This inversion does not change the original Relation object. Usual practice is to define all simple relations, Relation objects shown in the Relations window as one-to-many, and then apply them in diagrams, create view relations based on them, in direct (one-to-many) or inverse (many-to-one) order. To invert a view relation, select it in the diagram, press the right mouse button and select Invert from the context menu.


Custom View Relations

Custom View Relations

A custom view relation is not based on any simple relation between tables. It is used when you need a more complicated algorithm than simple equality of table fields. In a custom view relation, the set of child and (optionally) parent rows is defined in code in special events. For example, see the CustomRelations sample in the Samples directory, where a custom relation is used to represent a many-to-many relation that cannot be based on a single simple relation between tables.

A view relation is considered custom if its GetRowsEvent property is set to True. Then it uses GetChildRows event to obtain child rows, and, if OneWay = False, it uses GetParentRow event to obtain parent row. If OneWay is set to True, the relation is one-way, only child rows are defined, parent row is not accessible from a child row.

To create a custom relation, drag an arrow from parent to child table view in a data set diagram using the Relation button on top of the data set editor. Select the arrow to set properties. Specify the Name property, set GetRowsEvent to True (leave the Relation property empty). Use a C1DataSetLogic component attached to the data set to write code in the events GetChildRows /GetParentRow specifying the algorithm for obtaining child rows and (optionally) parent row for this relation.


How to Access Table View Data

How to Access Table View Data

The C1DataObjects gateway to data is the C1DataSet component. Every C1DataObjects client uses one or more C1DataSet components to bind or gain access to data. Setting up a C1DataSet component, you need to

· Attach it to the schema either by setting the SchemaDef property (if a C1SchemaDef component resides on the same design surface, a case that is called direct client) or by setting its DataLibrary property (if the schema resides in a data library, case called library client) and, optionally, setting the DataLibraryUrl property (if the data library resides on a remote computer, a case called remote client). See Application Configurations for detailed description of different configuration and deployment options and explanations of the terms direct client, data library and remote client.

· When the C1DataSet component is attached to a schema, set its DataSetDef property choosing a data set definition name in the combo box showing all data sets defined in the schema.


Data Binding

Data Binding

Using a C1DataSet component as your data source, you can bind data-aware components such as a grid or a text box to the data. The C1DataSet component exposes table view rowsets. Data-aware controls can bind to any of these rowsets. To bind to a table view rowset, set the DataSource property of the data-aware control to the C1DataSet component and open the DataMember property combo box. It will show the selection of available table views. Select the table view you wish to bind to.

C1DataObjects also supports master-detail (parent-child) data binding. Parent and child table views are related by View Relations. You can bind one control to a master (parent) table view and another control to a detail (child) table view. After doing this, the detail control will show the child rows related to the parent row that is current in the master control at the moment. Parent-child hierarchy is shown in the DataMember property combo box as a tree of view relations starting from topmost (master) table views. Topmost table views, roots of parent-child hierarchies, are distinguished by the leading underscore in their names. The same table view also appears in the DataMember list without an underscore, as a stand-alone table view. Select a stand-alone table view if you do not want this data-aware control to participate in a parent-child hierarchy. Select a topmost master table view, starting from underscore, if you want to bind it to a master (topmost parent) rowset. Select a node in a hierarchy tree, a view relation name, if you want to bind it to a child in a parent-child hierarchy.

You can also bind data-aware controls at run time, setting their DataSource and DataMember properties, for example

· Visual Basic

· C#

· Delphi

Here Customers is the parent table view, Orders is the child table view, Customers-Orders is a view relation between them.

Another run-time option is to bind directly to the table view’s C1DataTable object, as in the following example:

· Visual Basic

· C#

· Delphi

If you need additional sorting and filtering, you can bind to a C1DataView component, both at design time and at run time

· Visual Basic

· C#

· Delphi

C1DataView allows filtering and sorting the data using its RowFilter and Sort properties. The RowFilter property filters data rows according to a boolean expression. If you need a more advanced filtering algorithm that cannot be specified as a simple expression you can use the GetRows event to filter data in code.

C1DataView can also be used to filter/sort the data set itself, using the IsDefault property. If IsDefault = False (default), filtering/sorting is applied to the C1DataView component only, affects only controls bound to that C1DataView. If IsDefault = True, filtering/sorting defined in the C1DataView is applied to the data set itself, affects all controls bound to the data set in any way, not just those using the C1DataView as their DataSource. This filtering/sorting applies to hierarchical master-detail binding as well as to simple binding.

Another design-time option for data binding is to bind to a C1DataTableSource that is attached to a certain table view of a data set. Using a C1DataTableSource allows you to handle business logic events in your client application code, in addition to the business logic specified in the data library, see Business Logic for details. Using C1DataTableSource is mandatory if your client application works in virtual mode, see Virtual Mode - Dealing with Large Datasets for details.

If you bind third-party (not ComponentOne or Microsoft) controls to C1DataObjects data sources, some of them (very few) may work incorrectly with notifications, that is, with the IBindingList.ListChanged event. C1DataObjects uses a slightly different notification scheme than ADO.NET does. C1DataObjects notifications are fully .NET data binding-compliant and optimized for data bound controls. All ComponentOne bound controls and Microsoft bound controls work properly with this notification scheme. In fact, all data bound controls should work with C1DataObjects notifications without problems, but in the non-ideal world that can be broken. To prevent this problem and allow using any bound controls, C1DataObjects provides a special NotificationModeFlags property.


Programmatic Access

Programmatic Access

To access a table view rowset, obtain a C1DataTable object from a C1DataSet component (using the TableViews collection property), and use the Rows collection containing C1DataRow objects representing table view rows. To perform actions on table view rows or table view data as a whole, use appropriate methods and properties of the C1DataTable and C1DataRow classes. Their object model is similar to that of ADO.NET.

C1DataObjects also allows typed access to table and table view rows. For each table and table view, C1DataObjects generates a class representing its row. For example, ProductsRow is an object (business object, data object) where each field has a corresponding property (ProductsRow.UnitPrice, ProductsRow.UnitsInStock, etc.) and each relation has a corresponding method (Products.GetOrder_DetailsRows, etc.) allowing you to obtain child rows and the parent row). Using these classes, you can write your business logic code in a convenient, type-safe way, and benefit from Visual Studio code completion features giving you the lists of properties and methods to choose from. See Using Typed Data Objects in Business Logic, for details about data object classes.

To use a data object class in your code, call the static Obj method implemented in every data object class. It obtains a business object given a C1DataRow object as its argument. For example, the following code obtains a ProductsRow business object from a C1DataRow:

· Visual Basic

· C#

· Delphi


Business Logic

Business Logic

C1DataObjects uses the standard business object paradigm to allow you to develop business logic components (data libraries) and reuse them in multiple client projects. This provides clear separation of business and data logic from the presentation (GUI) layer. See Application Configurations for the detailed description of the data library concept. Developers write business logic code in the events of special C1TableLogic and C1DataSetLogic components in a data library.

C1DataObjects enables unprecedented code reuse power and flexibility by allowing you to specify business logic on all levels: from the most general level of simple tables for rules that must be enforced for tables regardless of the context where they are used, to more specific levels of composite tables, then data sets, and finally the most specific level of a concrete rowset instance. For more information, see How Business Logic Works on Different Levels.

When writing business logic code, you can use Using Typed Data Objects automatically generated by C1DataObjects. In this way, you can write code in a convenient, type-safe way, and benefit from Visual Studio code completion features giving you the lists of properties and methods to choose from.

In addition to business logic events, C1DataObjects allows you to define business methods in your data library, see Business Methods. Business methods are called by the client and executed on the server. They can fill data sets with data, update the database and perform any other required operations.

How Business Logic Works on Different Levels

Business Logic Events

Business Methods

Using Typed Data Objects

Action Order and Execution Mode


How Business Logic Works on Different Levels

How Business Logic Works on Different Levels

The same business logic events, such as, for example, AfterFieldChange or BeforeDelete, can be handled on different levels:

Simple table level | Events of a C1TableLogic component, see Table Business Logic Events. They are triggered in any context, wherever the table is involved: in a composite table including this table, and in a table view based on this table. For example, if you write code converting CustomerID value to upper case in table_Customers_BeforeFieldChange, it will work for the Customers table itself, and for a CustomersOrders composite table that includes Customers, and for any table view based on such tables. In other words, the business rule will be automatically enforced everywhere it should be, in any possible context where the Customers table is used.
Composite table level | Events of a C1TableLogic component representing a composite table. They are triggered in any data set where the composite table is used. They are not triggered for constituent simple tables when they are used outside of this composite table context. For example, if you write some code in a CustomersOrders composite table events, it will be executed when the user works with CustomersOrders, but not when they work with the Customers table stand-alone.
Table view level | Events of a C1DataSetLogic component, see Table View Business Logic Events. They are active in a particular data set. If there are multiple C1DataSet objects with the same schema definition (DataSetDef; see Schema Objects), they are active in any such object. This business logic level represents data set-specific (in other words, table view-specific) rules that must be enforced in the context of a particular data set and table view, but do not always apply to the underlying table.
Rowset level | Events of a C1DataTableSource control. This level is different from all the rest in that it belongs to a particular client application, as opposed to a data library. All other logic levels are enforced by C1DataObjects in any application that uses their data library. Rowset level logic is enforced only in the application where this code is written.

Consider for example, a CustomersOrders composite table, including a simple Customers table, and a data set MyOrders having MyOrdersView table view based on the CustomersOrders table. Imagine a form in a client application with a C1DataSet dataSet1 connected to MyCustomersView, a C1DataTableSource C1DataTableSource1 connected to dataSet1, and a grid bound to C1DataTableSource1. Imagine that we have business logic event code BeforeFieldChange specified on all levels. When the end user modifies the CustomerAddress field in the grid (the field belongs to the Customers table inside the CustomersOrders composite table), the order in which the events are triggered will be from the most specific to the most general:

C1DataTableSource1_BeforeFieldChange (rowset level) →

dataset_ MyOrders_BeforeFieldChange (table view level) →

table_CustomersOrders_BeforeFieldChange (composite table level) →

table_Customers_BeforeFieldChange (simple table level)

For the corresponding “after” event, AfterFieldChange, the order will be inverse, from the most general to the most specific:

table_Customers_AfterFieldChange (simple table level) →

table_CustomersOrders_AfterFieldChange (composite table level) →

dataset_ MyOrders_AfterFieldChange (table view level) →

C1DataTableSource1_AfterFieldChange (rowset level)


Business Logic Events

Business Logic Events

These sections describe particular C1DataObjects business logic events in detail.

Each event is fired by C1DataObjects at appropriate time defined below. Firing an event, C1DataObjects uses the inheritance chain of levels described in How Business Logic Works on Different Levels. For example, when we say that “the BeforeFieldChange fires”, it means that the event is fired on all levels where it is handled. It may be in a table view, in a composite table, in a simple table, etc, whatever applies and contains a handler code.

Events on Editing Row

Events on Modifying Row

Events on Adding Row

Events on Deleting Row

Events on Updating Database


Events on Editing Row

Events on Editing Row

Edit Mode

The C1DataObjects concept of edit mode is exactly the same as in ADO.NET. A row is in edit mode after a BeginEdit method call. Calling EndEdit ends the edit mode state. Edit mode is intended for making successive changes to a row without validating the whole row. A single change does not have to satisfy validation conditions. Row validation occurs when the row exits edit mode, on EndEdit. Place such validation code in the BeforeEndEdit event.

Edit mode is used by bound controls: when a row becomes current, it is automatically placed in edit mode (BeginEdit is called implicitly). When the user moves to another row, the row exits edit mode (EndEdit is called implicitly). Bound controls maintain a single row in edit mode at any given time, it is the row corresponding to the current row position of System.Windows.Forms.CurrencyManager. Programmatic calls to BeginEdit / EndEdit allow multiple rows in edit mode simultaneously.

While a row is in edit mode, changes made to its fields since the moment it entered edit mode can be canceled (reversed) by calling CancelEdit. It can also be done through some bound controls, a grid, for example. The row remains in edit mode after CancelEdit, only field changes are canceled.

Events in Edit Mode Transitions

When a bound control or user code calls BeginEdit, C1DataObjects fires the BeforeBeginEdit. This event can be used to disallow transition to edit mode by throwing an exception, if necessary, although this is not a recommended design pattern. Note that transition to edit mode does not yet mean that the row is being changed. If you want to block changes to a row, the proper place to do it is in the BeforeFirstChange event, if you need to block the whole row, or in BeforeFieldChange, if you want to block a particular field.

After a row has entered edit mode, the AfterBeginEdit event is fired.

Before a row leaves edit mode, the BeforeEndEdit event is called. This event is the most important among the edit mode transition events, because it is the point where data validation code resides in most cases. If you have data validation rules dependent on multiple fields, program these rules in the BeforeEndEdit event. If validation rules are not satisfied, to signal validation failure, throw an exception. That will prevent row from leaving edit mode. Note that in many cases you can use Constraints [TBD: topic jump], expressions specified as table or table view properties, instead of writing validation code in the BeforeEndEdit event. Record-level constraints are tested before the BeforeEndEdit event.

After a row has successfully left edit mode, the AfterEndEdit event is fired.

When the user cancels changes in edit mode (CancelEdit is called or a bound control cancels changes), C1DataObjects first fires the BeforeCancelEdit edit. Throwing an exception in that event disallows canceling changes. After successfully canceling, reversing the changes, C1DataObjects fires the AfterCancelEdit event.

Edit mode by itself does not mean that the row is being changed, it only signifies a special state in which changes to row fields do not trigger row validation. When the row is actually changed first time after entering edit mode, the BeforeFirstChange event fires. By throwing an exception in that event, you can disallow changes to the row. After the first change has been successfully performed, the AfterFirstChange event fires. You can use that event, for example, to show some user interface clues indicating that the row has been changed (canceling them in AfterCancelEdit and AfterEndEdit, if necessary). After the AfterFirstChange event has been fired for the first time, successive changes to row fields do not fire the BeforeFirstChange / AfterFirstChange events.


Events on Modifying Row

Events on Modifying Row

The sequence of events invoked when the end user or user code modifies a field is as follows:

· Field-level constraints are tested. If a constraint is not satisfied (does not evaluate to True), an exception is thrown and the change aborted. In a constraint expression, the field being modified returns the new (proposed) value, although the value has not yet been assigned to the field. If you need the old value of the field in an expression, use a special function: BeforeChange(field), see C1DataObjects Expressions.

· The BeforeFieldChange event fires. This event allows you to specify validation logic that cannot be specified in the form of constraint expressions. Throwing an exception in this event aborts the change. When this event is fired, the field value is not yet modified. The new (proposed) values are available in the NewValue argument of the event.

· The new value is assigned to the field.

· Any calculated fields (Calculation expression) dependent on the modified field acquire their new values immediately after the new value is assigned to the field (before the AfterFieldChange event). In fact, C1DataObjects does not perform any special processing in order to update calculated fields after changing the value. It simply marks the calculation results that depend on the changed value, internally, as out-of-date. Whenever a calculated value is requested, in code, or by a bound control, for display, the calculation expression is re-evaluated to obtain the up-to-date value. Note that bound controls are not notified of the change until the whole process of handling the field modification is completed. Only after all necessary changes are done, bound controls will be notified of all changes resulting from the field modification, including the calculated expressions that have gone out-of-date. At that point, the bound control will request the new values, so the calculation expressions will be re-evaluated. If, for some reason, you need to force re-evaluation of calculated expressions before that, it can be done calling the Refresh method for a single row or Refresh for a whole rowset.

· The AfterFieldChange event fires. This event allows you, among other possible actions, to modify other fields/rows/tables depending on this field, for example, update some counters. The new value is already assigned to the field, and the old field value is also available in this event, in its OldValue argument. This can be useful, for example, in updating counters, where you may need to add the new value and subtract the old one.

· At this point, after the AfterFieldChange event is handled, the process of changing a field value is finished. However, that does not mean that C1DataObjects has finished the processing and relinquished control to the user. The business logic code that handled the events could make other changes to row fields in the process, or it could change other rows or other tables. When this handling is done, C1DataObjects collects all changed rows, all changes resulting from the field modification, and fires the AfterChanges event for each such row. If the business logic code did not change any fields in rows other than the row where the original field change occurred, then AfterChanges will fire for that row only. If, however, other changes resulted from the field modification, AfterChanges will fire for all changed rows. The AfterChanges event is designed specifically to ensure that this is the “last change”, so the developers can put code that relies on the “finality” of changes there. For instance, this event is the best place to put your code calculating some calculated field values (supposedly, for calculations that cannot be specified as simple calculation expressions).

· The CurrentRowChanged event fires with ChangeType set to RowChangedTypeEnum.FieldsChanged. Strictly speaking, this event is not a part of business logic, because it is fired in client components, such as C1DataSet, not in data library components. It is used in the client application for GUI purposes, in scenarios like, for example, synchronizing detail data with the master row on every change occurring in the master row.

· Finally, C1DataObjects notifies bound controls of all changes that occurred during the processing of field modification, so they can update their display with new data. Notifying bound controls does not occur immediately when you change a field in your business logic code. It is postponed until the end, because a field modification can cause other changes (see above), so it is better, in more senses than one, to notify of all changes at once, when they are final.


Events on Adding Row

Events on Adding Row

Before adding a new row, C1DataObjects fires the BeforeAddNew event. When this event fires, the new row is not yet created. Throwing an exception in this event aborts the process of creating a new row and adding it to the table.

Once a new row has been created and filled with default values (see the field DefaultValue property), C1DataObjects fires the AfterAddNew event. That event can be used to fill default values of the fields according to some rules that cannot be specified as simple values of the DefaultValue property. It can also be used to specify the primary key values, see Keys Assigned by Client: New Row Detached and Attached State.

When a new row is created, it is empty, filled with default values, its primary key undefined. A row with an undefined primary key is in a special transitory state called detached. For more details, see Keys Assigned by Client: New Row Detached and Attached State. A row becomes a full-fledged table row (for example, it can be sent for updating the database) only after its primary key is set. There are two main scenarios in setting the new row primary key:

· The key may be set immediately after the row is created, using the AutoIncrement field property, or in the AfterAddNew event. See Adding Rows and Primary Keys for detailed explanation and examples. In this case, the end user sees the row as a normal row with a primary key from the very beginning.

· The key may be left empty until the user sets it manually or it is set programmatically at the user’s request, see Adding Rows and Primary Keys.

In both cases, the point in time when the row becomes a “regular”, full-fledged row with a defined primary key value (becomes attached) is an event that is potentially important to the business logic. Before attaching a row, C1DataObjects fires the BeforeEndAddNew event. Throwing an exception in this event aborts the process of attaching the row (and aborts EndEdit, if the row is being attached as a result of an EndEdit call). After the row has been successfully attached, C1DataObjects fires the AfterEndAddNew event.

To inquire about the state of a newly added row, use the RowState property. For a detached newly added row the state is Detached. For an attached newly added row the state is Added.


Events on Deleting Row

Events on Deleting Row

Before deleting a row, C1DataObjects fires the BeforeDelete event. Throwing an exception in this event aborts deleting the row.

After a row has been successfully deleted, C1DataObjects fires the AfterDelete event.


Events on Updating Database

Events on Updating Database

All business logic events described in the previous sections are client-side events, they are fired on the client. The update events listed in this section are server-side events, that is to say, they are fired on the server. You do not need to write a different program to support this client-server division. Your business logic acts as a whole, you do not need to divide it, it all resides in your data library. The same data library is used both on the client and on the server. C1DataObjects manages the distinction between client and server and their interaction automatically, transparently to the developer. However, you must be aware that the database update process, and hence the update business logic events, take place on the server, not on the client. Because the data existing on the server is different from that existing on the client, only changed rows and rows related to them exist on the server, see Update in 2-Tier and 3-Tier Configurations. For more details about C1DataObjects data libraries, their client and server use, see Application Configurations.

Note that this distinction between client and server does not apply to a direct client application (see Application Configurations), that is a 2-tier application updating the database directly from the client, an application where C1SchemaDef and C1DataSet components reside on the same design surface. In this case, the client and the server are one and the same application.

Update events are special also in the sense that controlling the order of actions using the ExecutionMode property, as described in Action Order and Execution Mode, is not available for update events. Update events are triggered without an action context stack. They are always handled in the default execution mode ExecuteImmediately.

Business logic inheritance levels apply to update events in the same manner as to other C1DataObjects business logic events. You can handle update events on any suitable level: on a simple table level, composite table level, table view level, etc. For more information, see How Business Logic Works on Different Levels.

Before updating the database, C1DataObjects fires the BeforeUpdate event. When the database update is finished, it fires the AfterUpdate event. The AfterUpdate event is fired after both successful and unsuccessful updates.

When updating database rows, C1DataObjects fires the BeforeUpdateRow and AfterUpdateRow for each row that it changes in the database.

See Updating the Database for detailed explanation of the update process and of the role of the events in it.


Business Methods

Business Methods

In addition to business logic events, C1DataObjects allows you to define business methods in your data library. These are methods added by the programmer to the RemoteDataService-derived class in the data library.

They can be called from the client (both in 2-tier and 3-tier configuration) using the RemoteDataService property. In a 3-tier configuration, business methods are executed on the server. They can fill data sets with data, update the database and perform any other required operations. In business methods, you can use either the default or pre-created connections and/or transactions. C1DataSet objects can be passed to business method as parameters.

In a 3-tier configuration, a data set passed as a parameter is serialized on the client (C1DataSet implements ISerializable) and deserialized on the server. If a business method returns a data set, it is serialized on the server and deserialized on the client. See the CustomFillUpdate sample showing how to use business methods to fill data sets and update the database.

In many cases, business methods are not needed, if standard C1DataObjects Fill and Update methods are enough for performing database operations.

Also, even if you feel that Fill and Update methods do not satisfy all application needs, you can consider customizing them without defining additional business methods. Fill and Update can be customized with appropriate business logic events, and also you can define your own, completely customized Fill and Update by overriding virtual methods RemoteDataService.Fill/Update in the RemoteDataService-derived class in the data library. See the CustomFillUpdate sample for example.

If your custom database processing is not covered by standard or customized Fill and Update methods, then you can implement it with business methods in the RemoteDataService-derived class in the data library.

If you fill a data set in a business method and need to pass it back to the client, you can simply return the C1DataSet object from the method.

To update the database in business methods, use the C1DataSet. GetChanges and Merge methods.

GetChanges creates a C1DataSet containing only modified simple table rows, so they can be passed to the business method on the server for updating the database. To refresh the original data set on the client after update, return refreshed (retrieved from the database after update) rows from the business method and apply the Merge method.


Using Typed Data Objects

Using Typed Data Objects

For each table and table view, C1DataObjects generates a class (data object class) representing its row. For example, ProductsRow is an object (business object, data object) where each field has a corresponding property (ProductsRow.UnitPrice, ProductsRow.UnitsInStock, etc) and each relation has a corresponding method (Products.GetOrder_DetailsRows, etc) allowing you to obtain child rows and the parent row). Using these classes, you can write your business logic code in a convenient, type-safe way, and benefit from Visual Studio code completion features giving you the lists of properties and methods to choose from.

To use a data object class in your code, call the static Obj method implemented in every data object class. It obtains a business object given a C1DataRow object as its argument. For example, the following code obtains a ProductsRow business object from a C1DataRow:

· Visual Basic

· C#

· Delphi

Data object classes are hosted in the data library. They are automatically regenerated by C1DataObjects at design time every time you save a schema in the Schema Designer. They are hosted in a special assembly (called data objects assembly)

<data_library_project_name>.DataObjects.dll

Data object classes belong to the namespace

namespace <data_library_namespace>.DataObjects

where <data_library_namespace> is the namespace containing the C1SchemaDef component in the data library.

Since there is a data object class for each table and for each table view, a naming collision can occur for data object classes if a table view has the same name as the table on which it is based. Although all naming collisions are automatically resolved by adding “_table” and “_tableView” suffixes to the names, it is better to avoid such collisions because they result in ungainly class names. To avoid naming collisions between table and table view classes, use the DataObjectsAssemblyFlags property. Setting DataSetNamespaces flag in that property (it is set by default for new projects) creates a separate namespace for each data set, and table view classes belong to that namespace. For example, Northwind.DataObjects.CustOrders.EmployeesRow for table view Employees in data set CustOrders. Table classes still belong to the root namespace: Northwind.DataObjects.EmployeesRow for table Employees.

A data library project contains a reference to its data objects assembly. When you create a new data library project using the C1DataObjects Project Wizard, the wizard adds a reference in the data object assembly to your data library project References. The data library assembly created by the wizard (initially empty) resides in the obj sub-directory of your project directory.

By default, Schema Designer regenerates the data objects assembly every time you save a schema. If you do not want this to happen (e.g., if you do not need the data object assembly in your application), uncheck the "Recreate DataObjects DLL on saving schema in Schema Designer" check box in the Schema|Options dialog box of the Schema Designer. If you leave it checked, you can optionally specify the location of the data objects assembly and version information in that assembly. Note that if you change the data objects assembly location, you have to change the reference to that assembly in your project accordingly.

Data object classes can only be used with data libraries, they cannot be used in “direct client applications” that do not use data libraries, see Application Configurations.

A data object class is generated for each table in the schema (both for simple and composite tables) and for each table view in every data set in the schema.

A data object class (for example, OrdersRow) contains the following members:

· <field_name> – a property for each table/table view field. Example: OrdersRow.ShipAddress.

· Is_<field_name>Null() – a boolean method without parameters returning True if the value of the field is Null.

· Set_<field_name>Null() – a method without parameters setting the field value to Null.

· Get_<parent_name>Row – a method without parameters returning the single parent row (or null) with regard to a relation in which this table/table view is the child. For inverse (many-to-one) relations, it returns the single child row.

· Get_<parent_name>Rows – a method without parameters returning the array of child rows with regard to a relation in which this table/table view is the parent. For inverse (many-to-one) relations, it returns the array of parent rows.

Using the DataObjectsAssemblyFlags property, setting the StaticNameFields flag (it is set by default for new projects), adds more members to the data object classes. Those are static members returning constant names: field, table, table view and relation names, so that they can be used instead of constant strings in code thus making it compile-time safe (errors detected at compile time), for example:

Northwind.DataObjects.EmployeesRow.FieldNameEmployeeID (field name returning "EmployeeID" for field EmployeeID of table Employees),

Northwind.DataObjects.EmployeesRow.TableName (table name returning "Employees", for table Employees),

Northwind.DataObjects.EmployeesRow.RelationNameEmployees__Orders (relation name returning "Employees - Orders", for simple relation "Employees - Orders")

Northwind.DataObjects.CustOrders.EmployeesRow.TableViewName (table view name returning "Employees", for table view Employees in data set CustOrders),

Northwind.DataObjects.CustOrders.EmployeesRow.FieldNameEmployeeID (field name returning "EmployeeID" for field EmployeeID of table Employees),

Northwind.DataObjects.CustOrders.CustOrdersRow.RelationNameCO__ODP (relation name returning "CO - ODP", for view relation "CO - ODP" between table views CustOrders and OrderDetailsProducts in data set CustOrders).


Action Order and Execution Mode

Action Order and Execution Mode

When handling an event in business logic code, you can perform an action that triggers another business logic event, that in turn is handled and triggers yet another event, and so on. For example, handling a field change event, you can set another field, or perform any other possible action. In most data frameworks, such actions are either blocked or can only be handled in a straightforward way creating uncontrolled recursion. Uncontrolled event triggering leads to complicated situations often creating unintended effects and side effects. Every database developer can recall situations where a harmless code intended to, say, commit a record once certain fields are entered by the end user, either does not work or produces unexpected and often disastrous results.

C1DataObjects solves this problem by allowing the developer to exercise full control over the order of actions performed by business logic code. Various actions, including method calls and field value assignments, can be specified to take place either immediately or after C1DataObjects has completed performing previous actions that are already in the queue, and completed handling the events that are being handled.

When the end user initiates an action leading to a business logic event (for example, sets a field value, or deletes a row), C1DataObjects starts executing it by creating an action context stack. The initial state of this stack is one level with the requested action contained in it. If no actions have been requested by the business logic code while this action was handled, the stack is destroyed. If, however, an action (that itself can trigger a business logic event), is requested while handling this action, the requested action can be processed by C1DataObjects in two different ways:

· Immediate (default): C1DataObjects adds a new level to the action context stack and starts handling this new action. The original action handling is waiting until the new action is handled. This is the “straightforward”, recursive event handling mentioned above.

· Deferred: Alternatively, C1DataObjects can add the requested action to the action queue, to be processed after all actions already in the queue are finished. In this case, C1DataObjects does not do anything with the requested action, it just adds it to the queue and immediately returns, continues to handle the event. The requested action will be processed before C1DataObjects relinquishes control, “in due course”, when the event code has finished executing and all the actions that got to the queue earlier have been processed.

To control the action order, use the ExecutionMode property. Its two possible values, Immediate (default) and Deferred, specify the two modes described above.

ExecutionMode is a read-only property. You never need to set execution mode permanently. You only need to set it for the duration of a certain fragment of code, after which it must be restored to its previous value. Since changing execution mode can inadvertently break your code, we strongly recommend using try-finally blocks to ensure that previous execution mode is always restored.

To set execution mode, call the PushExecutionMode method, passing it the new mode as a parameter. To restore the previous execution mode, call PopExecutionMode.

For example, the following code (taken from Adding Rows and Primary Keys) sets the primary key field in a newly added row immediately after the row has been created.

· Visual Basic

· C#

· Delphi

Although this code would probably work without changing execution mode, doing so would be unsafe, since it would trigger EndEdit before AddNew is completely finished (for example, a grid or another bound control could be not yet notified at that time that a row has been added).

What we really want in cases like this (“after this, do that”) is to emulate end user actions, as if the end user typed the key value after adding a new row, which is essentially what C1DataObjects is doing in the Deferred execution mode.


Application Configurations

Application Configurations

Encapsulating business logic in a data library, C1DataObjects makes it possible to use business objects, developed once, in a variety of application deployment scenarios. In particular, C1DataObjects completely automates the task of developing distributed 3-tier applications, with no special server-based code necessary. C1DataObjects is the only tool for .NET that allows developers to create applications in an easy, uniform way, so that they can be deployed in either 2-tier or 3-tier configurations without changing the application code. In essence, creating fully scalable web-based distributed applications becomes a matter of point-and-click, as easy as creating a simple desktop application used to be in Visual Basic.

Direct Client

Data Library

2-Tier Application

3-Tier Application


Direct Client

Direct Client

Direct client is the simplest configuration where all application components, with the exception of the database server, reside on a single machine and in a single project. It is distinguished from other configurations in that it does not use a data library. Business logic code (components C1SchemaDef, C1TableLogic, C1DataSetLogic) resides in the same project, on the same design surface with the components using the data (C1DataSet components, C1DataView and C1DataTableSource, data-bound GUI controls). There is no separation between the server and the client parts -- they are one and the same application.

In a direct client application, a C1DataSet component resides on the same design surface with the C1SchemaDef component hosting the schema. A C1DataSet component must be attached directly to the C1SchemaDef component by setting its C1SchemaDef property (whereas in other configurations, a C1DataSet is attached to the data library instead, by setting its DataLibrary property). Data-bound GUI controls, such as grids, are attached to a C1DataSet either directly or indirectly (through C1DataView or C1DataTableSource), see How to Access Table View Data and How to Access Table Data.

Direct client configuration is recommended for desktop applications and small 2-tier client-server applications that do not merit encapsulating business logic code in a separate project (data library). Developing a direct client application is very similar to traditional database application development using data controls to connect to the database and bound controls to display the data. It must be understood that a direct client application cannot be easily transformed to a data library; it will need to be re-created (although it may be a simple matter of copy/paste). So, if you have scalability in mind, it may be worth considering a data library from the start.


Data Library

Data Library

C1DataObjects enables developers to define business objects in a separate assembly, data library, so it can be used by multiple applications. Although this is not mandatory, a special team of “data-oriented” developers can be assigned to the task of creating business object projects (data libraries) and another team of “GUI-oriented” developers to creating client applications using data libraries.

A data library project contains

· a schema stored in a C1SchemaDef component, one such component per data library project, see Schema Objects, and

· business logic code, handling the events of business logic components, C1TableLogic and C1DataSetLogic, see Business Logic.

A data library can be used in any project by simply referencing the library in the project and using a C1DataObjects C1DataSet component to connect to the library. All database access and business logic code is encapsulated in the library, so it can be created and maintained independently of client applications.


Creating a Data Library Project

Creating a Data Library Project

Data library projects are created using the C1DataObjects Data Project Wizard. Select File|New|Project in the Visual Studio menu, and in the New Project dialog select ComponentOne Data Library under Visual C# Projects or Visual Basic Projects, according to your language preference.

The main file of the resulting data library project is a component class hosting the schema and business logic. The schema is stored in the C1SchemaDef component. To edit the schema, use the Schema Designer, see Schema Objects. To open the designer, select Schema Designer from the C1SchemaDef component’s context menu.

To attach business logic code to a schema object (table or table view) use business logic components. Business logic components (components C1TableLogic and C1DataSetLogic) have events in which you can write code responding to various occurrences in data objects. Business logic components reside on the same design surface (component class) with the C1SchemaDef component (in large projects, it is also possible to distribute business logic code over multiple files). Only one business logic component is allowed for each schema object: a single (or none) C1TableLogic component for each table and a single (or none) C1DataSetLogic component for each data set in the schema.

To create business logic components, press the right mouse button on the C1SchemaDef component and select Create Business Logic Components from the context menu. This will create a business logic component for each table and each data set in the schema. Alternatively, you can create business logic components manually, from the Toolbox, but in that case you need to set their properties: SchemaComponent = schemaDef to connect them to the schema component, as well as Table and C1DataSetLogic.DataSetDef to specify which schema object each of them represents.

In large data library projects, it may be desirable to use multiple source code files to write business logic code. It can be done using a special C1SchemaRef component. A C1SchemaRef component’s only purpose is to represent the C1SchemaDef component holding the library’s schema when it resides in a different file in the project. Add a new component class file to the project, put a C1SchemaRef component on the design surface and connect it to the C1SchemaDef component selecting its name in the SchemaDef property combo box. Note that working with multiple files using C1SchemaRef, the file with the C1SchemaDef component must be open. Once a C1SchemaRef component is set up, you can add business logic components, C1TableLogic and C1DataSetLogic to the component class file, dropping them from the Toolbox. For each business logic component, set its SchemaComponent property to the C1SchemaDef component and select the table (Table) or the data set (C1DataSetLogic.DataSetDef) represented by the business logic component.

You can attach event code to business logic components either by selecting the components on the designer surface, or using the Business Logic Events toolwindow (select Business Logic Events from the C1SchemaDef or C1SchemaRef context menu to open the toolwindow). The Business Logic Events toolwindow shows the list of all tables and data sets. When you select a table in the toolwindow, the table’s business logic events appear in the Properties Window (in Visual C#, when the Events radio button is selected in the Properties Window; in Visual Basic use the Method Name combo box in the code editor).


Using a Data Library

Using a Data Library

To use a data library in a client application:

· Compile the data library project to produce the data library assembly.

· Add a reference to the data library assembly to the client application project’s References.

· To bind to the data on a client application form, create a C1DataSet component on the form and type the data library name (without the .dll extension) in the DataLibrary property. After that, the list of all data set definitions in the schema becomes available for selection in the DataSetDef property.

· Bind data-aware GUI controls to the C1DataSet either directly or indirectly (through C1DataView or C1DataTableSource), see How to Access Table View Data and How to Access Table Data.


2-Tier Application

2-Tier Application

If you set up a client application exactly as described in Using a Data Library, it will work as a 2-tier application. Note that to make it 3-tier, only one additional step is necessary: setting the DataLibraryUrl property. For more information, see 3-Tier Application.

In a 2-tier application deployment configuration, a client application and the data library reside on the same machine, and there is no other computers involved except possibly a database server.

C1DataSet components belonging to the client application interact with the data library. They request data from the data library on Fill and send modified data to the data library on Update. Responding to these requests, the data library sends data requests to the database server, which can reside on the same or on different computer, according to the ConnectionString specified in the schema.

The client application fires business logic events in the data library. For example, when the end user modifies a field value in a grid, the C1DataSet component (to which the grid is bound with its DataSource/DataMember properties) calls the data library, and the BeforeFieldChange event is fired, handled by business logic code inside the data library.


3-Tier Application

3-Tier Application

In contrast with standard ADO.NET and other frameworks, you can turn a C1DataObjects application into a distributed 3-tier application without additional coding. With C1DataObjects, it is a simple matter of deployment. C1DataObjects uses the following mechanism to enable 3-tier configuration:

You use the same data library assembly in both 2-tier and 3-tier configurations. The only difference is that when your application wants to use the data library assembly in a 3-tier configuration, it signals this intent by setting the DataLibraryUrl property to a server location, a URL where the same data library assembly is installed and ready for invocation on a remote server. For example:

dataSet1.DataLibraryURL: http://www.mycompany.com/mydatalibrary/ThreeTierServer.soap

Your client machine already has the data library assembly, since it is used by your client application, included in its project’s References. This is the data library your client application talks to.

When your application requests data (Fill), the request first goes to the client data library. Knowing the URL, the client data library invokes the data library on the server (server data library) passing it the request for data. Note that both client and server run the same version of the data library assembly that is ensured by Microsoft. NET remoting support. The server data library retrieves data and sends it to the client, where the client data library receives it and exposes it to the client application.

When your application updates the database, sends modified data to the database, the client data library takes the modified data, packages it and sends to the server data library for update. The server data library reconstructs the data set on its end, so that business logic code can work properly, see Update in 2-Tier and 3-Tier Configurations, and updates the database. Then it sends the refreshed data retrieved from the database back to the client.

So, the process involves two running instances of a data library: one on the client and one on the server. Developing a data library, you do not have to be concerned with interaction between these two instances. You do not need to write two different programs for the server and for the client, because the server and the client use the same assembly built from the same data library project. C1DataObjects handles the interaction automatically and transparently for the developer.

If you need to know, in data library event code, which instance is currently running, the client or the server one, this information can be obtained from the RunsAt property.

Most business logic events are handled on the client, by the client data library instance. For example, when the end user modifies a field value in a grid, the C1DataSet component (to which the grid is bound with its DataSource/DataMember properties) calls the client data library, and the BeforeFieldChange event is fired and handled by business logic code inside the client data library. However, update business logic events, BeforeUpdate, BeforeUpdateRow, AfterUpdateRow and AfterUpdate are handled by the server data library, see Update in 2-Tier and 3-Tier Configurations.


Configuring the Data Library on the Server

Configuring the Data Library on the Server

To deploy your application as a 3-tier distributed application, you need to make your data library on the server available for invocation by clients, to publish it at the DataLibraryUrl location. You can use any remote invocation mechanism supported by .NET Remoting. The most popular one is the web service, where the published assembly is placed under IIS (Internet Information Server) control and made available by creating an IIS virtual directory. In this case, remoting uses an HTTP channel and the SOAP protocol. Deploying your data library under IIS, you use a configuration file. A configuration file web.config for IIS deployment can look, for example, as follows:

<configuration>

<system.runtime.remoting>

<application>

<service>

<wellknown mode="Singleton" type="Northwind.RemoteService, Northwind" objectUri="ThreeTierServer.soap" />

</service>

</application>

</system.runtime.remoting>

</configuration>

Northwind is the name of your data library assembly.

Northwind.RemoteService is the full name of a class in your data library derived from C1.Data.RemoteDataService. The C1DataObjects Data Project Wizard generates this class automatically. This class is necessary for C1DataObjects remoting support. By default, it is empty, just derives from C1.Data.RemoteDataService. If necessary, it can be used for configuring C1DataObjects remoting on the client, see below.

ThreeTierServer.soap is the URI (arbitrary string) used to form the DataLibraryUrl string, for example, http://www.mycompany.com/mydatalibrary/ThreeTierServer.soap, where mydatalibrary is the IIS virtual directory containing the data library assembly

Although IIS deployment is the most common, it is by no means the only option. You can host the server instance of your data library in any server host available for remote invocation via .NET Remoting. For example, Tutorial 3 shows how to host it in a Windows application running on the server. Instead of HTPP channels used by web services, Tutorial 3 uses a TCP/IP channel. The flexibility of C1DataObjects remoting mechanism is based on the fact that there is nothing C1DataObjects-specific in hosting and configuring a data library on the server; it is all based on the standard .NET Remoting. Use whatever server deployment option and configuration you find necessary, as long as it exposes an object derived from C1.Data.RemoteDataService (Northwind.RemoteService in the example above) as a well-known object type in Singleton mode (see .NET Remoting documentation for a detailed description of well-known objects and activation modes). To register an object type, you can call the RemotingConfiguration.RegisterWellKnownServiceType method (namespace System.Runtime.Remoting), or use a configuration file (in IIS deployment configuration file is the only option).

Normally, C1DataObjects remoting does not need configuring on the client. However, if you use a custom remoting configuration on the server that requires configuring the client, you can do that using the ConfigureClient method of the C1.Data.RemoteDataService class. As noted above, in order to allow 3-tier deployment, your data assembly needs to derive a class from C1.Data.RemoteDataService. You can override the virtual ConfigureClient method in that class. The method is called once for the client data library, to give you an opportunity to execute whatever code you need to configure remoting on the client. Another RemoteDataService method that can be used for configuring client is ConfigureProxyObject that is called every time the client creates a proxy object for calling the server. Overriding the ConfigureProxyObject virtual method you can configure remoting on a per-call basis, for every proxy object created, if that is necessary.


Security Considerations

Security Considerations

Authentication in IIS Deployment

By default, C1DataObjects client uses HTTP channels for its communications with the server. HTTP channels have built-in authentication and authorization support in .NET remoting. If you deploy your server data library in IIS, you can rely on IIS and .NET remoting security support. You can configure your server data library in IIS for whatever authentication methods you prefer, including Integrated Windows Authentication (recommended), Basic authentication, anonymous access, etc. You can also use Secure Sockets Layer (SSL) to encrypt all messages by using the “https://” protocol in your DataLibraryUrl. Summarizing, you do not need to write special code for security authorization if you use default configuration, which is deploying server data library in IIS. There is only one programmatic feature you may need in this case; this is how to specify user credentials (domain, username, password):

By default, the C1DataObjects remoting channel uses the default user credentials (domain, username, password) when it calls the server. Sometimes you may need to make calls on behalf of a specific user. For example, you may use an authentication scheme on the server that is different from one used on the client, and your client application may ask the user for credentials to pass to the server. In this case you will need to tell C1DataObjects to use these credentials communicating with the server. This can be done using the Credentials property of a C1DataSet object, for example:

· Visual Basic

· C#

· Delphi

If the Credentials property is set, every call from the C1DataSet component to the server, filling the component with data or sending its updates to the database, will use the supplied credentials.

Authentication with Custom Channels

If you have special security needs, such as a custom authorization mechanism or a custom transport encryption, you can customize the channels as described in Configuring the Data Library on the Server. You can use all the power and flexibility of .NET Remoting to add your own security support and other features to the remoting channel. If you use custom channels, take into account that only HTTP channels have built-in authorization support in .NET remoting, TCP/IP channels do not have such support out of the box.

Database Access Authorization and Connection Strings

Another aspect of application security with C1DataObjects is database access authorization. Security information, such as username and password for database access is included in ConnectionString in the schema, and the schema is included in the client application. There are two options of securing this information:

· You can use Windows Integrated Security, in which case security information is not stored in the connection string, current user credentials are used for database access authorization.

· If you have to specify username and password in the connection string, do not store them in ConnectionString at design time. Use the User name and Password edit boxes in the Schema Designer to send credentials to the database at design time. At run time, add User ID and Password attributes to the ConnectionString in code, in the CreateSchema event that is fired before any database access is performed on the server.

You may also need to change the ConnectionString on the server for purposes other than security. For example, you can route calls to different database servers. You can do that in the same way, using the CreateSchema event on the server to set the ConnectionString property of Connection objects in your schema. This method changes ConnectionString permanently, for all calls from all users.

If you need to set ConnectionString on a per-call basis, you can do it overriding virtual methods in the RemoteDataService-derived class implemented in your data library, see Configuring the Data Library on the Server. Override virtual methods GetData and Update, which are the methods that are called by the client, to set up connections for the duration of a call. The RemoteDataService class has a Connections property holding a ConnectionCollection which is empty by default. If you add a Connection object to this collection and set its Name to the name of a schema connection, that Connection object will be used instead of the schema connection. Since a new RemoteDataService object is created for each call, this connection substitution works on a per-call basis.


Virtual Mode - Dealing with Large Datasets

Virtual Mode – Dealing with Large Datasets

With an innovative virtual mode technology, C1DataObjects allows you to use large datasets, unlimited in size, in .NET Windows Forms applications. This feature is not supported in Visual Studio .NET and ADO.NET without C1DataObjects.

Understanding Large Data Sets

Table Views in Virtual Mode

When a Virtual Table View Fetches Data Segments

Virtual Mode in Distributed 3-Tier Applications

Using C1DataTableSource and Bound Controls

Asynchronous Fetch Modes

Sorting Data in Virtual Mode

Virtual Mode Restrictions

Virtual Mode Performance Tuning


Understanding Large Data Sets

Understanding Large Data Sets

Visual Studio .NET and its underlying data engine, ADO.NET support only one mode: disconnected access to data. An ADO.NET data set is always pre-fetched in its entirety from the server to the client. Since it is often not practical to pre-fetch large data sets over the wire, this creates two serious problems:

· Even distributed web applications often include large data sets, such as, for example, a list of available products and other data originated in database tables with thousands records and more. It is very inefficient and in many cases impossible to transfer such data from server to the client in its entirety. This forces developers to produce makeshift solutions (such as asking the user to enter a few initial letters of the product name before showing the list of products) severely reducing the quality of end user experience, application performance and scalability.

· The absence of large data set support makes it effectively impossible to develop classic client-server and desktop database applications in Visual Studio .NET without C1DataObjects. A popular belief is that you only need large data sets if you have not designed your application correctly. This is a misconception. The real problem is the lack of tools supporting the right data access modes. Another popular misconception is that disconnected model (also referred to, somewhat loosely, as “web application”, “3-tier application”, etc) necessarily means pre-fetching all the data from the server to the client at once, that any other approach is necessarily the old “live connection per user” that is not scalable.

C1DataObjects fills this gap, offering a solution to the problem of large data sets. It gives you the tool to achieve the best of both worlds, to have data access that is both disconnected (no live connection is maintained on the server for particular users) and therefore scalable, and at the same time, unlimited in data size.

To use a large data set in C1DataObjects is as easy as to set a property, DataAccessMode (you also need to use C1DataTableSource as your data source if you need to bind GUI controls in virtual mode, see Using C1DataTableSource and Bound Controls).


Table Views in Virtual Mode

Table Views in Virtual Mode

One or more table views in a schema can be specified to function in virtual mode by setting their DataAccessMode property to Virtual, VirtualUnlimited or VirtualAutomatic. We will call them virtual table views. For now, we will consider only Virtual mode. The other two, VirtualUnlimited and VirtualAutomatic, are variations that will be discussed a little later, in Asynchronous Fetch Modes.

A virtual rowset can contain an unlimited number of rows. For example, Tutorial 4 demonstrates a rowset containing 2.7 million rows that is available on the client with limited memory consumption and startup time of about three seconds.

When data is fetched from the database, a virtual table view fetches only an initial chunk (segment) of data. It can fetch other data segments from the server later, on its own accord, transparently to the user. Segment fetch is triggered by the end user repositioning to a row close to the end of the current segment, see When a Virtual Table View Fetches Data Segments.

At any given time, a virtual table view contains and exposes to the user a single contiguous segment of data, the current segment. The size of a data segment is specified by the VirtualSegmentSize property (default: 400 rows). The data exposed to the user in the C1DataTable object and in GUI controls bound to the virtual table view, is exactly the current segment, other segments (that may be fetched from the server, see When a Virtual Table View Fetches Data Segments) are kept internally and not exposed.

A virtual table view also maintains a segment cache containing a limited number of segments (controlled by the VirtualSegmentCount property, default: 4). The cache is inaccessible to the user. It is used internally for optimization, to avoid roundtrips to the server when possible.

Although a virtual table view exposes only one segment of data at a time, it automatically and transparently maintains continuity. So, for example, if the end user presses the PageDown key in a bound grid, or uses the MoveNext method to go beyond the current segment bounds, C1DataObjects will automatically adjust the current segment, fetching data from the server, if necessary, so the user will not notice the segment change. Fetching data and changing the current segment is done automatically, so the user perceives it as a continuous large rowset. Moreover, C1DataObjects uses a background asynchronous fetch technique to make fetching data from the server as much imperceptible to the user as possible, see When a Virtual Table View Fetches Data Segments.

If you navigate through a virtual table view using a bound grid, or programmatically using MoveNext and other methods of C1DataTableSource, the virtual rowset appears as a large continuous rowset. But it contains only one segment at a time on the client, so, if you use the C1DataTable object to access its data, you will see only limited number of rows.

Virtual mode table views fully support data modification. Modified rows are always visible, always kept in the current segment, and always accessible through the C1DataTable object (until Update, AcceptChanges or RejectChanges) -- even if they were originally fetched in other segments.


When a Virtual Table View Fetches Data Segments

When a Virtual Table View Fetches Data Segments

This section describes optimization techniques used in C1DataObjects to make fetching data from the server transparent and largely imperceptible to the user. It has no effect on the formal functionality, so you can skip it if you are not interested in this description.

When the end user navigates through the current segment, they usually position on rows belonging to the current segment. In fact, it is impossible to position on any other row, except by using a C1DataTableSource that has special methods for navigating the whole virtual rowset, or by using the scrollbar of a bound grid control to position to the end or the beginning of the rowset, if it is not covered by the current segment.

When the user positions on a row that is out of bounds of the current segment (this can be done only with C1DataTableSource or with a bound grid going to the end of the rowset), C1DataObjects looks for the required segment in the cache and, if not found, fetches it from the server. After that, the new segment becomes current.

In order to optimize segment fetch performance, C1DataObjects also performs a “preemptive” asynchronous fetch when the user positions to a row that is inside the current segment but “dangerously” close to its boundary (the closeness threshold determined by the VirtualSyncThreshold and VirtualAsyncThreshold properties):

· If it is “very close” to the current segment boundary (determined by the VirtualSyncThreshold property), C1DataObjects fetches the required segment (one that has the current row in the middle rather than near the end) immediately, suspending all other activities (synchronously). When the segment is fetched, it becomes current.

· If it is “not so close” (determined by the VirtualAsyncThreshold property), C1DataObjects starts the fetch process in a separate thread, so it is performed in the background, without interrupting other activities (asynchronously). When the segment is fetched, it is placed in the cache, but not made current. The segment is prepared in case it will be needed when the user moves closer to the current segment boundary.

These techniques provide for the following transparency and optimization behaviors:

· Database fetch and segmentation are transparent to the user. The rowset is presented to the user in its entirety, appears to contain all rows regardless of whether they belong to the current segment or not. Any part of it, including the end of the rowset and any given row specified by a primary key value (see C1DataTableSource Seek) is available to the user.

· Database fetches are optimized with a heuristic “preemptive” background fetch technique. If the end user navigates through the rowset slowly enough to allow the optimization to work, segment changes occur without delays, as if the data were already on the client. A jump to a specified position in the rowset (e.g., using the C1DataTableSource Seek method) occurs with a delay necessary to fetch the data from the server, but that delay only occurs if the specified position is far enough from any cached segment.


Virtual Mode in Distributed 3-Tier Applications

Virtual Mode in Distributed 3-Tier Applications

C1DataObjects fully supports virtual mode in distributed 3-tier applications. See Application Configurations for the description of C1DataObjects support of distributed 3-tier applications. To create a 3-tier application in C1DataObjects you do not need to write any additional code. It is just a matter of changing a property and deploying your data library on a server. Likewise, you do not need any special adjustments or coding to make virtual mode work in a 3-tier application. C1DataObjects virtual mode is always 3-tier-ready.

C1DataObjects does not maintain a live database connection on the server for the lifetime of a virtual table view on a client. The server uses the connection only to serve client requests for data, at which point it fetched a limited amount of rows (a segment), sends the data to the client and forgets all about this client request, disposes of the query result and closes the database connection (due to OLE DB connection pool optimization, the connection may remain open for some time to allow its effective reuse in subsequent requests). So, C1DataObjects uses a stateless, scalable server technology, the same as ADO.NET, both in regular mode (DataAccessMode = Static) and in virtual mode.

Combining its innovative virtual mode and 3-tier technologies, C1DataObjects makes creating sophisticated, fully scalable web-based distributed 3-tier applications a matter of point-and-click, as easy as creating a simple desktop application always used to be in Visual Basic. In fact, the developer of an application can be totally unaware of all these concepts and work as in classic client-server (or even desktop) environment. C1DataObjects makes it possible to take such application and turn it into a distributed one by a simple change of a few property settings. This is the real scalability of an application development framework.

Without full understanding of the trade-off between scalability and large data sets, a skeptic, when critiquing C1DataObjects virtual mode, can say: "OK, but that is yesterday's technology. For this type of virtual mode you need a permanent live database connection on the server for each user, so it is necessarily unscalable, it is classic client-server (2-tier) as opposed to the latest and greatest disconnected mode, which is distributed, web-based, 3-tier, and so on and so forth". This argument is wrong and is a common misconception. These are two entirely different things:

(a) One can have a live connection on the server for each user, as in classic client-server (non-scalable, bad) as opposed to a stateless server that connects on demand, as in ADO.NET (scalable, good), and

(b) One can have all data fetched at once, as in ADO.NET (bad) as opposed to data fetched on demand, as in virtual mode (good).

So, ADO.NET is good in (a) and bad in (b). Some people wrongly assume that being good in (a) necessarily means being bad in (b). That is a misconception, and C1DataObjects virtual mode proves it. There is one qualification, though: If you consider arbitrary SQL, then yes, you cannot be good in (a) and (b) simultaneously since you need a live connection. But that is only for complex SQL statements, with GROUP BY, subqueries and other advanced features that are rarely if ever used in GUI front-ends. C1DataObjects virtual mode does not support full SQL (it does not support SQL-based and unbound tables, see Bound, SQL-Based and Unbound Tables). It supports only common cases (bound tables). This restriction together with sophisticated caching and optimization techniques allow it to be good both in (a) and in (b).


Using C1DataTableSource and Bound Controls

Using C1DataTableSource and Bound Controls

In order to access a virtual table view data, both programmatically and via data binding, you need to use a C1DataTableSource. This component serves two goals:

· It allows you to handle business logic events in your client application code, in addition to the business logic specified in the data library, see Business Logic for details, and

· It enables virtual mode in bound controls.

A C1DataTableSource is attached to a data set by setting its DataSet property, and to a table view in that data set by setting its TableView property. Thus attached to a table view, a C1DataTableSource can be used as a DataSource for bound controls.

If you use another data source for your bound controls (if you bind them directly to the C1DataSet or to a C1DataView), then virtual mode will not work properly, C1DataObjects will not fetch segments on row repositioning, so the only data available will be the first fetched segment. Binding your controls to a C1DataTableSource attached to a virtual table view enables virtual mode in the bound controls.

C1DataTableSource also provides methods and properties for programmatic access to a virtual table view allowing navigation of the entire virtual rowset:

MoveFirst | Positions to the first row.
MoveLast | Positions to the first row.
MoveNext | Positions to the next row after current.
MovePrevious | Positions to the previous row before current.
Seek | Positions to a row specified by its primary key value.
CurrentRow | Returns the current row C1DataRow object.

You can bind any data-aware GUI controls to a C1DataTableSource, but there is one important consideration: In multi-record data-bound controls, such as grids, special functionality is required to make the scrollbar behave correctly in virtual mode. ComponentOne grid controls included in the ComponentOne Studio for .NET (ComponentOne FlexGrid and ComponentOne True DBGrid) include this functionality and fully support C1DataObjects virtual mode. Therefore, if you need a grid control in virtual mode, we strongly recommend using one of the ComponentOne grid controls. You do not need to purchase them separately, since they are provided together with C1DataObjects in ComponentOne Studio for .NET.

Other grid controls, such as the standard DataGrid control, work with C1DataObjects virtual mode too, but with one restriction: if you go to the end of the rowset using the scrollbar, the grid will show the end of the current segment, not the real end of the virtual rowset. Other than that, C1DataObjects virtual mode works with any bound controls without restrictions. For instance, if you position to the last row of the segment (or close to the last row), C1DataObjects will fetch more rows and the grid will show them. So, if this peculiarity in scrollbar behavior does not concern you, you can use the standard DataGrid and third-party grid controls with C1DataObjects virtual mode.


Asynchronous Fetch Modes

Asynchronous Fetch Modes

DataAccessMode = Virtual is recommended for especially large table views that not only take too much time to fetch, but also would consume too much client memory if fetched entirely to the client. In many cases the situation is somewhat different: the rowset is too large to be pre-fetched to the client at startup, that would take too much time, but it is small enough so all rows can be gradually brought to the client and stored there. For such situations, C1DataObjects supports two more virtual modes: VirtualUnlimited and VirtualAutomatic (DataAccessMode = VirtualAutomatic is more common, it is usually more suitable than VirtualUnlimited).

Data access mode Virtual means that data is fetched in chunks (called segments) of limited size (the size of each segment is determined by the VirtualSegmentSize property, default: 400), and the number of segments cached at the client at any given time is limited (this number is determined by the VirtualSegmentCount property, default: 4). Mode Virtual works for rowsets of virtually unlimited size, for example, in Tutorial 4 we demonstrate how it can be used to display 2.7 million rows in a grid.

Data access mode VirtualUnlimited is similar to Virtual in that data is fetched in segments, but the number of segments in the cache is unlimited, the VirtualSegmentCount property value is ignored. Once a segment is brought into the cache, it remains there. This setting is appropriate when you want to enhance performance by eliminating redundant roundtrips to the server, but it should not be used with very big rowsets if the user is expected to fetch too many segments into memory.

In VirtualAutomatic mode, data is fetched in segments, as in the previous two modes, and the number of segments in the cache is unlimited as in VirtualUnlimited mode, and, in addition to that, fetch is continually performed in background mode, asynchronously, until all data is fetched. This mode is appropriate for large rowsets that are big enough to make it undesirable to fetch all data at startup time, but not too big, so they still fit in client memory. This mode is additionally qualified by a boolean VirtualConsolidateRows property. If it is set to True (default), then C1DataObjects will rebuild the rowset when fetch is complete. While fetch is incomplete, Rows contains only rows of the current segment. Once fetch is complete, Rows contains all fetched rows, the whole rowset. In the other two virtual modes, Rows always contains only rows of the current segment.

The VirtualAutomatic mode is similar to the asynchronous fetch feature of ADO, the OLE DB-based data access framework used in Visual Studio 6. ADO.NET does not support asynchronous fetch, so C1DataObjects VirtualAutomatic mode is useful for developers that need this feature in .NET environment. Moreover, the C1DataObjects VirtualAutomatic mode is superior to the ADO asynchronous mode in one important aspect: the whole rowset up to the last row becomes accessible to the user immediately. The user does not have to wait until the fetch is complete to access the last row or any other row of the rowset. If, for example, the user positions to the last row while fetch is in progress, C1DataObjects will immediately fetch the last segment and display it to the user, without waiting for the background fetch to reach the end of the rowset.


Sorting Data in Virtual Mode

Sorting Data in Virtual Mode

C1DataObjects supports sorting data in virtual mode, specified either at design (TableView.FillSort) or at run time (FillSort). However, sorting data in virtual mode will only have good performance if corresponding index exists in the database. An index is usually necessary for the database SQL optimizer to produce an efficient execution plan for a statement with ORDER BY.

In the Schema Designer, sort order is specified for a virtual mode table view by setting its FillSort property. If you specify TableView.FillSort for a table view in virtual mode, that sort order must form a unique key (there is no such requirement for table views in static mode). If FillSort does not represent a unique key, a run time exception will occur when two different row with equal key values are fetched. You can always ensure uniqueness of a sort order by adding primary key fields in the end.

If no TableView.FillSort is specified for a table view in the schema, primary key order is used as the default sort.

It is also possible to specify sort order for a table view at run time. To change sort order of a table view at run time, call C1DataSet.Fill with a filter condition and a list of table view names containing the name of the table view in question. Specify FilterCondition.FillSort for the table view in one of the filter conditions. This FillSort string will override TableView.FillSort specified in the schema. This FillSort string must satisfy the same uniqueness requirement as TableView.FillSort specified in the schema. This FillSort string must satisfy the same uniqueness requirement asFillSort. In C1DataExpress, use FillSort property to specify sort order. To change sort at run time, set FillSort and call Fill.


Virtual Mode Restrictions

Virtual Mode Restrictions


Necessary Requirements for Virtual Mode

Necessary Requirements for Virtual Mode

The following requirements must be satisfied for a table view to function properly in virtual mode:

· Only bound tables are allowed. Unbound and SQL-based tables cannot be used in virtual mode. See Bound, SQL-Based and Unbound Tables.

· The table must have primary key, see Table Properties.

· An appropriate index must exist in the database for the specified sort order. More exactly, this is not a necessary condition, but virtual mode can have very poor performance if the index does not exist. An index is usually necessary for the database SQL optimizer to produce an efficient execution plan.

· The database must have sufficiently advanced query optimization capacity to interpret SQL statements issued by C1DataObjects in the optimal way, the way they intended to be interpreted. Microsoft SQL Server and Oracle satisfy this requirement, whereas Microsoft Access, being a low-end desktop database does not qualify. C1DataObjects virtual mode works correctly with Microsoft Access, but queries fetching data may take a long time to execute on the server. SQL statements generated by C1DataObjects in virtual mode look approximately like this:

SELECT TOP 400 FROM T WHERE K1=? AND K2>? ...ORDER BY K1, K2,…

where K1, K2 – primary keys. You can see the actual generated SQL statements in the AfterGenerateSql event.

· The database must support the TOP n keyword in SQL limiting the resultset to the first n rows. An exception to this is Oracle, which does not support TOP n, but works with C1DataObjects virtual mode, because C1DataObjects uses a different construct with Oracle: the hint /*+ FIRST_ROWS */. To distinguish Oracle from other databases, the Syntax enumerated property is used, available in the Connection editor in the Schema Designer.

· Primary key types must be ordered and comparable, that is, the > comparison operation must be applicable to them. All common SQL data types satisfy this requirement.

· If you use filter conditions with virtual table views, the conditions added to the WHERE clause of the generated SQL statement should not break query optimization. Basically, it means that if you restrict the sort order key values by filter conditions, try to restrict only an initial segment of the sort order key sequence. Avoid situations where a key is restricted and one of its predecessors in the sort order key sequence is not. This is not a mandatory requirement. Virtual mode will work correctly regardless of filter conditions. However, with very large rowsets, filter conditions breaking optimization can significantly affect performance.


Functionality Restrictions in Virtual Mode

Functionality Restrictions in Virtual Mode

Some C1DataObjects features change their behavior or are unavailable in virtual mode:

· The C1DataTable object of a virtual table view does not contain all rows of the virtual rowset. It contains only the rows of the current segment. To access all virtual rowset rows, use the C1DataTableSource methods and properties, see Using C1DataTableSource and Bound Controls.

· View relations having a virtual table view as the parent or a child do not return all child (parent) rows, they return only rows belonging to the current segment. This is simply because not all rows are fetched to the client.

· Binding GUI controls to a virtual table view, you have to use a C1DataTableSource as their data source, see Using C1DataTableSource and Bound Controls.

· If you need a grid control bound to a virtual table view, use a ComponentOne grid control included in ComponentOne Studio for .NET, either True DBGrid or FlexGrid, see Using C1DataTableSource and Bound Controls.

· Scrollbar position in a grid bound to a virtual table view does not represent row number in the whole rowset, it represents row number in the current segment. This also causes the scrollbar thumb jumping from near the end to the middle of the scrollbar area when current segment changes. However, the scrollbar functions properly when clicked and dragged, including dragging to the end and the beginning of the rowset.


Virtual Mode Performance Tuning

Virtual Mode Performance Tuning

The TableView schema object has several properties controlling performance parameters in virtual mode. In most cases, they can be left at their default values. However, you may want to try tuning them if you feel a need to improve performance.

VirtualSegmentSize | Number of rows fetched from the database and exposed to the user as a segment of the rowset. Default: 400. This is the minimum segment size. C1DataObjects can fetch more rows in a segment if necessary. That can happen if a grid with large number of rows is bound to the table view. With a bound grid, C1DataObjects always maintains the state where the first and last rows visible in the grid are on the “safe” distance from the ends of the current segment, the “safe distance” defined by the VirtualSyncThreshold property. Therefore, the segment size is always greater than the number of visible rows in the grid plus twice the threshold value.
VirtualSegmentCount | Maximum number of segments in the cache (only for DataAccessMode = Virtual).
VirtualSyncThreshold | Percent value from 0 to 100 (default: 12%). Determines the distance (number of rows) to the end of a segment that is considered a “danger zone”, in the sense that the current segment must be changed to another segment (taken from the cache or fetched from the database) when the user positions on a row inside that zone. By default, it is 12% of 400 = 48 rows. See When a Virtual Table View Fetches Data Segments for details.
VirtualAsyncThreshold | Percent value from 0 to 100 (default: 30%). Determines the distance (number of rows) to the end of a segment that is considered a “preemptive fetch zone”, in the sense that a new segment must be fetched from the database (if not found in the cache) when the user positions on a row inside that zone. By default, it is 30% of 400 = 120 rows. See When a Virtual Table View Fetches Data Segments for details.


Updating the Database

Updating the Database

Transparency of database updates is one of the main power features of C1DataObjects. C1DataObjects solves the problem of updateable views and performs database updates automatically. For more information, see How the Data is Modified. Developers do not have to write server-side code updating the database. C1DataObjects can achieve this because it stores data internally preserving the original database structure, so it always knows what modifications must be applied to every database table. For more information see Structured Data Storage: Tables and Table Views and How the Data is Modified.

Although you can rely on C1DataObjects to perform database updates and do not have to write code, it is important to understand how the process of updating the database works. It may require customization for special application needs, and it is often necessary to specify business logic code resolving potential conflicts when different users concurrently modify the same data.

Before updating the database, C1DataObjects collects all modified simple table rows and sends them to the server for update (commit). Note that simple table modifications are sufficient for the update process. Composite tables and table views do not participate in update. Every data modification made by the end user ends up in a specific simple table, modifying a certain simple table row. Knowing the data structure, C1DataObjects tracks all modifications to their destination simple table rows, so in the end only simple table rows must be sent to the server for update. For more information, see Structured Data Storage: Tables and Table Views and How the Data is Modified.

For instance, considering the Customer-Orders-Employees example in Structured Data Storage: Tables and Table Views, the user could modify some rows of the CustOrders composite table (for example, using a grid control showing the combined customer-order-employee information), and also add and delete some rows. Since CustOrders is a composite table, it means that some Customers rows could have been modified, as well as some Orders and some Employees rows. Also, other modifications to these simple tables can be made in the same session as well, via other table views. All these modifications are just modified rows of the simple tables. Therefore, C1DataObjects already knows what database table rows must be modified, added or deleted to commit this transaction. It goes to the server and does just that, applies the modifications to the database tables Customers, Orders and Employees. The rest of this chapter will be devoted to the process of applying modifications to database tables.

When the Database is Updated

Update in 2-Tier and 3-Tier Configurations

Update Process on the Server

Generated SQL Statements

Events in Updating a Row

Changing Data as a Result of Update (Refresh)

Updating SQL-Based and Unbound Tables

Controlling the Update Process

Handling Errors in Update

Handling Concurrency Conflicts

Handling Update Errors on the Client


When the Database is Updated

When the Database is Updated

By default, C1DataObjects works in batch update mode, standard in distributed applications (this is the only update mode available in ADO.NET). Database update is performed on explicit command from the user or application code, a special method call, when the user presses a button, for example. This method is Update. Between Update calls, data modifications done by the end user are cached on the client, in the C1DataSet object. The end user can freely navigate between data rows, modifying them. Multiple rows can be in a modified state at the same time. Batch update mode is the only update mode supported by ADO.NET and the standard .NET Windows Forms framework.

C1DataObjects also supports the classic automatic update mode. This mode, common in classic client-server and desktop applications, ensures that all changes made in the current row are committed to the database when the end user leaves this row and moves to another row in a table. This mode is not supported in ADO.NET and standard Windows Forms data binding. C1DataObjects adds yet another enhancement to the .NET data framework by implementing the automatic update mode. If you use C1DataTableSource as your data source, and set its UpdateLeavingRow property to True, it will perform update automatically when the end user leaves a row after modifying it.


Update in 2-Tier and 3-Tier Configurations

Update in 2-Tier and 3-Tier Configurations

When C1DataSet.Update is issued on the client, C1DataObjects first collects all modified simple table rows. Further processing depends on whether it is a 2-tier or a 3-tier configuration, see Application Configurations:

· In a 2-tier client (classic client-server configuration, that we also call a direct client), the client itself performs database updates. It generates SQL statements updating the database and sends them to the database server for execution. If you need to customize the update process, your business logic code can handle the C1TableLogic BeforeUpdate/C1TableLogic AfterUpdate events. These events fire for each modified row. The C1DataRow object passed to the event handler is a modified data row of the same client data set.

· In a 3-tier configuration (distributed application), there are two identical instances of your data library participating in the process: one on the client and one on the server, see Application Configurations for details. An update request on the client sends the modified rows to the server. On the server, the server instance of your data library (having the same business logic code) takes over. It reconstructs a data set from the modified rows and then performs the update: generates SQL statements updating the database and sends them to the database server for execution. If you need to customize the update process, your business logic code can handle the C1TableLogic BeforeUpdate/C1TableLogic AfterUpdate events. These events fire for each modified row. The C1DataRow object passed to the event handler is a modified row received from the client. It belongs to a C1DataSet reconstructed on the server (we call it the server data set). The server data set does not include all rows that were originally fetched to the client. It only includes modified rows and those related to them through relations. Other than that, the structure of this data set is identical to the client data set. The server data set exists for the duration of serving the update request.


Update Process on the Server

Update Process on the Server

Both in 2-tier and in 3-tier configurations, each update request is executed as a database transaction, that is, either all changes are successfully committed to the database or no changes are committed to the database. If a schema contains multiple database connections, a separate transaction is used for each database connection, all the transactions committed or rolled back together when all updates are done.

For each modified simple table, C1DataObjects applies updates in a certain order: it processes added rows first, then deleted rows, followed by modified rows. So, it first inserts rows that must be added, and then deletes rows that must be deleted, before modifying rows that must be changed. For each row involved, C1DataObjects applies the update by executing a generated SQL statement (in case of a bound table), see Generated SQL Statements. This cycle repeats for each simple table whose rows must be updated.

After a successful update, the updated and added rows are retrieved from the database to refresh the data according to the latest database state. This is necessary because the database can change the data, set default values, etc. The process of refreshing rows after update can be customized with properties and events as well as the update process, see Generated SQL Statements and Changing Data as a Result of Update (Refresh).


Generated SQL Statements

Generated SQL Statements

When updating a row of a bound table, that is, a simple table with non-empty Connection and DbTableName properties, C1DataObjects generates and executes a SQL statement. Generated SQL statements are described in the following sections for each of the three possible cases: inserting, deleting and modifying rows. SQL statements are not generated for unbound and SQL-based tables, see Updating SQL-based and Unbound Tables.

The update process consists of three phases:

· locating the record in the database,

· changing (updating) the record, and

· refreshing the row, that is, retrieving the changed record from the database, as it could be changed by database own logic (triggers, etc).

Row DELETE has only locate and change phases, no refresh. Row INSERT has only change and refresh phases, no locate. Row UPDATE has all three phases: locate, change and refresh. The locate and change phases are performed in one SQL statement, locate being the condition in its WHERE clause, change – the action clause (INSERT/DELETE/UPDATE). The refresh phase is performed by a separate SQL SELECT statement finding a single record by its primary key value.

Generated SQL statements contain parameters specifying values used to locate the record in the database and values to assign to record fields. Parameter values are determined by the original and current values in the C1DataRow object:

Parameters used to locate the record are assigned the original field values, that is, the values as they have been fetched from the database before the user could modify them:

row[“field_name”, DataRowVersionEnum.Original]

Parameters used to set values of record fields are assigned the current values of the row:

row[“field_name”, DataRowVersionEnum.Current]

The generated parameterized SQL statement is used to set up and execute an IDbCommand object (for OLE DB: .NET Framework class System.Data.OleDb.OleDbCommand, for native SQL Server connection: System.Data.SqlClient, etc). If necessary, this IDbCommand object can be customized in event code, see Events in Updating a Row.

Executing generated SQL statements is the default processing. It can be customized or substituted altogether with custom code using the BeforeUpdateRow, AfterUpdateRow events, see Events in Updating a Row.


Deleted Row

Deleted Row

To delete a row from the database, C1DataObjects generates and executes the following SQL statement:

DELETE FROM table_name WHERE field1 = ? AND field2 = ? AND …

Parameter values are set to original row values: row[“field_name”, DataRowVersionEnum.Original].

If the original value of a field is Null, the condition is field IS NULL instead of field = ?.

The collection of fields used to locate the record in the WHERE clause depends on the table property UpdateLocateMode and field properties UpdateIgnore and UpdateLocate:

Unbound fields (with empty DbFieldName), fields with UpdateIgnore = True and fields with UpdateLocate = False are not included regardless of the UpdateLocateMode value.

If UpdateLocateMode = PrimaryKey, only primary key fields (those with PrimaryKey = True) are included.

If UpdateLocateMode = AllFields, all fields are included provided they are not excluded by conditions above.

If UpdateLocateMode = PrimaryKeyAndChangedFields (default), the locate fields include primary keys and fields whose values have changed, row[“field_name”, DataRowVersionEnum.Current] is not equal to row[“field_name”, DataRowVersionEnum.Original].

Locating the record for delete can fail (no record found), due to changes made to the database by other users between the time the record was fetched and the time it is deleted. This is usually called optimistic concurrency, see Handling Concurrency Conflicts for more information. Including more fields in the WHERE clause (manipulating the UpdateLocateMode and UpdateLocate properties) makes the concurrency check more strict: changes made by other users to one of this field can fail the delete. Excluding fields from the WHERE clause makes the check less strict, allowing more concurrency, more tolerant to changes made by other users.

If no record has been found for delete, it may mean that the row has been already deleted. Since this does not necessarily represent an error condition (for example, the row could be deleted as a result of cascade delete), a special property IgnoreDeleteError allows you to suppress the error in this case. To check the “row deleted” condition C1DataObjects tries to locate the database row with the original primary key value (as in UpdateLocateMode = PrimaryKey). If such a row cannot be located, it means the row has been deleted. Handling this situation depends on the table property IgnoreDeleteError. If IgnoreDeleteError = True (default), this error is ignored, it does not generate an update error. If IgnoreDeleteError = False, this error generates an update error.


Added Row

Added Row

To add a row to the database, C1DataObjects generates and executes the following SQL statement:

INSERT INTO table_name (field1, field2, …) VALUES (?, ?, …)

Parameter values are set to the current row values: row[“field_name”].

The collection of fields used to set the values in the newly added record depends on the field properties UpdateIgnore and UpdateSet and DataSourceReadOnly:

Unbound fields (with empty DbFieldName), fields with UpdateIgnore = True and fields with DataSourceReadOnly = True are not included regardless of the UpdateSet value.

If UpdateSet = Always, the field is included provided the other properties do not preclude it.

If UpdateSet = Never, the field is not included.

If UpdateSet = IfChanged (default), the field is included if its value has been set by the user.

After a new row has been successfully created, C1DataObjects generates and executes another SQL statement, to retrieve the new row from the database:

SELECT selectField1, selectField2, … FROM table_name WHERE keyField1 = ? AND keyField2 = ? AND …

This refresh phase is needed because some field values could be assigned by the database itself, such as autoincrement fields, etc.

The refresh phase is controlled by the table property UpdateRefreshMode:

If UpdateRefreshMode = Always, the refresh phase always takes place, and its failure generates an error.

If UpdateRefreshMode = Never, the refresh phase is skipped.

If UpdateRefreshMode = IfPossible (default), the refresh phase takes place, but its possible failure does not generate an error.

Fields selectField1, selectField2, … are those whose values are retrieved from the new database row. The retrieved values, if different from the row values sent for update, substitute the row values and the client receives them back in the refreshed row.

A bound field (with non-empty DbFieldName) is included in selectField1, selectField2, …if its UpdateRefresh property is set to True.

Fields keyField1, keyField2, … used to locate the record in the WHERE clause, are the primary key fields of the table.

Parameter values are set to the current row values of primary keys: row[“field_name”].


Modified Row

Modified Row

To modify a database row, C1DataObjects generates and executes the following SQL statement:

UPDATE table_name SET (setField1 = ?, setField1 = ?, …) WHERE whereField1 = ? AND wherefield2 = ? AND …

The collection of fields used to set the values in the database row, setField1, setField2, … depends on the field properties UpdateIgnore and UpdateSet and DataSourceReadOnly:

Unbound fields (with empty DbFieldName), fields with UpdateIgnore = True and fields with DataSourceReadOnly = True are not included regardless of the UpdateSet value.

If UpdateSet = Always, the field is included provided the other properties do not preclude it.

If UpdateSet = Never, the field is not included.

If UpdateSet = IfChanged (default), the field is included if its value has been changed by the user, row[“field_name”, DataRowVersionEnum.Current] is not equal to row[“field_name”, DataRowVersionEnum.Original].

Parameters used to set values are assigned the current row values: row[“field_name”].

The collection of fields used to locate the record for update in the WHERE clause, whereField1, whereField2, … depends on the table property UpdateLocateMode and field properties UpdateIgnore and UpdateLocate:

Unbound fields (with empty DbFieldName), fields with UpdateIgnore = True and fields with UpdateLocate = False are not included regardless of the UpdateLocateMode value.

If UpdateLocateMode = PrimaryKey, only primary key fields (those with PrimaryKey = True) are included.

If UpdateLocateMode = AllFields, all fields are included provided they are not excluded by conditions above.

If UpdateLocateMode = PrimaryKeyAndChangedFields (default), the locate fields include primary keys and fields whose values have changed, row[“field_name”, DataRowVersionEnum.Current] is not equal to row[“field_name”, DataRowVersionEnum.Original].

Parameter used to locate the record are set to original row values: row[“field_name”, DataRowVersionEnum.Original].

If the original value of a field is Null, the condition is field IS NULL instead of field = ?.

Locating the record for update can fail (no record found), due to changes made to the database by other users between the time the record was fetched and the time it is updated. This is usually called optimistic concurrency, see Handling Concurrency Conflicts for more information. Including more fields in the WHERE clause (manipulating the UpdateLocateMode and UpdateLocate properties) makes the concurrency check more strict: changes made by other users to one of this field can fail the update. Excluding fields from the WHERE clause makes the check less strict, allowing more concurrency, more tolerant to changes made by other users.

After the database row has been successfully modified, C1DataObjects generates and executes another SQL statement, to retrieve the modified row from the database:

SELECT selectField1, selectField2, … FROM table_name WHERE keyField1 = ? AND keyField2 = ? AND …

This refresh phase is needed because some field values could be changed by the database itself, using triggers, etc.

The refresh phase is controlled by the table property UpdateRefreshMode:

If UpdateRefreshMode = Always, the refresh phase always takes place, and its failure generates an error.

If UpdateRefreshMode = Never, the refresh phase is skipped.

If UpdateRefreshMode = IfPossible (default), the refresh phase takes place, but its possible failure does not generate an error.

Fields selectField1, selectField2, … are those whose values are retrieved from the new database row. The retrieved values, if different from the row values sent for update, substitute the row values and the client receives them back in the refreshed row.

A bound field (with non-empty DbFieldName) is included in selectField1, selectField2, …if its UpdateRefresh property is set to True.

Fields keyField1, keyField2, … used to locate the record in the WHERE clause, are the primary key fields of the table.

Parameter values are set to the current (row[“field_name”]) or to the original (row[“field_name”, DataRowVersionEnum.Original]) values of primary keys, depending on whether a primary key field’s value has been set by the UPDATE SQL statement. If it has not been set in UPDATE, the original value is used. If it has been set, the current value is used.


Events in Updating a Row

Events in Updating a Row

After an IDCommand is set up with the generated SQL statement, C1DataObjects fires the C1TableLogic.BeforeUpdateRow event. Using this event, you can customize the command; for example, change the parameter substitution, if necessary. This event is also used to implement updates in SQL-based and unbound tables, see Updating SQL-based and Unbound Tables. In this event procedure, you can set the Status argument specifying how to proceed after the event is handled. The default value, Continue means the command is to be executed. If you want to take full control over update and cancel the default processing (command execution), do whatever is necessary to update the row in your event handler procedure and set the Status argument to SkipCurrentRow. There are also ErrorsOccurred and SkipAllRemainingRows options used to handle update failures. Another event argument, Row contains the C1DataRow being updated. It can be used to extract the current and original values of each field, if you need them to perform a custom update operation. After update, you can modify the field values in this row to customize data refresh after update, see Changing Data as a Result of Update (Refresh).

If not skipped by setting the Status argument of the BeforeUpdateRow event, the update itself takes place, the command containing the INSERT, DELETE or UPDATE SQL statement is executed. After that, except for deleted rows, the SELECT command is executed to refresh the data with the latest database values, see Changing Data as a Result of Update (Refresh).

After executing generated commands, C1DataObjects fires the C1TableLogic.AfterUpdateRow event. This event can be used, for example, for customizing data refresh after update, by setting the values in its Row argument.


Changing Data as a Result of Update (Refresh)

Changing Data as a Result of Update (Refresh)

After a successful update, the updated and added rows are retrieved from the database. This is necessary because the database can change the data, for example, set default values, and because the data could be modified by other users, if such concurrency is allowed by the UpdateLocateMode and UpdateLocate properties, see Generated SQL Statements.

Retrieving the current data from the database is called the refresh phase of the update process, see Generated SQL Statements. The retrieved values, if different from the row values sent for update, substitute the row values in the originally sent row, and the client receives them back in the refreshed row.

The process of refreshing rows after update can be customized using the UpdateRefreshMode and UpdateRefresh properties. It can also be customized in the AfterUpdateRow event. Setting values in the Row argument of the event, you can specify the values returned to the client in the refreshed row. The Row values can also be changed in the BeforeUpdateRow event, but then they are also used in updating the database row, whereas setting values in AfterUpdateRow only affects the values returned to the client. In addition to BeforeUpdateRow/AfterUpdateRow events, you can use the AfterUpdate event to programmatically change the refreshed rows. That event is fired once after all rows are updated.

For bound tables (with non-empty Connection and DbTableName properties), the refresh occurs automatically, using a generated SQL statement, see Generated SQL Statements. For an SQL-based table with attached DataAdapter component, the refresh is also done automatically, by the DataAdapter component. For SQL-based without DataAdapter component and for unbound tables, the refresh must be done in code, if necessary, in the AfterUpdateRow event (or in BeforeUpdateRow, see above) by setting the row values in the Row argument. For details, see Bound, SQL-Based and Unbound tables.


Updating SQL-Based and Unbound Tables

Updating SQL-Based and Unbound Tables

For bound tables (with non-empty Connection and DbTableName properties), and for SQL-based tables (with non-empty Connection and SelectCommandText properties) with DataAdapter component, the update process is automatic, although it can be customized with properties and events.

For SQL-based without DataAdapter component and for unbound tables, using events is required to provide update functionality, see Bound, SQL-Based and Unbound Tables.


Updating SQL-Based Tables

Updating SQL-Based Tables

An SQL-based table is a table with DataMode=SqlBased and non-empty Connection property, see Bound, SQL-Based and Unbound Tables. A SQL-based table can have a DataAdapter component associated with it, via the DataAdapter property of the C1TableLogic component (in C1DataExpress, DataAdapter is a property of C1ExpressTable).

For an SQL-based table with DataAdapter, the update is performed automatically by the DataAdapter component. For an SQL-based table without DataAdapter component, or if DataAdapter does not contain UpdateCommand, InsertCommand or DeleteCommand, the update is performed in code.

To allow updating the database from an SQL-based table without DataAdapter, write code in the C1TableLogic.BeforeUpdateRow event. According to the state (added/deleted/modified) of the row passed to the event in the Row argument, create one of the three commands (SQL statements in the form of an IDbCommand object), for insert, delete or update correspondingly, and assign the created command object to the corresponding argument: InsertCommand, DeleteCommand or UpdateCommand.

Optionally, if you need to refresh the updated row from the database, you can create a SELECT command retrieving the updated row and assign it to the SelectCommand argument. For more information, see Changing Data as a Result of Update (Refresh).

Note also, that if the table is read-only or just does not need update functionality, there is no need for update code in any case.


Updating Unbound Tables

Updating Unbound Tables

An unbound table is a table with DataMode=Unbound. In this case the Connection, DbTableName and SelectCommandText properties are empty. An unbound table has its data fetched and updated entirely in code. It can be used to represent a custom non-SQL data source, see Bound, SQL-Based and Unbound Tables.

To allow updating of the data source from an unbound table, write code in the C1TableLogic.BeforeUpdateRow event. In that code, perform the necessary update programmatically, doing whatever actions the custom data source requires, and set the Status event argument to SkipCurrentRow, indicating that the update has been done.

Optionally, if you need to refresh the updated row from the data source (see Changing Data as a Result of Update (Refresh)), retrieve the field values that you need from your data source and assign them to the fields of the Row argument passed to the event.

Note also, that an unbound table can be read-only or it can be modifiable without update functionality, in which case there is no need for any update code.


Controlling the Update Process

Controlling the Update Process

Before any processing of modified rows starts on the server, it fires the BeforeUpdate event. This event is fired on the server, in the same manner as the BeforeUpdateRow/AfterUpdateRow events, but, unlike them, it is fired only once. Its DataSet argument contains the data set passed to the server for update. By modifying this data set, developers can customize the update process and control the set of rows and field values that undergo the database update. The C1DataSetLogic component whose event is fired corresponds to the client-side C1DataSet component that originated the update.

After the BeforeUpdate event, C1DataObjects starts scanning all modified rows in a certain order and applying the changes to the database. For more information, see Update Process on the Server. Before processing each row, it fires first the C1DataSetLogic.BeforeUpdateRow event, then the C1TableLogic.BeforeUpdateRow event. The C1DataSetLogic component whose event is fired corresponds to the client-side C1DataSet component that originated the update. The C1TableLogic component represents the simple table containing the row in question.

Using C1TableLogic.BeforeUpdateRow is more common than using C1DataSetLogic.BeforeUpdateRow. A C1TableLogic component represents business logic pertaining to a certain table regardless of the data set where it is used. However, if you need some specific logic depending on the data set context, use the C1DataSetLogic.BeforeUpdateRow event. This, of course, applies to the C1DataSetLogic.AfterUpdateRow event as well.

Both BeforeUpdateRow events have Status argument. Setting it to Skip allows to cancel further processing for the current row.

After processing the row as described in Generated SQL Statements, C1DataObjects fires the C1TableLogic.AfterUpdateRow event and C1DataSetLogic.AfterUpdateRow event, in this order. For more information, see Generated SQL Statements. The values in its Row argument are the values that are later passed back to the client as the current database values in the process of refreshing the rows after update, see Changing Data as a Result of Update (Refresh). Changing the values in the AfterUpdateRow event allows developers to control the refreshed values, if necessary.

Finally, when all rows are processed, the AfterUpdate event is fired. Among other possible uses, it allows you to control the whole data set (via its DataSet argument) sent back to the client for refreshing updated rows, see Changing Data as a Result of Update (Refresh).

All these events, Before/AfterUpdate and Before/AfterUpdateRow are server-side events. They fire on the server only. See Application Configurations for the description of C1DataObjects client and server. However, this does not apply to a direct client situation, where a 2-tier application updates the database directly from the client, an application where C1SchemaDef and C1DataSet components reside on the same design surface. In this case, the client and the server are one and the same application.


Handling Errors in Update

Handling Errors in Update

There can be two different kinds of errors during update:

Concurrency Conflicts.

Updating a row can fail because another user has changed the same row between the time the row was fetched and the time it is updated. Different applications handle this situation differently, and it does not always represent an error condition. See Handling Concurrency Conflicts for details.

Program and Physical Errors.

An update can fail due to a program error, for example, an incorrect DbTableName property setting, or to a physical error, such as failed database connection. In this case, the Update method execution is aborted, the database transaction is rolled back, and an exception is thrown. Before throwing an exception, the AfterUpdate event is fired, giving the developer an opportunity to clean-up whatever resources could be allocated in the BeforeUpdate event. After that, the exception is passed to the client. On the client, it first fires the UpdateError event, the exception is passed to it as the Error argument. In that event, the developer has an opportunity to handle this situation without throwing an exception, by setting the Status argument to Continue or Skip. If the Status argument is left at the default value ErrorsOccurred, then the exception is thrown, aborting the Update method execution. That exception can then be handled the usual way. See Handling Update Errors on the Client for details.


Handling Concurrency Conflicts

Handling Concurrency Conflicts

Updating a row can fail because another user has changed the same row between the time the row was fetched and the time it is updated. Allowing concurrent changes to rows with “first tried – first succeeded” policy is usually called optimistic concurrency. When updating a row, your application must be sure that it is actually updating the same row as it had originally fetched from the database. In different application scenarios, the notion of “the same row” can be different. In some cases, you may need all the fields in the row in the database to remain intact from the moment the row was fetched till the moment it is updated. In other cases, it is enough that an ID, a primary key field remains intact, and all other fields can be allowed to be freely modified by various users on the “first tried – first succeeded” basis. To set this concurrency control policy, use the UpdateLocateMode and UpdateLocate properties. They control the collection of fields used in the WHERE clause of the action SQL statements to locate the record for update. A row passes the concurrency check if the WHERE clause finds a row in the database for update. Including more fields in the WHERE clause (manipulating the UpdateLocateMode and UpdateLocate properties) makes the concurrency check more strict: changes made by other users to one of these fields fail the update. Excluding fields from the WHERE clause makes the check less strict, making it more tolerant to changes made by other users.

When a concurrency conflict occurs, it fires the C1TableLogic.AfterUpdateRow event with its SqlStatus argument set to ConcurrencyConflicts. At this point, developers have an opportunity to reconcile this conflict directly on the server. Business logic does not always allow you to reconcile conflicts on the server, because this must be done without user interface and without asking for user choices. Still, if that is possible from the business point of view, it is usually preferable. To reconcile a conflict in the AfterUpdateRow event, do whatever needs to be done to update the row (remember that default update by the generated SQL statement has not been done because of the conflict), change the field values in the Row argument to reflect possible changes to the fields due to conflict resolution, and set the SqlStatus argument to Succeeded.

When the C1TableLogic.AfterUpdateRow fires on a conflicting row, its Status argument is set to Continue. This means that the conflict will not be regarded as an exceptional situation, a fatal failure, that C1DataObjects will continue processing other modified rows after that. However, if you need to abort processing at this point, you can do so by setting the Status argument to SkipAllRemainingRows or to ErrorsOccurred. The latter also has the additional effect of raising an exception on the client.

Conflicts that are not resolved on the server are passed to the client and have to be reconciled there, see Handling Update Errors on the Client. Concurrency conflicts do not raise an exception on the client, but fire the UpdateError event. Rows that caused conflicts can be found in the C1DataSet using the properties and methods RowError, HasErrors, HasErrors and GetErrors.

Note that this distinction between client and server is not applicable to a direct client application (see Application Configurations for the description of C1DataObjects client and server), that is a 2-tier application updating the database directly from the client, an application where C1SchemaDef and C1DataSet components reside on the same design surface. In this case, the client and the server are one and the same application so you can reconcile conflicts in the AfterUpdateRow event with user interface, see Handling Update Errors on the Client.


Handling Update Errors on the Client

Handling Update Errors on the Client

When an error condition of any kind occurs on the server during an update, the UpdateError event fires. If the error is a fatal failure, the Error argument of the UpdateError event contains the exception object describing the failure. For more information on a program or physical error, see Handling Errors in Update. If this is a concurrency conflict that could not be reconciled on the server and so was passed to the client, the Error argument is set to null (Nothing in Visual Basic). In case of a concurrency conflict, the rows that failed update can be found in the C1DataSet using the properties and methods RowError, HasErrors, HasErrors and GetErrors.

When writing code in the UpdateError event, developers can handle errors and reconcile concurrency conflicts. If you consider the error conditions resolved and want to make a new attempt to update the database, set the Status argument to Continue. That will repeat the Update method call. If there will still be errors, the UpdateError event will fire again, and this loop will continue until the update succeeds or until you exit the UpdateError event with Status = Skip or Status = ErrorOccurred. If Status is set to Skip, the update loop ends without exception, in effect, the Update call is ignored. If Status is set to ErrorsOccurred, an exception is thrown.

In the case of a fatal error (non-empty Error argument), the usual reaction is to set Status to ErrorOccured (throw an exception), or to Skip (ignore the Update call).

In the case of a concurrency conflict (empty Error argument), the recommended practice is to present the user with a special dialog(s) offering to reconcile the conflicts, for example, to choose between the values in the data set and the values in the database (to retrieve the current database values, use a separate C1DataSet object with the same schema). After reconciling the conflicts, repeat the update attempt by setting the Status argument to Continue. Alternatively, you can set Status to Skip before reconciling conflicts, and then repeat Update programmatically.


Features and Techniques

Features and Techniques

This chapter demonstrates how you can use C1DataObjects to solve common problems that arise when developing database applications. It also describes various techniques used in C1DataObjects.


C1DataObjects Expressions

C1DataObjects Expressions

C1DataObjects uses expressions to specify constraints and field calculations. C1DataObjects expression language is based on the ADO.NET expression language, see the reference entry for the System.Data.DataColumn.Expression property in .NET Framework Reference documentation. For your convenience, the expression language reference is partly reproduced below.

Expression variables are fields of tables and table views, see Schema Objects. In an expression belonging to a table or table view, you can use fields from the same table (or table view) and from its parents and children with regard to relations, if they are included in the same data set.

In addition to operators and functions defined in the ADO.NET expression language, C1DataObjects expressions support the following functions:

Current | Syntax: Current(field). Example: Current(OrderDate). Returns the value of the field in a row as it was before editing of the row started (BeginEdit was called). It is the same value as returned by C1DataRow[“field_name”, DataRowVersionEnum.Current]. If the row is not in edit mode, this function returns the same value as the field without a function. For a row in edit mode, the field without a function returns C1DataRow[“field_name”, DataRowVersionEnum.Proposed].
Original | Syntax: Original(field). Example: Original(OrderDate). Returns the value of the field in a row as it was when the row was fetched from the database. It is the same value as returned by C1DataRow[“field_name”, DataRowVersionEnum.Original].
BeforeChange | Syntax: BeforeChange(field). Example: BeforeChange(OrderDate). When the value of a field is being changed (including in events BeforeFieldChange and AfterFieldChange), the field variable returns the new value even if the new value has not yet been assigned to the field (for example, in the BeforeFieldChange event). If you need the field value as it was before the change, use this function. While the field value is being changed (including in events BeforeFieldChange and AfterFieldChange), this function returns the value before change. If the field value is not being changed when the function is evaluated, it returns the same value as the field variable without a function.

ADO.NET Expression Language Reference

Escaping Special Characters and Reserved Words

Constant Values

Operators

Parent/Child Fields

Aggregation Functions

Field Value Qualifying Functions

Other Functions


ADO.NET Expression Language Reference

ADO.NET Expression Language Reference

C1DataObjects expression language is based on the ADO.NET expression language. For a more detailed description of the ADO.NET expression language, see the reference entry for the System.Data.DataColumn.Expression property in .NET Framework Reference documentation.


Escaping Special Characters and Reserved Words

Escaping Special Characters and Reserved Words

Variable (field) names must be enclosed in square brackets if they include blanks or any of the following special characters, or coincide (ignoring case) with a reserved word.

Special characters: \n (newline) \t (tab) \r (carriage return) ~ ( ) # \ / = > < + - * % & | ^ ' " [ ]

Reserved words: CHILD, PARENT, CURRENT, ORIGINAL, BEFORECHANGE, IN, LIKE, AND, OR, NOT, CONVERT, LEN, ISNULL, IIF, SUBSTRING.

Examples of escaped field name: [Order Date], [CustomerID#]

If a field name contains closing bracket, it must be escaped with \. For example, field name Customer[Name] is written as [Customer[Name\]].


Constant Values

Constant Values

Strings are enclosed in single quotes. Dates are enclosed in pound signs.

Examples:

Discount = 0.11

CustomerName = ‘ALFKI’

OrderDate = #12/31/2001#


Operators

Operators

Comparison operators: <, >, <=, >=, <>, =, IN, LIKE (both wildcards * and % can be used in LIKE)

Boolean operators: AND, OR, NOT

Arithmetic operators: +, -, *, /, % (modulus).

String operator: + (concatenation)


Parent/Child Fields

Parent/Child Fields

A parent field is prepended with “Parent(relation_name).”. For example, Parent(Customers – Orders).CustomerName used in the Orders table references the CustomerName field of the Customers table. If there is only one relation connecting the tables (or table views), the relation name can be omitted. Example: Parent.CustomerName

A child field is prepended with “Child(relation_name).”. For example, Child(Customers – Orders).OrderDate used in the Customers table references the OrderDate field of the Orders table. If there is only one relation connecting the tables (or table views), the relation name can be omitted. Example: Child.OrderDate


Aggregation Functions

Aggregation Functions

Aggregation is usually performed in a parent table over a child table, as a function applied to a child field. Example: Sum(Child(Orders – OrderDetails).Quantity). Used in the Orders table, this expression calculates the sum of the Quantity fields of the OrderDetail table rows related to the Orders row.

Supported aggregation functions: Sum, Avg (average), Min (minimum), Max (maximum), Count, StDev (statistical standard deviation), Var (statistical variance).


Field Value Qualifying Functions

Field Value Qualifying Functions

Current(field), Original(field), BeforeChange(field).

These functions are supported by the C1DataObjects expressions in addition to the functions supported by the ADO.NET expression language. They apply to field variables and allow to obtain original field values and values before change, see C1DataObjects Expressions.


Other Functions

Other Functions

Convert(value, type) – converts a value to the specified type. Example: Convert(Quantity, 'System.Int32')

Len(string) – returns the length of a string. Example: Len(CompanyName)

IsNull(value, replacement_value) – returns value if it is not Null and replacement_value if value is Null. Example: IsNull(OrderDate, #1/31/2001#) returns #1/31/2001# if Orderdate is Null.

IIF(condition, true_value, false_value) – returns true_value if condition is True, and false_value if condition is False. Example: IIF(A < B, A, B) returns the minimum of A and B.

Substring(string, start_position, length) – returns a substring of specified length starting at start_position. Example: Substring(CompanyName, 1, 5) returns first five characters of the CompanyName value.


Adding Rows and Primary Keys

Adding Rows and Primary Keys

Adding new rows often, if not always, presents a serious problem with poor help from standard data frameworks, including ADO.NET. Specifically, the problem of primary key values in the newly added rows. Primary keys, such as, ProductID, OrderID, etc, are often assigned by a centralized procedure on the server or by the database itself (as AutoIncrement), so they are unknown until the new row is actually added to the database. That creates a lot of problems for GUI front ends that are commonly solved by restricting functionality, forcing early database updates and other objectionable techniques.

In this section, you will see how C1DataObjects solves this problem. We distinguish two different cases, two practical mechanisms of assigning primary keys to new rows. Primary key value can be assigned by the client application or by the server (or the database itself):

Keys Assigned by Client: New Row Detached and Attached State

Keys Assigned by Server or Database

Key Assigned Automatically by Database

Programmatic Key Assignment


Keys Assigned by Client: New Row Detached and Attached State

Keys Assigned by Client: New Row Detached and Attached State

This is the simplest case, where a key value is assigned directly by the client application, in essence, by the end user. For example, in the Northwind sample database, the key of the Customers table, CustomerID, is a string abbreviation of the customer name: “ALFKI”, “ANTON”, etc, assigned by the user. In this case, there is no “unknown key” problem. However, there is still a problem of transitional state in newly added rows:

Each table row in C1DataObjects must have a definite and unique primary key value. A row with an undefined primary key is in a special transitory state called detached. Such a row cannot be used for any purpose except setting its field values. For example, detached rows cannot be used in updating the database. When a new row is added to a table, for example, in a bound grid, or programmatically, with AddNew, it is initially in detached state. To change its state to attached, that is, a fully functional row that can be sent for update, you need to set its primary key field(s) and call the EndEdit method (explicitly or implicitly, see next about AutoEndAddNew).

If setting the primary key is the responsibility of the end user, you do not have to worry about the transition from detached to attached state, C1DataObjects does it for you. Its default behavior supports assigning primary key values by the end user. Table views have a special property, AutoEndAddNew. If it is set to True, C1DataObjects automatically calls EndEdit when the row’s primary key is set for the first time. If the primary key consists of multiple fields, EndEdit will be called when all the key fields receive definite values.

Sometimes, you may need programmatic control over setting primary keys for new rows. For example, you may need to set primary key automatically when a new row is added. This can be done in your business logic code, in the AfterAddNew event, for example:

· Visual Basic

· C#

· Delphi

Execution mode Deferred is used here instead of default mode Immediate, because we need the setting of the primary key and the EndEdit call to execute after all actions related to adding a new row are completed (including notifying bound controls that a row has been added, etc; it is not safe to perform actions like EndEdit while other actions, such as AddNew have not yet been completed), see Action Order and Execution Mode.


Keys Assigned by Server or Database

Keys Assigned by Server or Database

It is common to allocate new primary key values on the application server or in the database itself (autoincrement keys, triggers, etc). In this case, the real primary key values as they will appear in the database are not known until the new rows are actually inserted into the database. This is the “unknown key” problem. C1DataObjects solves this problem by allowing you to work with temporary key values until the rows are sent to the database for update.

Before an update, you can use arbitrary temporary values for primary keys. The only requirement is that those temporary values must be unique, not intersecting with real (after update) primary key values. For example, the temporary values can be made negative to ensure their uniqueness. This is done automatically by C1DataObjects if you use property setting AutoIncrement = ClientAndServer.

When the rows are created on the client, they acquire temporary primary key values (become attached), as described in Keys Assigned by Client: New Row Detached and Attached State. Rows with temporary primary key values can be used on the client without restrictions, including adding child rows related to them, etc.

During database update, when the new rows are actually inserted into the database, C1DataObjects obtains final primary key values and substitutes the temporary values on the client with the final values. This client primary key value refresh can be done automatically by C1DataObjects if you use property setting AutoIncrement = ClientAndServer, as described in Key Assigned Automatically by Database, or it can be performed programmatically, as shown in Programmatic Key Assignment.


Key Assigned Automatically by Database

Key Assigned Automatically by Database

Let’s first consider the case where the new primary key value is created automatically by the database upon executing an INSERT command. It can be an autoincrement database field, or a database trigger setting the field on INSERT.

For integer primary keys with autoincrement functionality in the database, C1DataObjects provides a property setting, AutoIncrement = ServerAndClient that makes the whole process fully automatic. In this case, AutoIncrementSeed = -1 and AutoIncrementStep = -1, which makes temporary key values on the client negative to guarantee their uniqueness. When a row is added to the database, C1DataObjects uses the database capacity to retrieve the actual key value after the row is added. See IdentityColumnLastValueSelect property for explanation on how to find out if the database supports this functionality. Having retrieved the actual primary key value, C1DataObjects sends it back to the server as the replacement for the temporary value.

Some databases do not support automatic identity assignment (autoincrement) to database fields on adding new rows, but they support special objects (usually called sequence or generator) for generating unique identity values that are used to set identity key values in INSERT. Such databases are, for example, Oracle (object: sequence) and Interbase (object: generator). To ensure automatic identity value update on adding new rows for such databases, set the IdentityColumnLastValueSelect property to the SQL command retrieving identity value, set the field's AutoIncrementSequenceName property to the corresponding sequence (generator) object name, and set the field's IdentityColumnRetrieveMode to BeforeInsertCommand. C1DataObjects will obtain a new identity value, use it when inserting the new row, and refresh the identity row on the client. This is the recommended way of dealing with autoincrement keys in Oracle and in Interbase. You also have an option of creating a trigger on INSERT and setting the autoincrement key value in the trigger. This is not necessary unless you need this trigger for other purposes or already have such trigger in the database. If you do define a trigger, use IdentityColumnRetrieveMode = AfterInsertCommand with IdentityColumnLastValueSelect and AutoIncrementSequenceName to refresh the autoincremented value on the client.

If your database does not support the functionality of retrieving autoincremented (identity) value required by IdentityColumnLastValueSelect, you can still use AutoIncrement = ServerAndClient, but you need to retrieve the key value after row insert using the AfterUpdateRow event, or perform the whole row insert operation including key value retrieval in the BeforeUpdateRow event. For example, the following code using AfterUpdateRow event can be used to retrieve the actual key value after insert from a database that does not support IdentityColumnLastValueSelect:

· Visual Basic

· C#

· Delphi


Programmatic Key Assignment

Programmatic Key Assignment

If the new primary key value is created programmatically, according to a certain rule, on the server, then it is done in the BeforeUpdateRow event. First, a new primary key value is allocated or calculated in code (maybe using a stored procedure or other mechanisms) and assigned to the corresponding field(s) in the Row argument. Thus the temporary key value originally present in Row is substituted with the final, real value. When C1DataObjects inserts the row into the database after the event, it uses the new value. When it then sends the row back to the server for refresh (see Changing Data as a Result of Update (Refresh)), the new value is sent to the client. Having received the new value, the client substitutes the temporary value with the real one.

· Visual Basic

· C#

· Delphi


Working with ADO.NET Dataset

Working with ADO.NET Dataset

A C1DataSet component stores its data in an ADO.NET DataSet and that internal storage is accessible via the StorageDataSet property. This enables a powerful combination of C1DataObjects and ADO.NET in the same code, see C1DataObjects and ADO.NET.

You can see an example of these techniques used in code in the ADOStorage sample in the Samples directory. The sample project has extensive explanatory comments in the code.

This functionality allows you to access and modify the ADO.NET data set storing table data. You can use both C1DataObjects and ADO.NET to access the same data. Essentially, you have two views to the same data. The first view is a C1DataObjects data set (C1DataSet), and the second is the corresponding ADO.NET data set (StorageDataSet). If you change data in one of them and then switch to the other, it will automatically reflect the changed data.

When you fill or modify a C1DataSet, C1DataObjects stores table data internally in an ADO.NET data set. You can access this data set at any time through the StorageDataSet property. This ADO.NET data set contains only simple table rows. For each simple table, you will find a table with the same name in the underlying ADO.NET data set (you can also access data tables with StorageDataTable and individual columns with StorageDataColumn). Table views are not stored in this ADO.NET data set, because they do not contain data as such, their rows only contain pointers to table rows, see Structured Data Storage: Tables and Table Views.

Using the StorageDataSet property, you can work directly with the ADO.NET data set or export data from a C1DataSet to an ADO.NET data set or to XML. So, the conversion from C1DataSet to ADO.NET DataSet is easy, just use the StorageDataSet property.

Conversion from an ADO.NET data set to C1DataSet is also possible, but it can require additional work, because we also need to set up table view rows, which are not stored in the ADO.NET data set. By "conversion process" process we mean modifying the underlying ADO.NET data set, C1DataSet.StorageDataSet.

You can modify StorageDataSet using any means available in ADO.NET, and them "synchronize" it with the C1DataSet, that is, set up table view rows pointing to the table rows. The conversion, that is, modification/synchronization process has two stages:

First, you modify StorageDataSet (fill simple tables with data or modify their data as you need), and second, you fill table views with rows that point to table rows.

Changing data in the ADO.NET data tables comprising StorageDataSet is only allowed on the first stage of this process. When the first stage ends, tables are filled with data. You must exercise caution not to modify ADO.NET table data directly except on the first stage of the modification/synchronization process (but of course you can modify it at any time through the regular C1DataObjects programmatic object model). C1DataObjects does not enforce this -- it is developer’s responsibility. Violating this restriction will not be detected by C1DataObjects and can have unpredictable consequences.

At the beginning of the second stage, all table views are cleared so you can fill them with rows (pointing to table rows). To fill a table view, use the SetTableViewRows method. If you do not call SetTableViewRows for a table view, it will be called automatically at the end of the second stage, with default parameters. So, if your table view contains all possible table rows, without restrictions (filters), you do not need to do anything with it on the second stage. But in many cases, such as when you used filter conditions filling C1DataSet, you need to control the collection of table rows that belong to table views. This is done using the SetTableViewRows method for each such table view. You have two options: either to enumerate the rows manually (for instance, scanning the existent table rows, finding the ones that must belong to the table view, or to call GetDefaultTableViewRows that provides the full list of all existing table rows so you can filter them and then pass the filtered list to SetTableViewRows.

The complete modification/synchronization process looks like this:

// start

c1DataSet1.StorageChangeBegin()

// fill or modify tables (modify data in StorageDataSet)

...first stage...

// first stage complete, tables filled, table views are

// undefined at this point

c1DataSet1.StorageChanged(true)

// fill table views with rows pointing to tables

// (calling SetTableViewRows())

...second stage...

// process complete, both tables and table views filled

c1DataSet1.StorageChangeEnd()

See the ADOStorage sample in the Samples directory for a complete example.


C1DataObjects Samples

C1DataObjects Samples

Please be advised that this ComponentOne software title is accompanied by various sample projects and/or demos, which may or not make use of other ComponentOne development tools. While the sample projects and/or demos included with the software are used to demonstrate and highlight the product’s features, and how the control may be integrated with the rest of the ComponentOne product line, some of the controls used in the demo/sample project may not be included with the purchase of certain individual products.

The samples illustrate various features of C1DataObjects. However, the samples do not cover all C1DataObjects features, only those that are not sufficiently represented in C1DataObjects Tutorials.

All samples use the standard Microsoft Access sample database Northwind, NWIND.MDB.

Note: Please be aware that the sample projects have the database location hard coded in the connection string:

C:\Program Files\ComponentOne Studio.NET\Common\NWIND.MDB

If you have the Northwind database installed in a different location, you can change the connection strings, or copy the NWIND.MDB file to the required location.

The ComponentOne Samples are also available at http://helpcentral.componentone.com/ProductResources.aspx.


Visual Basic and C# Samples

Visual Basic and C# Samples

ADOStorage

Enables you to work with the same data using C1DataObjects and ADO.NET, interchangeably. This functionality is very important in C1DataObjects, because it allows you to:

· Do everything with your data that you can do with ADO.NET, including things that are not supported in C1DataObjects (for example, DataSet.Merge).

· Export/import your data from/to C1DataObjects in ADO.NET DataSet format.

This sample uses the C1DataSet and C1SchemaDef controls.

ADOStorage(DX)

Demonstrates data interchange between C1DataExpress and ADO.NET. This sample uses the C1ExpressTable and C1ExpressConnection controls.

AutoincrementMasterDetail

Demonstrates Field.AutoIncrement=ClientAndServer in a master-detail situation. This sample uses the C1DataSet and C1SchemaDef controls.

Calculations

Shows how to use C1DataObjects expression in calculation fields. This sample uses the C1DataSet and C1DataTableSource controls.

Constraints

Shows how to use C1DataObjects expression constraints. This sample uses the C1DataSet and C1TrueDBGrid controls.

CrystalReportsIntegration

Shows how to create a report using C1DataObjects data with Crystal Reports. Other reporting tools can be used in a similar fashion. This sample uses the C1DataSet and C1SchemaDef controls.

CrystalReportsIntegration(DX)

Shows how to create a report using C1DataExpress data with Crystal Reports. Other reporting tools can be used in a similar fashion. This sample uses the C1ExpressTable and C1ExpressConnection controls.

CustomDataProvider

Demonstrate a usage of C1DataObjects with an arbitrary .NET data provider. This sample uses the C1DataSet and C1SchemaDef controls.

CustomFillUpdate

This sample demonstrates:
-- Adding custom business methods to a data library.
-- Passing C1DataSet as a parameter between client and server, different processes/machines.
-- Some ways to customize Fill and Update process (about other Update customization options, see "Updating the Database" in C1DataObjects documentation).
-- Managing connections and transactions on the server, including using pre-created connections/transactions and using distributed COM+ transactions (spanning multiple databases). This sample uses the C1DataSet control.

CustomRelations

Shows how to create a custom relation, the one with behaviour managed by a custom code. This sample uses the C1DataSet and C1SchemaDef and C1DataSetLogic controls.

CustomRelations(DX)

This sample shows how to create relations in code, specifying the list of child rows dynamically at run time. This sample uses the C1ExpressTable and C1ExpressConnection controls.

DataLibraryInheritance (C# only)

Shows how to inherit a data library from another data library. This sample uses the C1DataSet control.

DefaultDataView

Demonstrates the use of C1DataView.IsDefault property and C1DataView.GetRows event. This sample uses the C1DataSet and C1SchemaDef and C1DataView controls.

DefaultDataView(DX)

This sample demonstrates the use of C1ExpressView.IsDefault property and C1ExpressView.GetRows event. This sample uses the C1ExpressTable and C1ExpressConnection and C1ExpressView controls.

DynamicConnections

Demonstrates how to set ConnectionString and other Connection properties for a data set at run time. This sample uses the C1DataSet and C1SchemaDef controls.

DynamicExpress(DX)

This sample demonstrates how to set ConnectionString, DbTableName and other properties at run time in C1DataExpress. This sample uses the C1ExpressTable and C1ExpressConnection controls.

Programmatic

This sample demonstrates creating C1Data schema objects at run time. This sample uses the C1TrueDBGrid control.

Relations

Demonstrates master detail hierarchies based on various kinds of relations. This sample uses the C1DataSet and C1TrueDBGrid controls.

ResolvingConcurrencyConflicts

Shows how to resolve concurrency conflicts in database update. This sample uses the C1DataSet, C1DataView and C1TrueDBGrid controls.

ResyncFromDatabase

This sample shows how to synchronize rows with the current state of the database. This sample uses the C1DataSet and C1SchemaDef controls.

SQLBasedTables

This sample shows how to specify custom SQL statements for filling and updating C1DataObjects tables. This sample uses the C1DataSet and C1TrueDBGrid controls.

SQLBasedTablesEasy

Demonstrates how to create a table based on a SQL SELECT statement or a stored procedure. This sample uses the C1DataSet and C1SchemaDef and C1TableLogic controls.

SQLBasedTablesEasy(DX)

Demonstrates how to create a table based on a SQL SELECT statement or a stored procedure. This sample uses the C1ExpressTable control.

UnboundTables

This sample shows various techniques that can be useful in creating unbound tables. This sample uses the C1DataSet and C1TrueDBGrid controls.

UsingDataView

This sample demonstrates filtering and sorting features of the C1DataView component. This sample uses the C1DataSet, C1SchemaDef and C1DataView controls.

VirtualSort

This sample shows how to specify sort order in virtual mode table views and change it at run time. This sample uses the C1DataSet, C1SchemaDef, C1DataTableSource and C1DataView controls.

WorkingWithData

Shows how to access C1DataObjects data programmatically. This sample uses the C1DataSet control.


Borland Samples

Borland Samples

ADOStorage | Demonstrates data interchange between C1DataObjects and ADO.NET. This sample uses the C1DataSet and C1SchemaDef controls.
AutoincrementMasterDetail | Demonstrates Field.AutoIncrement=ClientAndServer in a master-detail situation. This sample uses the C1DataSet and C1SchemaDef controls.
Calculations | Shows how to use C1DataObjects expression in calculation fields. This sample uses the C1DataSet and C1DataTableSource controls.
Constraints | Shows how to use C1DataObjects expression constraints. This sample uses the C1DataSet and C1TrueDBGrid controls.
CustomDataProvider | Demonstrate a usage of C1DataObjects with an arbitrary .NET data provider. This sample uses the C1DataSet and C1SchemaDef controls.
CustomRelations | Shows how to create a custom relation, the one with behaviour managed by a custom code. This sample uses the C1DataSet and C1SchemaDef and C1DataSetLogic controls.
DefaultDataView | Demonstrates the use of C1DataView.IsDefault property and C1DataView.GetRows event. This sample uses the C1DataSet and C1SchemaDef and C1DataView controls.
DynamicConnections | Demonstrates how to set ConnectionString and other Connection properties for a data set at run time. This sample uses the C1DataSet and C1SchemaDef controls.
Programmatic | This sample demonstrates creating C1Data schema objects at run time. This sample uses the C1TrueDBGrid control.
Relations | Demonstrates master detail hierarchies based on various kinds of relations. This sample uses the C1DataSet and C1TrueDBGrid controls.
ResolvingConcurrencyConflicts | Shows how to resolve concurrency conflicts in database update. This sample uses the C1DataSet, C1DataView and C1TrueDBGrid controls.
SQLBasedTables | This sample shows how to specify custom SQL statements for filling and updating C1DataObjects tables. This sample uses the C1DataSet and C1TrueDBGrid controls.
SQLBasedTablesEasy | Demonstrates how to create a table based on a SQL SELECT statement or a stored procedure. This sample uses the C1DataSet and C1SchemaDef and C1TableLogic controls.
UnboundTables | This sample shows various techniques that can be useful in creating unbound tables. This sample uses the C1DataSet and C1TrueDBGrid controls.
UsingDataView | This sample demonstrates filtering and sorting features of the C1DataView component. This sample uses the C1DataSet, C1SchemaDef and C1DataView controls.
VirtualSort | This sample shows how to specify sort order in virtual mode table views and change it at run time. This sample uses the C1DataSet, C1SchemaDef, C1DataTableSource and C1DataView controls.
WorkingWithData | Shows how to access C1DataObjects data programmatically. This sample uses the C1DataSet control.


ComponentOne DataExpress

ComponentOne DataExpress

ComponentOne DataObjects Express Edition (C1DataExpress) makes it exceptionally easy to work with data in .NET applications. It shields developers from the complexities of ADO.NET, makes data bound forms as easy to build as it used to be in previous versions of Microsoft Visual Studio. However, C1DataExpress is not just about ease of use, it also adds many power features absent in standard ADO.NET:

· C1DataExpress fully supports multi-table rowsets (composite tables) automatically enforcing data relations without manual coding. For example, changing a CustomerID field will automatically change the corresponding CustomerName field in the same row, although it is stored in a separate table.

· With an innovative virtual mode technology, C1DataExpress allows you to use large datasets in .NET Windows Forms applications, the feature that is not supported in Visual Studio .NET and ADO.NET without C1Data.

· C1DataExpress completely automates database updates. There is no need to use ADO.NET DataAdapter or other special components. Database updates are performed without manual coding. C1DataExpress can update the database even when multiple and interrelated changes have been made to multiple tables.

· Setting a single property, UpdateLeavingRow, you can make C1DataExpress update the database immediately after the user changes a row. This optional feature is commonly used in desktop and classic client-server applications. Standard ADO.NET does not support this feature.

· C1DataExpress supports an extensive set of events enabling full programmatic customization.

C1DataExpress is a special edition of ComponentOne DataObjects. The Express Edition is geared toward ease of use and optimized for desktop and client-server applications. The main goal of Express Edition is to provide a data framework for .NET that is very easy to use, highly intuitive and requires minimal effort to master. If you need even more power, consider using ComponentOne DataObjects Enterprise Edition supporting additional power features:

· C1DataObjects Enterprise Edition uses the standard business object paradigm to allow you to develop business logic components (data libraries) and reuse them in multiple client projects. It provides clear separation of business and data logic from the presentation (GUI) layer.

· C1DataObejcts Enterprise Edition allows you to create a centralized and reusable repository of data schema and business logic (data libraries) used in applications throughout the enterprise.

· C1DataObejcts Enterprise Edition completely automates the task of developing distributed 3-tier web-based applications. No special server-based code is necessary, and making your application distributed becomes a simple matter of deployment configuration.

C1DataExpress and C1DataObejcts Enterprise Edition are not mutually-exclusive, they can even be used together in the same application. They have common runtime core functionality and object model. The difference is primarily in design time: developers use a special Schema Designer in C1DataObjects whereas C1DataExpress is a suite of three simple components with built-in design-time support.

C1ExpressTable: Working with Simple and Composite Tables

C1ExpressConnection: Combining Tables into Data Sets

C1ExpressView: Filtering, Sorting and Working with Tables in Other Forms

Notes for Users of C1DataObjects Enterprise Edition

C1DataExpress Tutorials


C1ExpressTable: Working with Simple and Composite Tables

C1ExpressTable: Working with Simple and Composite Tables

C1ExpressTable is the main component of C1DataExpress. It defines a table, a rowset. Data-aware controls, such as ComponentOne, Microsoft or third-party grid controls, can bind to a C1ExpressTable component as their DataSource. A C1ExpressTable component can be used either as a stand-alone data control or attached to a C1ExpressConnection component. In latter case, all C1ExpressTable components attached to a C1ExpressConnection share the same database connection and form a data set, see C1ExpressConnection: Combining Tables into Data Sets.

Connecting to Database and Working with Data

Using Composite Tables

Defining Fields

Programmatic Access to Data

Customizing Data Logic with Events


Connecting to Database and Working with Data

Connecting to Database and Working with Data

1. Connect to a database:

· A stand-alone C1ExpressTable component is connected to a database by setting its ConnectionString property.

· A C1ExpressTable component attached to a C1ExpressConnection (its ConnectionComponent property set) does not need a separate database connection, it uses one of C1ExpressConnection.

2. After connecting to a database, set the DbTableName property choosing a database table from a combo box or creating Composite Tables.

It is recommended to use the DbTableName property to bind a C1ExpressTable to a database table, but you can also use the SelectCommandText property to specify a SQL statement or a stored procedure (the latter if the SelectCommandType property is set to StoredProcedure). Using SelectCommandText is almost as simple as using DbTableName, but you also need to create a DataAdapter component for this C1ExpressTable if you need it to be modifiable, have update functionality (select Create DataAdapter from the context menu).

Also, SQL-based C1ExpressTable components (those that use SelectCommandText instead of DbTableName) cannot be used in composite tables and in virtual mode, and their FillFilter property is ignored.

3. The last step is defining fields using the Fields Editor that opens when you press the button for the Fields property. For simple tables, C1DataExpress retrieves the fields collection from the database table. For a composite table, you must add fields from underlying database tables to your composite table using the Fields Editor. You can customize the Fields collection deleting and rearranging the fields, adding calculated fields and setting various field properties.

Once a C1ExpressTable component is bound to a database table(s), it can be used as a data source in data-aware GUI controls. Just select the component in the DataSource property combo box of a data-aware control. Note, that if you need master-detail data binding, you must use a C1ExpressConnection component as your DataSource and select appropriate DataMember values. The string representing a C1DataExpress table in DataMember is determined by the TableName property.

The FillOnRequest property (belonging to a C1ExpressConnection component) determines whether C1ExpressTable components are filled with data automatically at start-up (when data-bound controls request data from it). Setting FillOnRequest to false, you can fill them with data later, programmatically, calling the Fill method (C1ExpressTable.ExpressConnection.Fill).

Unless you specify a filter condition in the FillFilter property, C1ExpressTable will fetch all existing table data unrestricted. To restrict fetch, specify an SQL filter condition in the FillFilter property. In this condition, use field names in brackets, for example,

C1ExpressTable1.FillFilter = “[CategoryID] = 1”

Setting the FillSort property you can specify the order of fetched rows, for example,

C1ExpressTable1.FillSort = “OrderID,CustomerID”

By default, rows are sorted by primary key.

By default, C1DataExpress works in disconnected mode, just like standard ADO.NET : data is pre-fetched from the database in its entirety. In this mode, you cannot bring large datasets, with hundreds of thousands of records and more, to the client. However, C1DataExpress also supports so called virtual mode, where data size is unlimited. With its innovative virtual mode technology, C1DataObjects (both editions) allows you to use large datasets, unlimited in size, in .NET Windows Forms applications. This feature is not supported in Visual Studio .NET and ADO.NET without C1DataObjects. See Tutorial 4 - Virtual Mode: Dealing with Large Datasets in C1DataObjects documentation for an example of a rowset containing 2.7 million rows that is available on the client with limited memory consumption and startup time of about three seconds. See Virtual Mode - Dealing with Large Datasets in C1DataObjects documentation for details on virtual mode. In C1DataExpress, virtual mode is enabled by setting the DataAccessMode property of a C1ExpressTable component.

Properties AllowAddNew, AllowDelete, ReadOnly determine whether the user can modify table data. By default, user modifications are cached on the client and not sent back to the database. The database is updated, modifications written to the database, when the Update method is called from code. C1DataExpress also supports an automatic update mode. In this mode, a modified row is automatically updated to the database when the end user leaves that row, when another row becomes current. To enable automatic update mode, set the UpdateLeavingRow property to true.


Using Composite Tables

Using Composite Tables

In many cases, simple database tables are not enough; you need a rowset combining data from several database tables. For example, you may need CustomerID and CustomerName fields where CustomerID belongs to a database table Orders whereas CustomerName belongs to a database table Customers. It is customary to use SQL statements for this purpose. However, direct use of multi-table SQL statements causes many problems, the data cannot be easily updated, the resulting rowset does not preserve the structure and relations used to obtain it, and so on, not to mention inherent complexities of using SQL.

C1DataExpress automates this task, as many others. You can create a composite table, specifying database tables it consists of and joins between those tables. Fetching and updating data, C1DataExpress automatically generates necessary SQL statements, transparently to the developer. Working with data, C1DataExpress maintains the structure specified in composite table definitions. For example, changing CustomerID will automatically change the related field CustomerName, without any manual coding.

A C1ExpressTable component represents either a simple database table or a composite table. To specify a composite table, select "Composite…" in the DbTableName property combo box or select Composite Table Editor from the context menu.

In Composite Table Editor, add database tables constituting the composite table. Constituent database tables form a hierarchical structure (a tree). Filling a composite table with data can be represented as performing nested loops over this hierarchy. Each node, a constituent database table, is attached to its parent either by 1-M (one-to-many) or M-1 relation. A one-to many relation represents a child table with independent key, as in Customers à(1-M) Orders. A many-to-one relation represents a main table and a lookup table, as in Orders à(M-1) Customers. The difference is that in 1-M relation there are many child rows for a single parent row, whereas in an M-1 relation there only one child row for each parent row. The constituent table hierarchy satisfies a “non-branching” restriction: only one 1-M-child is allowed for each parent (M-1-relations are not restricted and can branch). Each node of the hierarchy, each constituent database table, except the first one, must be joined to its parent with one or more joins – equalities between a parent and a child field. An example of composite table structure is as follows:

Orders à (1-M) OrderDetails à (M-1) Products à (M-1) Categories

Corresponding SQL statement automatically generated by C1DataExpress (simplified):

SELECT * FROM ((Orders INNER JOIN OrderDetails ON Orders.OrderID = OrderDetails.OrderID) INNER JOIN Products ON (OrderDetails.ProductID = Products.ProductID)) INNER JOIN Categories ON (Products.CategoryID = Categories.CategoryID)

By default, M-1 joins in a composite table define a referential integrity (foreign key) constraint. So, for example, in a composite table CustomersOrders it is not allowed to enter CustomerID that is not present in the Customers table. If you want to change this behavior, define a relation in the C1ExpressConnection component with the same joins as used in the composite table and uncheck the Enforce constraints check box. See Defining Relations for more details.


Defining Fields

Defining Fields

For simple tables, C1DataExpress retrieves the fields collection from the database table. For a composite table, you must select fields from underlying database tables and add them to your composite table using the Fields Editor. You can customize the Fields collection deleting and rearranging the fields, adding calculated fields and setting various field properties.

A field has a Name that must be unique in the table. A field can be renamed by renaming the field node in the Fields list. The name is used to identify the field as the name of the column exposed to the users, and as the default display name (caption) of the column.

The DataType property determines the field .NET type, and NativeDbType – its native database or OLE DB type. NativeDbType is used only for updating values in the database, and can be set to Any (-1), in which case its value is effectively ignored. When in doubt, use Any (-1) as the default value for NativeDbType.


DB Fields and Calculated Fields

DB Fields and Calculated Fields

A DB field represents a database table field as determined by its DbFieldName property.

A calculated field is not based on a database field. Its value is determined by one or more calculations (FieldCalculationInfo objects) or assigned in code. Each calculation (FieldCalculationInfo) contains Expression, which is the expression used to obtain field values (see C1DataObjects Expressions for a description of C1DataObjects expression language), and two additional properties: Condition and FireEvent. Condition is an optional boolean expression determining calculation’s applicability. If Condition evaluates to False, the calculation expression is skipped, not evaluated. If a field has multiple calculations, C1DataExpress applies the first with Condition expression evaluating to True. If none is applicable, the field value is left unchanged. FireEvent is a boolean property set to False by default. If it is set to True, setting the value from calculation expression triggers the same sequence of events (BeforeFieldChange, AfterFieldChange, AfterChanges) as if the value has been modified by the end user. Field calculations are useful for DB fields as well as for calculated fields. In this case, they are usually qualified by Condition expressions. Depending on the conditions, a field’s value can be derived from a value stored in the database, or it can be calculated. For instance, if field A is non-empty, field B always returns the same value as A, but if A is empty, B can be set independently of A.


Field Properties

Field Properties

AllowDbNull | Gets or sets a value indicating whether null or empty string values are allowed in this field. If it is set to False, an attempt to assign null or empty string value to this field generates an exception.
AutoIncrement | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed | Gets or sets the starting value for a field with AutoIncrement other than None.
AutoIncrementStep | Gets or sets the increment a field with AutoIncrement other than None.
Constraints | Returns the collection of constraints, ConstraintInfo objects. Constraints are evaluated (tested) when the value of the field changes. For a change to be successful, all constraint expressions (Expression) must evaluate to True. If one of the constraints is not satisfied, an exception is thrown. The exception message is determined by ErrorDescription. Constraints with Condition expression (if non-empty) evaluating to False, are skipped, not tested. See also, C1DataObjects Expressions for a description of C1DataObjects expression language.
DataSourceReadOnly | Gets or sets the value indicating whether the field value in the database can be changed. If this property is set to True, the field value will not be set updating the database. It also cannot be modified unless it is done in a newly added row, before the BeforeEndAddNew event (as with ReadOnlyUnlessNew = True).
DefaultValue | Gets or sets the default value, in string representation, for the field in a newly created row.
MaxLength | Gets or sets the maximum length of a string field, in characters. If the length is unlimited, the value is 0 (default).
PrimaryKey | Determines whether the field belongs to the table’s primary key. It is determined automatically by C1DataExpress based on the database table structure.
Precision | For numeric fields (DataType is Numeric, Decimal or DbTimeStamp), this property sets or gets the maximum number of digits representing values.
ReadOnly | Gets or sets a value indicating whether the field value can be changed by the end user or from event code. If set to True, an attempt to change the field throws an exception.
ReadOnlyUnlessNew | Gets or sets a value indicating whether the field value can be changed after the row has been added to the table (after AfterEndAddNew event). If set to True, an attempt to change the field throws an exception unless it is done in a newly added row, before the BeforeEndAddNew event.
Scale | For numeric fields (DataType is Numeric, Decimal or DbTimeStamp), this property sets or gets the scale of numeric values, that is, how many digits to the right of the decimal point are used to represent values.
Unique | Gets or sets a value indicating whether the values of this field in each row must be unique. If it is set to True, an attempt to assign a duplicate value to this field generates an exception.


Programmatic Access to Data

Programmatic Access to Data

To access data in code, use properties and methods of the C1.Data.C1DataTable object returned by the DataTable property. As with all programmatic classes in C1DataExpress, C1DataTable object model is based on the ADO.NET DataTable object model, so you will find its methods and properties familiar if you already know ADO.NET.

Here is a brief syntax description for most common programmatic tasks in accessing data in code (in Visual Basic, replace indexing brackets “[index]” with parentheses “(index)”):

C1ExpressTable.DataTable.Rows.Count – number of rows in the table.

C1ExpressTable.DataTable.AddNew() – adds a new row to the table.

C1ExpressTable.DataTable.Rows[index].Delete() – deletes a row from the table.

C1ExpressTable.DataTable.Rows[index] – a data row, a C1DataRow object.

To get/set field value in a row, (C1DataRow object), use row[field_name] or row[field_index], or, with full access path, C1ExpressTable.DataTable.Rows[row_index] [field_index].

C1DataRow.GetChildRow(s) – gets child rows with respect to a master-detail relation.

C1DataRow.GetParentRow(s) – gets parent rows with respect to a master-detail relation.

C1DataRow.Modified – returns true, if the row has been modified.

C1DataRow.RowState – returns one of the DataRowState enumeration values: Unchanged, Modified, Added, Deleted, Detached.

C1DataRow.BeginEdit/EndEdit/CancelEdit – start/end/rollback edit mode for a row.


Customizing Data Logic with Events

Customizing Data Logic with Events

The C1ExpressTable component supports a rich set of events allowing to customize data behavior in code. Following is a brief list of C1ExpressTable events (we omit prefixes Before and After pertaining to most events, retain the prefix only if an event occurs only Before or only After). For a full description of C1ExpressTable events see corresponding reference sections and Business Logic Events in C1DataObjects documentation.

AddNew | Fired when a new (empty) row is added.
AfterChanges | Fired when all changes initiated by a field change are done and handled in code, see the FieldChange event.
BeginEdit | Fired when the user starts editing a row (data-bound controls start editing a row immediately after they position on it, even though no changes have been made yet).
CancelEdit | Fired when the user cancels editing a row reverting the changes made to it.
CurrentRowChanged | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh. The CurrentRowChanged event is useful in scenarios such as synchronizing detail data with the master row on every change occurring in the master row.
Delete | Fired when a row is deleted.
EndAddNew | Fired when a newly added row becomes a regular row in the rowset. When a row is added, it is added empty, its primary key is unknown. A row with unknown primary key is in special transitory state, it is not a regular rowset row. Only after its primary key is set it becomes a regular (added) row, which is signaled by this event.
EndEdit | Fired when the user finishes editing a row (data-bound controls finish editing a row when they leave that row, even if no changes have been made).
Error | Fired when an exception (error condition) occurs. Gives the programmer an opportunity to handle exceptions (so normal execution can be resumed), show custom error messages and customize/localize error message texts.
FieldChange | Fired when a field value is set. Inside this event, your code can set other fields triggering recursive FieldChange events, C1DataExpress handles this situation correctly. Only after all changes are done and handled, AfterChanges event is triggered.
Fill | Before/AfterFill events are fired both in C1ExpressTable (for each table) and in C1ExpressConnection (once for all tables attached to it) before and after data is fetched from the database.
FirstChange | Fired when a first change is made to the row (a field value changed) after BeginEdit.
GenerateSQL | Fired before/after executing an SQL command to fetch data from the database. Can be used to customize the SQL SELECT statement used in that command.
PositionChanged | Fired when a new row becomes current. Current row is the row on which the end user is currently positioned (controlled by a CurrencyManager, see System.Windows.Forms.CurrencyManager class in the .NET Framework documentation.
UpdateError | Fired when an error occurs in database update, allowing to resolve the error condition. This event is fired both in C1ExpressTable and C1ExpressConnection components. For details on the database update process and how it can be customized with event code, including reconciling multi-user concurrency conflicts, see Updating the Database in C1DataObjects documentation.
UpdateRow | Fired when a modified row is committed (updated) to the database. This event is fired in a C1ExpressConnection component. For details on the database update process and how it can be customized with event code, see Updating the Database in C1DataObjects documentation.
Update | Fired before/after all modified rows are committed (updated) to the database. This event is fired in a C1ExpressConnection component.


C1ExpressConnection: Combining Tables into Data Sets

C1ExpressConnection: Combining Tables into Data Sets

A C1ExpressionConnection component is used when it is necessary to combine several tables into a single data set. C1ExpressionTable components are attached to a C1ExpressConnection component by setting their ConnectionComponent property. These tables share a common database connection and a common row cache (data set). They can share the same data, for instance, if two C1ExpressTable components represent the same database table, or if one of them is a composite table including a database table that is also used in the other. In this case, if they share the same connection, changing data in one of them will be reflected in all others that include the affected rows. Updating modified data to the database is done for all tables sharing the connection as a whole, in one transaction. This is why the Update method belongs to the C1ExpressConnection component.

Conversely, two or more stand-alone C1TableExpress components, not attached to a common C1ExpressConnection, use separate database connections and have completely independent copies of data (row cache).


Defining Relations

Defining Relations

C1ExpressConnection component is also used for defining relations between tables. To open the Relations editor, select Edit Relations from the context menu or press the Relations property button.

To create a relation, select parent and child tables in corresponding combo boxes (if one or both of them are composite tables, you also need to select a constituent simple table in the “use fields of” combo box below). Then add one or more joins – equalities between a parent field and a child field.

Relations are used for two purposes master-detail relations and referential integrity (foreign key constraints).


Master-Detail Relations

Master-Detail Relations

When master-detail relations are defined between tables in a C1ExpressConnection component, they can be used to build data-bound master-detail forms and to navigate parent/child rows programmatically (with GetChildRow(s)/GetParentRow(s) methods). To create a master-detail relation, check the Master-detail check box in Relations editor.

Having a master-detail relation, you can bind two data-aware controls, one to the master and the other to the detail, and the detail control will follow the master, will be automatically populated with child rows of the parent row on which the master is currently positioned. In presence of master-detail relations, the DataMember combo box of a data-aware control shows tables participating in the master-detail hierarchy preceding with underscore, whereas the same tables regarded as stand-alone (not restricted by master-detail relations) are shown without underscore. For example, if you have a “Customers – Orders” relation, this is how you can bind a master and a detail grid:

· Visual Basic

· C#

· Delphi


Enforcing Referential Integrity (Foreign Key) Constraints

Enforcing Referential Integrity (Foreign Key) Constraints

For instance, in the Orders table or in a composite table CustomersOrders we would like to disallow assigning a value to CustomerID that is not present in the Customers table. To create a referential integrity constraint relation, check the Enforce constraints check box. A relation can be a master-detail relation and a referential integrity constraint simultaneously.

By default, M-1 joins in a composite table define a referential integrity constraint. So, for example, in a composite table CustomersOrders it is not allowed to enter CustomerID that is not present in the Customers table. If you want to change this behavior, define a relation with the same joins as used in the composite table and uncheck the Enforce constraints check box.


Relation Properties

Relation Properties

GetRowsEvent | This property is False by default. If set to True, the relation becomes custom. That means that it is not based on joins, equalities between table fields, but child rows are obtained by code in the GetChildRows event. It is used when you need a more complicated algorithm than simple equality of table fields. For example, see the CustomRelations sample in the Samples directory, where a custom relation is used to represent a many-to-many relation that cannot be based on a single simple relation between tables.
DeleteCascadeRule | This property specifies what happens to child rows when their parent row is deleted. None (default) means that child rows are left unchanged. As a result of deleting the parent row, they become orphan rows, without parent. The Cascade value means that child rows are deleted. Set this property to Cascade when child rows belong to their parent, should not exist without it. There are also two less frequently used values: SetNull meaning that child rows remain with related field(s) set to Null, and SetDefault meaning that child rows remain with related field(s) set to its default value.
UpdateCascadeRule | This property determines what happens to child fields when parent field values are changed. If it is set to Cascade (default), the child fields are changed correspondingly. If it is set to None, the child fields are left unchanged. If it is set to SetNull, the child fields are set to Null. If it is set to SetDefault, the child fields are set to their default values.


C1ExpressView: Filtering, Sorting and Working with Tables in Other Forms

C1ExpressView: Filtering, Sorting and Working with Tables in Other Forms

C1ExpressView is a component that can serve as a data source for data-aware controls, along with C1ExpressTable and C1ExpressConnection. It provides a view of a C1ExpressTable. This view can include only rows satisfying certain filter conditions, if such conditions are specified. This view can also sort the rows in a certain order. All these views are independent from one another, so you can show the same data filtered and sorted according to different conditions. Also, each C1ExpressView, being an independent data source, maintains its own current row, so you can use several views with a single C1ExpressTable if you need several representations with independent current row.

C1ExpressView also serves to allow binding of data-aware controls in one form to C1ExpressTable components residing in another form, see Working with Tables in Other Forms.

To attach a C1ExpressView to a C1ExpressTable component, set the ExpressTable property (or ExpressTableName if you need to attach it to a C1ExpressTable residing in another form).

To sort C1ExpressView rows, set the Sort property to the sort field name. To sort by multiple fields use coma as the delimiter:

To filter C1ExpressView rows, restrict the C1ExpressView rowset to only those rows that satisfy a certain condition, set the RowFilter property to a filter expression. For example,

· Visual Basic

· C#

· Delphi

See C1DataObjects Expressions for a description of C1DataObjects expression language.

C1ExpressView also allows to filter by row state, showing, for example, only added rows, or only modified rows, or deleted rows (note that this is the only way to access deleted rows), or original rows (original rows are the rows with their respective field values as they were fetched from the database, before any user modifications made to them). To filter rows by row state, use the RowFilter property which can have one of the following values (default: Current):

Added | New rows.
CurrentRows | Current rows including unchanged, new, and modified rows.
Deleted | Deleted rows.
ModifiedCurrent | Current rows excluding new and unchanged rows.
ModifiedOriginal | Original rows excluding deleted and unchanged rows.
OriginalRows | Original rows including deleted and unchanged rows.
Unchanged | Unchanged rows.


Working with Tables in Other Forms

Working with Tables in Other Forms

Using C1ExpressView you can bind data-aware controls to the data of a C1ExpressTable residing in a different form. To attach a C1ExpressView component to a C1ExpressTable component from a different form, open the form containing the C1ExpressTable component and select the component name in the ExpressTableName combo box. The ExpressTableName combo box contains all C1ExpressTable components in the forms currently open in the environment. Having selected an ExpressTableName value, you will see that the ExpressTable property has changed correspondingly. After that, you can bind data-aware controls to the C1ExpressView component.


Notes for Users of C1DataObjects Enterprise Edition

Notes for Users of C1DataObjects Enterprise Edition

If you are familiar with ComponentOne DataObjects Enterprise Edition, it may be helpful to understand the relationship between C1DataObjects and C1DataExpress.

C1DataExpress is a simplified version of C1DataObjects. It makes working with data very simple and straightforward and is more easy to master than C1DataObject Enterprise Edition. C1DataExpress is intended for small to medium projects where full power of C1DataObjects is not required.

C1DataExpress resides in a separate assembly, c1.data.express.dll that uses the C1DataObjects assembly c1.data.dll. C1DataExpress added three components to C1DataObjects: C1ExpressTable, C1ExpressConnection and C1ExpressView.

C1DataExpress always works in direct client mode (see Direct Client in C1DataObjects documentation), it does not support 3-tier configuration and data libraries.

C1DataExpress does not use Schema Designer and does not require creating C1DataSet components on user forms. A C1DataSet object and a corresponding schema is generated automatically for each C1ExpressConnection component and can be accessed through its DataSet property:

for a C1ExpressConnection component with attached C1ExpressTable components:

· Visual Basic

· C#

· Delphi

for a stand-alone C1ExpressConnection component:

· Visual Basic

· C#

· Delphi


C1DataExpress Tutorials

C1DataExpress Tutorials

Note: If you are running the pre-built tutorial projects included in C1DataExpress installation, please be aware that the projects have the sample database location hardcoded in the connection string:

C:\Program Files\ComponentOne Studio.NET\Common\NWIND.MDB

If you have the Northwind database (standard MS Access sample database included in Visual Studio 6) installed in a different location, you can either change the connection string in tutorial projects or copy the NWIND.MDB file to the required location.

Tutorial 1 - Binding to a simple table

Tutorial 2 - Creating a Composite Table

Tutorial 3 - C1ExpressConnection and Master-Detail Relations

Tutorial 4 - Using C1ExpressView Component

Tutorial 5 - Customizing Data Behavior with Events


Tutorial 1 - Binding to a simple table

Tutorial 1 – Binding to a simple table

In this tutorial, you will see how easy it is to bind to simple database table data using C1DataExpress.

1. Create a new Windows Application project. Make sure the C1DataExpress components are added to your Visual Studio toolbox as described in the installation instructions.

2. Place the following components on the form as shown in the figure: c1ExpressTable (C1.Data.Express.C1ExpressTable), dataGrid1 (System.Windows.Forms.DataGrid), a label, a check box and a command button:

In this tutorial we intentionally use Microsoft DataGrid, not a ComponentOne grid control. It is meant to show that C1DataExpress can serve as a data source to any data-bound GUI controls adhering to .NET data binding specification. All other tutorials will use ComponentOne TrueDBGrid. Naturally, we recommend ComponentOne grid and other presentation controls, both because they are the best and because they are most closely integrated with C1DataExpress. Most C1DataExpress features (all features that rely only on standard .NET data binding) will work with any third-party data-bound control. However, one important feature, Virtual Mode requires that you use a ComponentOne data bound grid (if you need a grid at all).

3. Select the c1ExpressTable1 component, go to the properties window, open the ConnectionString property combo box and select <New Connection…>. It will open the standard OLE DB Data Link Properties dialog. Select the provider, the database and other necessary connection properties in that dialog. In this tutorial, we use the standard MS Access Northwind sample database (NWIND.MDB). Select “Microsoft Jet 4.0 OLE DB Provider” in the Provider tab, and “C:\Program Files\ComponentOne Studio.NET\Common\NWIND.MDB” (or another location, where your database is) in the Connection tab. Press OK. That will close the Data Link Properties dialog and put the connection string in the ConnectionString property.

4. Open the DbTableName property combo box and select Customers from the database table list.

5. Select the dataGrid1 control, go to the Properties window, open the DataSource property combo box and select c1ExpressTable1. This will bind the grid to c1ExpressTable, the Customers fields appear in the grid.

Run the Program and Observe the Following:

· The grid shows the Customers data. Creating a basic data-bound form with C1Expres has been as easy as setting two properties in a single C1ExpressTable component and setting the DataSource property of a data-bound control.

· Close the program and return to the design time environment. We will show you how to access c1DataExpress data programmatically in code.

6. Create an event handler c1ExpressTable1_AfterFill and write the following code there:

· Visual Basic

· C#

· Delphi

The C1ExpressTable.AfterFill event occurs after the table is filled with data. The code shows the number of rows in the table in a label control.

7. Create an event handler button1_Click and write the following code there:

· Visual Basic

· C#

· Delphi

This code sends changes made by the end user to the database.

8. Create an event handler checkBox1_CheckedChanged and write the following code there:

· Visual Basic

· C#

· Delphi

This code toggles the UpdateLeavingRow property value when the check box is checked/unchecked.

Run the Program and Observe the Following:

· If the check box is unchecked, changes made to data in the grid are not saved in the database unless you press the Update button, at which point the changes are saved. You can see that by closing and re-opening the program.

· If the check box is checked, changes are automatically saved in the database when you modify a row and leave it for another row either with keyboard or with the mouse.


Tutorial 2 - Creating a Composite Table

Tutorial 2 – Creating a Composite Table

In this tutorial, you will learn how to work with composite tables in C1DataExpress.

1. Create a new Windows Application project. Place the following components on the form as shown in the figure: c1ExpressTable (C1.Data.Express.C1ExpressTable), c1TrueDBGrid1 (C1.Win.C1TrueDBGrid. C1TrueDBGrid):

2. Set the ConnectionString property of c1ExpressTable1 as in Tutorial 1, Step 3.

3. Select the c1ExpressTable1 component. Open the DbTableName property combo box and select <Composite…>, or, alternatively, select Composite Table Editor from the context menu. The Composite Table Editor dialog will open.

4. In the Composite Table Editor dialog, press the Add table button. In the Add table dialog, select the Orders table and press OK.

5. Open the Add table dialog again, select Order Details. Notice that 1-M relation radio button is selected. Press OK. Notice that the Order Details table has been added to the composite table attached to its parent with a 1-M, one-to-many relation (1-M shown in the table icon).

6. Enter a join connecting the Order Details table to its parent. To do that, press the Add join button, then, in the Add new join dialog, select Parent field: OrderID and Child field: OrderID. Close the Add new join dialog pressing OK, and notice that the following join connects the Order Details table to its parent Orders:

Orders.OrderID = Order Details.OrderID

7. Open the Add table dialog again, select Products. Now select the M-1 relation radio button. Press OK. Notice that the Products table has been added to the composite table attached to its parent with an M-1, many-to-one relation (M-1 shown in the table icon).

8. Enter a join connecting the Parents table to its parent. To do that, press the Add join button, then, in the Add new join dialog, select Parent field: ProductID and Child field: ProductID. Close the Add new join dialog pressing OK, and notice that the following join connects the Products table to its parent Orders:

Order Details.ProductID = Products.ProductID

The overall table structure looks like this:

Orders (1->M) Order Details (M->1) Products

9. Open the Fields editor pressing the button in the Fields property in the properties window or selecting Fields Editor from the context menu. You see only two fields in the editor: OrderID and ProductID. These are primary key fields of the constituent DB tables, they are always present in the composite table fields. Other fields must be explicitly added in the Fields editor. Add the following fields using the Add DB field button: OrderData, ProductName, Quantity. Rearrange the order of fields to your liking using the Move up and Move down buttons. Close the Fields editor dialog pressing OK.

10. Select the c1TrueDBGrid control, go to the Properties window, open the DataSource property combo box and select c1ExpressTable1. This will bind the grid to c1ExpressTable, the composite table fields appear in the grid.

Run the Program and Observe the Following:

· The grid shows the composite table rows containing fields from all three constituent DB tables.

· Try changing the Discount value in the first grid to something greater than 1, and it shows and error. Change a value in the ProductID column and observe that the corresponding value of the ProductName column changes accordingly. C1DataExpress not only populates composite tables automatically (generating SQL statements behind the scenes). Unlike other data frameworks, including ADO.NET, it remains “structure-aware”, preserves the structure of the composite table throughout end user modifications.


Tutorial 3 - C1ExpressConnection and Master-Detail Relations

Tutorial 3 – C1ExpressConnection and Master-Detail Relations

In this tutorial, you will see how to combine multiple tables into a data set, how to specify master-detail relations and to build a master-detail data-bound form.

1. Create a new Windows Application project. Place the following components on the form as shown in the figure: two C1ExpressTable components (C1.Data.Express.C1ExpressTable) c1ExpressTable1,2, a C1ExpressConnection component (C1.Data.Express.C1ExpressConnection) c1ExpressConnection1 and two grids c1TrueDBGrid1,2 (C1.Win.C1TrueDBGrid. C1TrueDBGrid):

2. Set the ConnectionString property of c1ExpressConnection1 as in Tutorial 1, Step 3.

3. Attach the two C1ExpressTable components to the C1ExpressConnection component: select c1ExpressConnection1 in the ConnectionComponent property of each of the two C1ExpressTable components.

4. Make the two C1ExpressTable components represent database tables Customers and Orders, correspondingly: select Customers in the DbTableName property combo box for c1ExpressTable1, and select Orders in the DbTableName property combo box for c1ExpressTable2.

5. Select the c1ExpressConnection component and open its Relations editor dialog selecting Edit Relations from the context menu.

6. In the Relations editor dialog, press the Add button to create a new relation. Select Customers as parent table and Orders as child tables in the combo boxes Parent and Child.

7. Press the Add join button to open the Add new join dialog. Select CustomerID in both Parent field and Child field combo boxes. Close the Add new join dialog pressing OK, and notice that the following join connects the Orders table to its parent table Customers:

Customers.CustomerID = Orders.CustomerID

Press the OK button to close the Relations editor dialog.

8. Select the c1TrueDBGrid1 control, go to the Properties window, open the DataSource property combo box and select c1ExpressTable1. Then open the DataMember property combo box. There you will see table Customers appearing twice, with leading underscore and without it. The one without leading underscore represents a standalone Customers table that is not a part of master-detail hierarchy. The one with leading underscore represents the same Customers table as the root of a master-detail hierarchy. It is also indicated by the presence of the + sign, expanding it you will see the Customers – Orders relation representing the child (detail) node of the hierarchy. Select _Customers in the combo box. That will bind the first grid to the master (parent) table, Customers.

9. Select the second grid, c1TrueDBGrid2, go to the Properties window, open the DataSource property combo box and select c1ExpressConection1. Then open the DataMember property combo box. This time select the child (detail) node of the hierarchy:

_Customers,Customer – Orders

This will bind the second grid to the detail (child) table, Orders.

Run the Program and Observe the Following:

The two grids show customers – orders data in a master-detail hierarchy. When you select a row in the Customers grid, the Orders grid is populated with order information for the selected customer.


Tutorial 4 - Using C1ExpressView Component

Tutorial 4 – Using C1ExpressView Component

In this tutorial, you will see how to use C1ExpressView component to filter and sort table data, and how to bind data-aware controls to table data that is defined in a different form.

1. Take the project built in Tutorial 3 and add a command button to Form1.

Add the following code:

· Visual Basic

· C#

· Delphi

2. Add a new form, Form2 to the project. Place the following components on the form as shown in the figure: c1ExpressView1 component (C1.Data.Express.C1ExpressView) and c1TrueDBGrid1 control (C1.Win.C1TrueDBGrid. C1TrueDBGrid):

3. Select the c1ExpressView1 component, go to the properties window and open the ExpressTableName property combo box. Select Form1.c1ExpressTable1 in the combo box. Make sure that Form1 is open in the Visual Studio design time environment when you do that. The ExpressTableName combo box shows the list of c1ExpressTable controls in the forms that are currently open.

4. Type in the following values of c1ExpressView1 properties:

RowFilter City = ‘London’

Sort ContactName

5. Select the c1TrueDBGrid1 control, go to the Properties window, open the DataSource property combo box and select c1ExpressView1. That will bind the grid to the c1ExpressView1 component.

Run the Program and Observe the Following:

When you press the Show Form2 button, the form appears with the grid filled with filtered and sorted data from the Customers table: it includes only customers from London and is sorted by ContactName. Notice that setting c1ExpressView.Sort is only one (programmatic) of the two possible ways to sort table data, the end user can also sort it interactively in the grid clicking on a column header.


Tutorial 5 - Customizing Data Behavior with Events

Tutorial 5 – Customizing Data Behavior with Events

In this tutorial, you will learn how to use C1ExpressTable events to customize data behavior in code.

1. Repeat steps 1 – 5 of Tutorial 1 to create a form with a grid control bund to a C1ExpressTable component, with one difference: in step 4 select order Details from the database table list. So the C1ExpressTable component will represent database table Order Details.

2. Select the c1ExpressTable1 component and create two event handlers, c1ExpressTable1_BeforeFieldChange and c1ExpressTable1_BeforeEndEdit. Go to the code window and write the following code in the event handlers:

· Visual Basic

· C#

· Delphi

Run the Program and Observe the Following:

· Type 0 in Quantity column and press Enter. The value will be silently changed to 1, as specified in c1ExpressTable1_BeforeFieldChange code.

· Type 2 in Discount column and press Enter. This will result in an error message “Discount must be between 0 and 1”, as specified in c1ExpressTable1_BeforeFieldChange code.

· Type 200 in Quantity column and 1000 in UnitPrice column, then try to leave the row (for example, clicking on another row in the grid). This will result in an error message “Too expensive”, as specified in c1ExpressTable1_BeforeEndEdit code. BeforeEndEdit is not fired immediately when you change a field value; it is fired when you finish editing of a whole row. This is why the error message appears on leaving row, as opposed to the error message in BeforeFieldChange above that is fired immediately before a field value is changed.


Task-Based Help

Task-Based Help

The task-based help assumes that you are familiar with programming in Visual Studio .NET, and know how to use bound controls in general. By following the steps outlined in the help, you will be able to create projects demonstrating a variety of C1Data features and get a good sense of what C1Data can do.

Each task-based help topic also assumes that you have created a new .NET project. For additional information on this topic, see Creating a .NET Project.

Creating a Composite Table at Runtime

Using the Import Wizard

Using the Schema Designer

Using the Conversion Wizard

Using the C1SchemaRef Control

Avoiding a Memory Leak

Eliminating the VsWizard Error


Creating a Composite Table at Runtime

Creating a Composite Table at Runtime

The following Visual Basic code is an example of how to create a composite table at run time. See Composite Tables and Using Composite Tables for additional information.

'Connection string

Private connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + _

"Data Source=C:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;" + _

"Persist Security Info=False"

Private Sub btnFillCategoriesProducts_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFillCategoriesProducts.Click

Dim schemaDef As C1.Data.C1SchemaDef

Dim connection As C1.Data.SchemaObjects.C1OleDbConnection

Dim dbTableCategories As C1.Data.SchemaObjects.DbTable

Dim dbTableProducts As C1.Data.SchemaObjects.DbTable

Dim simpleRelation As C1.Data.SchemaObjects.SimpleRelation

Dim joinCondition As C1.Data.SchemaObjects.JoinCondition

Dim compositeTable As C1.Data.SchemaObjects.CompositeTable

Dim tableViewCategories As C1.Data.SchemaObjects.TableView

Dim tableViewProducts As C1.Data.SchemaObjects.TableView

Dim viewRelation As C1.Data.SchemaObjects.ViewRelation

Dim dataSetDef As C1.Data.SchemaObjects.DataSetDef

Dim tableView As C1.Data.SchemaObjects.TableView

Dim dataSet As C1.Data.C1DataSet

'Create Schema (C1SchemaDef) object

schemaDef = New C1.Data.C1SchemaDef()

'Create a connection

connection = New C1.Data.SchemaObjects.C1OleDbConnection(schemaDef.Schema)

connection.ConnectionString = connectionString

connection.Name = "Connection"

'Create simple table Categories

dbTableCategories = New C1.Data.SchemaObjects.DbTable(schemaDef.Schema)

dbTableCategories.DbTableName = "Categories"

dbTableCategories.Name = dbTableCategories.DbTableName

dbTableCategories.Connection = connection

CreateCategoriesFields(dbTableCategories)

'Create simple table Products

dbTableProducts = New C1.Data.SchemaObjects.DbTable(schemaDef.Schema)

dbTableProducts.DbTableName = "Products"

dbTableProducts.Name = dbTableProducts.DbTableName

dbTableProducts.Connection = connection

CreateProductsFields(dbTableProducts)

'Establish a simple relation

simpleRelation = New C1.Data.SchemaObjects.SimpleRelation(dbTableCategories, dbTableProducts)

simpleRelation.Name = "Categories - Products"

joinCondition = New C1.Data.SchemaObjects.JoinCondition(simpleRelation.Joins)

joinCondition.ParentField = dbTableCategories.Fields("CategoryID")

joinCondition.ChildField = dbTableProducts.Fields("CategoryID")

'Create a composite table

compositeTable = New C1.Data.SchemaObjects.CompositeTable(schemaDef.Schema)

compositeTable.Name = "CategoriesProducts"

'Create TableView for Categories table

tableViewCategories = New C1.Data.SchemaObjects.CompositeDefView(compositeTable.CompositeTableDef, dbTableCategories)

tableViewCategories.Name = "Categories"

tableViewCategories.RetrieveFields()

'Create TableView for Products table

tableViewProducts = New C1.Data.SchemaObjects.CompositeDefView(compositeTable.CompositeTableDef, dbTableProducts)

tableViewProducts.Name = "Products"

tableViewProducts.RetrieveFields()

'Create ViewRelation between the TableViews

viewRelation = New C1.Data.SchemaObjects.CompositeDefRelation(compositeTable.CompositeTableDef, simpleRelation)

viewRelation.Name = simpleRelation.Name

viewRelation.Parent = tableViewProducts

viewRelation.Child = tableViewCategories

'Create fields in the composite table (ProductID field is already here)

AddCompositeField("ProductID", compositeTable, tableViewProducts, dbTableProducts)

AddCompositeField("CategoryID", compositeTable, tableViewProducts, dbTableProducts)

AddCompositeField("ProductName", compositeTable, tableViewProducts, dbTableProducts)

AddCompositeField("CategoryName", compositeTable, tableViewCategories, dbTableCategories)

AddCompositeField("Discontinued", compositeTable, tableViewProducts, dbTableProducts)

AddCompositeField("UnitPrice", compositeTable, tableViewProducts, dbTableProducts)

AddCompositeField("QuantityPerUnit", compositeTable, tableViewProducts, dbTableProducts)

'Create DataSetDef object

dataSetDef = New C1.Data.SchemaObjects.DataSetDef(schemaDef.Schema)

dataSetDef.Name = "DataSet"

'Create TableView for the whole composite table

tableView = New C1.Data.SchemaObjects.TableView(dataSetDef, compositeTable)

tableView.Name = "CategoriesProducts"

tableView.RetrieveFields()

'Create C1DataSet to bind to

dataSet = New C1.Data.C1DataSet()

dataSet.SchemaDef = schemaDef

dataSet.DataSetDef = "DataSet"

dataSet.Fill(True)

'Unbind the grid from current data source

gridBound.DataMember = ""

gridBound.DataSource = Nothing

gridBound.ClearFields()

'Bind to CategoriesProducts composite table

gridBound.DataMember = "CategoriesProducts"

gridBound.DataSource = dataSet

'Adjust columns width and format

SetColumnsWidth(gridBound, New Int32() {60, 63, 155, 85, 73, 62, 110})

gridBound.Columns("UnitPrice").NumberFormat = "Currency"

End Sub


Using the Import Wizard

Using the Import Wizard

1. Add a C1SchemaDef control to your form.

2. Right-click the C1SchemaDef component and select Schema Designer from the context menu. The Import Wizard appears.

3. The Import Wizard guides you through the steps of connecting to a database. You can either use an existing connection or create a new one. To use an existing database connection, select it from the Connection string: dropdown list.

To create a new connection:

a. Select “Use new connection string” from the Connection: dropdown list, and check the “Save connection in schema” check box to save it in the schema.

b. Click the ellipsis button under Connection string:. The standard OLE DB Data Link Properties window appears:

· Click the Provider tab and select the data to connect to.

· Click the Connection tab and select a database. Enter a user name and password, if necessary.

· Click the Test Connection button to make sure that you have successfully connected to the database or server and click OK to return to the Import Wizard. The new string appears in the ConnectionString property box.

NOTE: Using OLE DB is only one option. C1Data supports other .NET data providers as well, see Database Connections.The information you must specify depends on the Provider you choose.

4. Enter any information necessary to connect to the specified database in the remaining fields:

Connection type | Choose from BorlandDataProvider, Custom, MSOracle, OLE DB, Oracle, SQL Server
User name | username used to connect to the database
Password | password to connect to the database
Connection timeout | timeout, in seconds
Import objects | Types of objects to import from the database: tables, views, aliases, or any combination of the these

5. Select objects for import from the list of Available tables (also, views and aliases, if included) in the database structure. Click the arrows to move the tables to the Create schema tables box. There is also a check box that determines whether available foreign key information is used to create relations. If it is unchecked, no relations will be created.

6. Click Finish to complete the Import Wizard and open the ComponentOne Data Schema Designer.


Using the Schema Designer

Using the Schema Designer

1. To open the Schema Designer, right-click the C1SchemaDef control and select Schema Designer from the context menu. The Schema Designer appears. NOTE: If you have not imported a database structure, you must use the Import Wizard to do so before using the Schema Designer.

2. Use the View menu to open each window and begin customizing the schema. Select any of the following windows:

Schema graph

Tables and relations are represented in a graphical form in the center Schema – Simple Tables window. Drag and drop the tables to rearrange them.

Tables

The Tables window contains the list of all simple and composite table objects created by the Import Wizard based on the database tables. Double-clicking a table opens the Table Editor, where tables can be added and their properties specified.

For more information on creating and customizing tables, see Simple Tables or Composite Tables.

DataSets

The DataSets window allows you to create and customize data set definitions. Double-clicking a DataSet opens the DataSet Editor, where table views can be added and their properties specified.

For more information, see Data Sets.

Relations

The Relations window contains inter-table relations created by the Import Wizard based on the relationships existing in the database. Double-clicking one of the Relations opens the Relations Editor, where its properties can be specified.

For more information, see Simple Relations.

Connections

The Connections window allows you to define a connection(s) to a database(s). Double-clicking a connection opens the Connection Editor, where it can be edited and its properties can be specified.

For more information, see Database Connections.

Database tables

The Database tables window contains a list of all the tables within the connected database. Change the database connection by clicking the Connect to database button and selecting a connection or creating a new one.

Information

The Information window provides information on the item currently selected within the Schema Designer. For example, if the Products – Order Details relation is selected, the Information window shows the relation and states the relation type, SimpleRelation.

Output

Select Verify schema from the Schema menu, and any errors in the schema are displayed in the Output window. Select Compare Schema with database structure from the Schema menu to scan the schema and database structure. Any differences between them appear in the Output window. Use the dropdown arrow to switch between the Verification and Database structure/Schema differences views.

For more information, see Database Structure Evolution and the Schema.


Using the Conversion Wizard

Using the Conversion Wizard

1. To invoke the wizard, select "Conversion Wizard..." in the context menu of a C1SchemaDef component. This will open the Conversion Wizard dialog box.

2. Select the source of the schema information to be imported:

Import from ADO.NET DataSet | Imports schema from an ADO.NET DataSet. This dataset must be located in a form open in the IDE.
Import from ADO.NET schema file | Imports schema from an ADO.NET schema file (.XSD).
Import from C1DataExpress | Imports schema from C1DataExpress components (C1ExpressTable, C1ExpressConnection).

NOTE: Check the Clear existing schema box if you want to delete the existing schema, and click Next to continue. There must be a Connection object in the schema for bound tables.

3. Select the existing dataset, schema file or component with the schema information:

· If importing from an ADO.NET DataSet, choose an ADO.NET DataSet from the list of dataset components.

· If importing from an ADO.NET schema file, click the ellipsis under Select an XSD file containing an ADO.NET DataSet schema to specify the schema file.

· If importing from C1DataExpress components, choose a C1ExpressConnection or C1ExpressTable component from the list of components. NOTE: You can import a schema from a C1ExpressConnection or from a standalone C1ExpressTable component not connected to a C1ExpressConnection.

4. Define the connection and tables to be used.

NOTE: The Connection section of the Conversion Wizard is the same if you are importing from an ADO.NET DataSet or schema file. If importing from an ADO.NET DataSet or schema file, follow the steps below:

· In the first dropdown box, specify whether the Connection is based on: a new connection string, an existing ADO.NET connection or an existing schema connection.

a. If you select New connection string, specify the Connection type in the next dropdown box and click the ellipsis button next to Connection string to enter the database connection.

b. If you select Existing ADO.NET connection, specify the ADO.NET Connection in the next dropdown box. The connection string is automatically added to the Connection string box.

c. If you select Existing schema connection, select a Schema Connection from the next dropdown box. The connection string is automatically added to the Connection string box.

· Click Next to continue.

· Select tables from the list of Available tables in the database, and click the arrows to move the tables to the Create schema tables box.

NOTE: If you are importing from C1DataExpress components, select Import connection from the selected C1DataExpress component or choose one of the other existing connections from the Connection dropdown box.

5. Click Finish. The final window in the wizard shows the schema objects that have been created. Expand the nodes to see all objects.

6. Click Close and open Schema Designer to complete the wizard.


Using the C1SchemaRef Control

Using the C1SchemaRef Control

1. Add a C1SchemaDef control to your form and create a data schema.

2. Add a new component class file to your project by selecting the File menu and clicking Add New Item…, Component Class.

3. Enter a name for the class in the Name: text box and click Open.

4. Double-click the C1SchemaRef component in the Toolbox to add it to the design surface of the component class file.

5. In the Visual Studio Properties window, set the SchemaDef property of the C1SchemaRef to the C1SchemaDef you created in step 1.

NOTE: When working with multiple files using C1SchemaRef, the file containing the C1SchemaDef component must be open.

6. Add any desired business logic components such as C1TableLogic and C1DataSetLogic to the component class file.

7. For each business logic component, set its SchemaComponent property to the C1SchemaRef component added in step 4.

8. If a C1TableLogic component was added, choose a table from the Table property dropdown box in the Visual Studio properties window. If a C1DataSetLogic component was added, select a data set from the DataSetDef property dropdown box.

9. In the initialization section of your code, call C1SchemaDef.Add to add a SchemaRef component to the list of C1SchemaRef components associated with the c1SchemaDef component.


Avoiding a Memory Leak

Avoiding a Memory Leak

It is possible you may experience a memory leak when using C1Data and C1TrueDBGrid. You may lose information, or the memory usage of your program may increase. In order to avoid this problem, try adding the following code to your project:

· Visual Basic

· C#

· Delphi


Eliminating the VsWizard Error

Eliminating the VsWizard Error

In order to remove the error "An object with the program id VsWizard.VsWizardEngine could not be created", perform the following steps:

1. Locate the C1DataAddClassWiz.vsz and C1DataDLL.vsz files:

· For Visual Basic.NET:

...\Microsoft Visual Studio .NET 2003\VB7\VBProjectItems\Local Project
Items\C1DataObjects\C1DataAddClassWiz.vsz

...\Microsoft Visual Studio .NET 2003\VB7\VBProjects\C1DataDLL.vsz

· For C#.NET:

...\Microsoft Visual Studio .NET 2003\VC#\CSharpProjectItems\Local
Project Items\C1DataObjects\C1DataAddClassWiz.vsz

...\Microsoft Visual Studio .NET 2003\VC#\CSharpProjects\C1DataDLL.vsz

2. For Visual Studio 2002, the .vsz files contain the line Wizard=VsWizard.VsWizardEngine. For Visual Studio 2003, change this line to Wizard=VsWizardEngine.7.1.


C1.Data Assembly

C1.Data Assembly

Namespaces

C1.Data

C1.Data.SchemaObjects

See Also

C1.Data.Express Assembly


C1.Data.Express Assembly

C1.Data.Express Assembly

Namespaces

C1.Data.Express

See Also

C1.Data Assembly


C1.Data Namespace

C1.Data Namespace

C1.Data Hierarchy

Classes

Class

Description

BaseComponent

Base class for all C1DataObjects components.

BaseDataSourceComponent

Base class for C1DataTableSource, C1DataView and C1DataExpress components.

BaseDataTableSource

Base class for C1DataTableSource and C1DataExpress components.

BaseFormAwareComponent

Base class for C1DataTableSource, C1DataView and C1DataExpress components.

BaseFormAwareMarshalByValueComponent

Base class for C1DataSet.

BaseLogic

The BaseLogic class is a common base class from which C1TableLogic and C1DataSetLogic component classes are derived.

C1DataException

Base class for all C1DataObjects exception classes.

C1DataRow

Represents a row of data in a C1DataTable object.

C1DataRowCollection

Represents a collection of rows in a C1DataTable object.

C1DataSet

C1DataSet is the main client component of C1DataObjects.

C1DataSetLogic

A C1DataSetLogic component hosts business logic event code for a data set, for all table views of that data set.

C1DataTable

Represents a table or table view rowset filled with data. Provides programmatic access to table view or table data. To obtain a C1DataTable object, use TableViews or Tables collection property of a C1DataSet component.

C1DataTableCollection

Represents a collection of C1DataTable objects.

C1DataTableSource

C1DataTableSource has two main uses:

You can use C1DataTableSource to handle business logic events in your client application code, in addition to the business logic specified in the data library, see Business Logic for details.

You must use C1DataTableSource as the data source for your bound controls to make them work in virtual mode, see Virtual Mode - Dealing with Large Datasets for details.

C1DataTableSource is used as a data source for bound controls, such as grids and others.

C1DataView

C1DataView is used for sorting and filtering data.

C1SchemaDef

The C1SchemaDef component hosts a Schema object that is the basis of a C1DataObjects data library or direct client.

C1SchemaRef

C1SchemaRef components are used in a data library with multiple source code files.

C1TableLogic

A C1TableLogic component hosts business logic event code for a table.

CompositeTableRow

ConstraintCollection

Represents a collection of ConstraintInfo objects.

ConstraintException

Represents the exception that is thrown when attempting an action that violates a constraint.

ConstraintInfo

An element of a field’s Constraints collection.

CurrentRowChangedEventArgs

Provides data for the C1.Data.C1DataSet.CurrentRowChanged event in C1DataSet and C1DataExpress components.

DataActionCanceledException

Represents an exception that is thrown when an action is canceled by throwing an exception in a business logic event (see Business Logic).

DataField

Represents a field of a C1DataTable, an item of the Fields collection.

DataFieldCollection

Represents a collection of DataField objects, fields of a C1DataTable.

DataItem

Represents a C1DataRow exposed to data bound controls. The corresponding C1DataRow object can be obtained as DataItem.DataRow. Alternatively, the same C1DataRow objects can be obtained as FromDataItem(dataItem).

DataSetEventArgs

Provides data for the C1.Data.C1DataSetLogic.BeforeUpdate and C1.Data.C1DataSetLogic.AfterUpdate events.

DbAccessException

Represents an exception that is thrown while performing database access operations fetching data or updating the database.

DisabledOperationException

Represents an exception that is thrown on attempt to perform an action that is disabled by the current property settings.

ErrorEventArgs

ExpressionException

Represents an exception that is thrown when attempting an operation using an invalid field expression.

FetchEventArgs

Provides data for the C1.Data.C1DataSetLogic.BeforeFetch and C1.Data.C1DataSetLogic.AfterFetch events.

FieldCalculationCollection

FieldCalculationInfo

An element of a field’s Calculations collection.

FieldChangeEventArgs

Provides data for AfterFieldChange and BeforeFieldChange events in BaseLogic ( C1TableLogic, C1DataSetLogic) and C1DataExpress components.

FillEventArgs

Provides data for the C1.Data.C1DataSet.BeforeFill and C1.Data.C1DataSet.AfterFill events.

FilterCondition

Specifies a restriction on fetched rows when a table view is filled with data.

FilterConditions

Represents a collection of FilterCondition objects.

GenerateSqlEventArgs

Provides data for the C1.Data.C1DataSetLogic.BeforeGenerateSql and C1.Data.C1DataSetLogic.AfterGenerateSql events.

GetListEventArgs

Provides data for the C1.Data.C1DataSetLogic.GetChildRows, C1.Data.C1DataSetLogic.GetParentRow and C1.Data.C1DataView.GetRows events.

InvalidDataOperationException

Represents an exception that is thrown on attempt to perform an operation that cannot be performed.

OperationFailureException

Represents an exception that is thrown when an operation, such as updating the database, fails.

PositionChangeEventArgs

Provides data for PositionChanged event in C1DataTableSource, C1DataView, C1DataSet and C1DataExpress components.

PropertyCollection

Represents a collection of properties that can be added to C1DataSet, C1DataTable, or TableField.

RemoteDataService

A RemoteDataService-derived class is included in every data library. It is used to support automatic remoting in methods C1DataSet.Fill/Update. Calling C1DataSet.Fill/Update on the client automatically calls RemoteDataService.Fill/Update on the server. RemoteDataService.Fill/Update are virtual methods that can be overridden to customize Fill/Update behavior. Also, new "business" methods can be added to the RemoteDataService-derived class, see Business Methods.

RowChangeEventArgs

Provides data for events which occur when an action is performed on a C1DataRow.

RowUpdateEventArgs

Provides data for the C1.Data.BaseLogic.BeforeUpdateRow and C1.Data.BaseLogic.AfterUpdateRow events.

SchemaBase

The SchemaBase class is a common base class from which C1SchemaDef and C1SchemaRef component classes are derived.

SchemaException

Represents an exception that is thrown at run time when C1DataObjects encounters errors in the schema specified in a C1SchemaDef component. Most of such errors can be detected at design time performing schema verification (select Verify schema from the Schema menu in Schema Designer).

SessionCacheProperties

The SessionCacheProperties class is used to specify settings for session cache.

UnboundDataReader

UnboundDataReader is a helper class used in supporting unbound tables in the C1.Data.C1DataSetLogic.BeforeFetch event. The data is passed to its constructor in a System.Data.DataTable object. It implements the System.Data.IDataReader interface.

Delegates

Delegate | Description
CurrentRowChangedEventHandler | Represents the method that handles the CurrentRowChanged event in C1DataSet and C1DataExpress components.
DataSetEventHandler | Represents the method that handles the C1.Data.C1DataSetLogic.BeforeUpdate and C1.Data.C1DataSetLogic.AfterUpdate events.
FetchEventHandler | Represents the method that handles the C1.Data.C1DataSetLogic.BeforeFetch and C1.Data.C1DataSetLogic.AfterFetch events.
FieldChangeEventHandler | Represents the method that handles BeforeFieldChange and AfterFieldChange events.
FillEventHandler | Represents the method that handles the C1.Data.C1DataSet.BeforeFill and C1.Data.C1DataSet.AfterFill events.
GenerateSqlEventHandler | Represents the method that handles the C1.Data.C1DataSetLogic.AfterGenerateSql and C1.Data.C1DataSetLogic.BeforeGenerateSql events.
GetListEventHandler | Represents the method that handles the C1.Data.C1DataSetLogic.GetChildRows, C1.Data.C1DataSetLogic.GetParentRow and C1.Data.C1DataView.GetRows events.
PositionChangeEventHandler | Represents the method that handles the PositionChanged event in C1DataTableSource, C1DataView, C1DataSet and C1DataExpress components.
RowChangeEventHandler | Represents the method that handles events which occur when an action is performed on a C1DataRow.
RowUpdateEventHandler | Represents the method that handles the C1.Data.BaseLogic.BeforeUpdateRow and C1.Data.BaseLogic.AfterUpdateRow events.

Enumerations

Enumeration | Description
CacheModeEnum | Specifies the conditions for enabling caching.
CacheStorageEnum |
CommandTypeEnum | Specifies how a command string is interpreted.
DataObjectsAssemblyFlags | Flags affecting generated classes in the data objects assembly (*.DataObjects.dll).
DataRowActionEnum | Indicates an action performed on a data row.
DataRowStateEnum | Specifies the state of a C1DataRow.
DataRowVersionEnum | Specifies the version of a C1DataRow.
DataSetEventStatusEnum | Indicates status before and after an operation on a table view in a data set or on a whole data set.
DataViewRowStateEnum | Specifies a subset of rows satisfying certain status and version conditions. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
ExecutionModeEnum | Specifies whether actions in handling business object events are deferred or performed immediately.
ListChangedFlags | Specifies how a command string is interpreted.
OperationEnum | Specified an operation performed over data or data components.
RowChangedTypeEnum | Indicates a type of change occurring in C1.Data.C1DataSet.CurrentRowChanged Event.
RowEventStatusEnum | Indicates status before and after an operation on a data row, e.g., committing (updating) the row to the database.
RunsAtEnum | Where the instance of a data library is running.
SqlResultStatusEnum | This enumeration specifies success or failure of a database access operation, including specific reasons of operation failure.

See Also

C1.Data.Express Assembly


BaseComponent Class

BaseComponent Class

Base class for all C1DataObjects components.

For a list of all members of this type, see BaseComponent Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseLogic

C1.Data.SchemaBase

[Visual Basic]

MustInherit Public Class BaseComponent

Inherits Component

[C#]

public abstract class BaseComponent : Component

[Delphi]

type BaseComponent = class abstract (Component);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also


BaseComponent Members

BaseComponent Members

BaseComponent overview


BaseDataSourceComponent Class

BaseDataSourceComponent Class

Base class for C1DataTableSource, C1DataView and C1DataExpress components.

For a list of all members of this type, see BaseDataSourceComponent Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.BaseDataTableSource

C1.Data.C1DataView

[Visual Basic]

MustInherit Public Class BaseDataSourceComponent

Inherits BaseFormAwareComponent

[C#]

public abstract class BaseDataSourceComponent : BaseFormAwareComponent

[Delphi]

type BaseDataSourceComponent = class abstract (BaseFormAwareComponent);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


BaseDataSourceComponent Members

BaseDataSourceComponent Members

BaseDataSourceComponent overview

Public Properties

DataTable | Gets the source C1DataTable containing the data.
Position | Gets or sets the current row position for controls bound to this component.

Public Events

CurrentRowChanged | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged | Fired when controls bound to this component change their current row position.


BaseDataSourceComponent Properties

BaseDataSourceComponent Properties

The properties of the BaseDataSourceComponent class are listed here. For a complete list of BaseDataSourceComponent class members, see the BaseDataSourceComponent Members topic.

Public Properties

DataTable | Gets the source C1DataTable containing the data.
Position | Gets or sets the current row position for controls bound to this component.


BaseDataSourceComponent.DataTable Property

BaseDataSourceComponent.DataTable Property

Gets the source C1DataTable containing the data.

[Visual Basic]

Overridable MustInherit Public ReadOnly Property DataTable As C1DataTable

[C#]

virtual abstract public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;

Remarks

The data table returned by this property is used for programmatic access to the table data.


BaseDataSourceComponent.Position Property

BaseDataSourceComponent.Position Property

Gets or sets the current row position for controls bound to this component.

[Visual Basic]

Public Property Position As Integer

[C#]

public int Position {get;set;}

[Delphi]

public property Position: Int32 read get_Position write set_Position;

Remarks

This property gets or sets the Position property of the CurrencyManager (class System.Windows.Forms.CurrencyManager) controlling current row position for controls bound to the component.


BaseDataSourceComponent Events

BaseDataSourceComponent Events

The events of the BaseDataSourceComponent class are listed here. For a complete list of BaseDataSourceComponent class members, see the BaseDataSourceComponent Members topic.

Public Events

CurrentRowChanged | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged | Fired when controls bound to this component change their current row position.


BaseDataSourceComponent.CurrentRowChanged Event

BaseDataSourceComponent.CurrentRowChanged Event

Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.

[Visual Basic]

Public Event CurrentRowChanged As CurrentRowChangedEventHandler

[C#]

public event CurrentRowChangedEventHandler CurrentRowChanged

[Delphi]

public property CurrentRowChanged: CurrentRowChangedEventHandler read remove_CurrentRowChanged write add_CurrentRowChanged;

Remarks

The CurrentRowChanged event is useful in scenarios like synchronizing detail data with the master row on every change occurring in the master row. The CurrentRowChanged event is triggered in two main cases:

1. When row currency changes, another row becomes current, or the whole rowset is refreshed. In this case, event argument property ChangeType is set to RowChangedTypeEnum.CurrentRowChanged.2. When the value of a field (or several fields) in the current row is changed. In this case, event argument property ChangeType is set to RowChangedTypeEnum.FieldsChanged.


BaseDataSourceComponent.PositionChanged Event

BaseDataSourceComponent.PositionChanged Event

Fired when controls bound to this component change their current row position.

[Visual Basic]

Public Event PositionChanged As PositionChangeEventHandler

[C#]

public event PositionChangeEventHandler PositionChanged

[Delphi]

public property PositionChanged: PositionChangeEventHandler read remove_PositionChanged write add_PositionChanged;

Remarks

Current row position is managed by the form containing this component, by its CurrencyManager object. Data bound controls interact with CurrencyManager to synchronize with current row position and request moving to a new row position.

Whenever current row position changes, the PositionChanged event fires. It allows you to associate business logic with changes in current row position.

See Also

BaseDataSourceComponent Class | BaseDataSourceComponent Members | C1.Data Namespace | C1DataSet Class | C1DataTableSource Class | BaseDataSourceComponent.Position


BaseDataTableSource Class

BaseDataTableSource Class

Base class for C1DataTableSource and C1DataExpress components.

For a list of all members of this type, see BaseDataTableSource Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.BaseDataTableSource

C1.Data.C1DataTableSource

C1.Data.Express.C1ExpressTable

[Visual Basic]

MustInherit Public Class BaseDataTableSource

Inherits BaseDataSourceComponent

Implements IBindingList, ICollection, IEnumerable, IList, ITypedList

[C#]

public abstract class BaseDataTableSource : BaseDataSourceComponent , IBindingList, ICollection, IEnumerable, IList, ITypedList

[Delphi]

type BaseDataTableSource = class abstract (BaseDataSourceComponent, IBindingList, ICollection, IEnumerable, IList, ITypedList);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


BaseDataTableSource Members

BaseDataTableSource Members

BaseDataTableSource overview

Public Properties

CurrentRow | Gets the C1DataRow object representing the current row.
DataTable | Overriden. Gets the source C1DataTable containing the data.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
UpdateLeavingRow | Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.

Public Methods

MoveFirst | Moves to the first row.
MoveLast | Moves to the last row.
MoveNext | Moves to the next row.
MovePrevious | Moves to the previous row.
Seek | Seeks a row by its primary key values.

Public Events

AfterAddNew | Fired after a new (empty) row is added.
AfterBeginEdit | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete | Fired after a row has been deleted.
AfterEndAddNew | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange | Fired after a field value is set.
AfterFirstChange | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AsyncFetchComplete | Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.
BeforeAddNew | Fired before a new (empty) row is added.
BeforeBeginEdit | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete | Fired before a row is deleted.
BeforeEndAddNew | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange | Fired before a field value is set.
BeforeFirstChange | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


BaseDataTableSource Properties

BaseDataTableSource Properties

The properties of the BaseDataTableSource class are listed here. For a complete list of BaseDataTableSource class members, see the BaseDataTableSource Members topic.

Public Properties

CurrentRow | Gets the C1DataRow object representing the current row.
DataTable | Overriden. Gets the source C1DataTable containing the data.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
UpdateLeavingRow | Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.


BaseDataTableSource.CurrentRow Property

BaseDataTableSource.CurrentRow Property

Gets the C1DataRow object representing the current row.

[Visual Basic]

Public ReadOnly Property CurrentRow As C1DataRow

[C#]

public C1DataRow CurrentRow {get;}

[Delphi]

public property CurrentRow: C1DataRow read get_CurrentRow;

Remarks

This property returns the row data controls bound to this component are currently positioned on. The index of this row is returned by the Position property.


BaseDataTableSource.DataTable Property

BaseDataTableSource.DataTable Property

Gets the source C1DataTable containing the data.

[Visual Basic]

Overrides Public ReadOnly Property DataTable As C1DataTable

[C#]

override public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;

Remarks

The data table returned by this property is used for programmatic access to the table data.


BaseDataTableSource.UpdateLeavingRow Property

BaseDataTableSource.UpdateLeavingRow Property

Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.

[Visual Basic]

Public Property UpdateLeavingRow As Boolean

[C#]

public bool UpdateLeavingRow {get;set;}

[Delphi]

public property UpdateLeavingRow: Boolean read get_UpdateLeavingRow write set_UpdateLeavingRow;

Remarks

This property is False by default, which means that you need to call the Update method of the C1DataSet object to commit changes to the database. If it is set True, C1DataObjects automatically calls Update when the user changes a row in a control bound to this component and leaves that row.


BaseDataTableSource Methods

BaseDataTableSource Methods

The methods of the BaseDataTableSource class are listed here. For a complete list of BaseDataTableSource class members, see the BaseDataTableSource Members topic.

Public Methods

MoveFirst | Moves to the first row.
MoveLast | Moves to the last row.
MoveNext | Moves to the next row.
MovePrevious | Moves to the previous row.
Seek | Seeks a row by its primary key values.


BaseDataTableSource.MoveFirst Method

BaseDataTableSource.MoveFirst Method

Moves to the first row.

[Visual Basic]

Public Function MoveFirst() As Boolean

[C#]

public bool MoveFirst()

[Delphi]

public function MoveFirst(): Boolean;

Remarks

Use this method to navigate the underlying rowset in virtual mode. Although this method is applicable in all modes, it is only necessary in virtual mode. In virtual mode, the underlying DataTable contains only a segment of available data. To navigate the whole rowset, you need to use methods MoveFirst, MoveLast, MoveNext, MovePrevious, Seek. If the rowset contains at least one row, this method moves to the first row and returns True; otherwise, it returns False. After this method, properties Position and CurrentRow point to the first row.


BaseDataTableSource.MoveLast Method

BaseDataTableSource.MoveLast Method

Moves to the last row.

[Visual Basic]

Public Function MoveLast() As Boolean

[C#]

public bool MoveLast()

[Delphi]

public function MoveLast(): Boolean;

Remarks

Use this method to navigate the underlying rowset in virtual mode. Although this method is applicable in all modes, it is only necessary in virtual mode. In virtual mode, the underlying DataTable contains only a segment of available data. To navigate the whole rowset, you need to use methods MoveFirst, MoveLast, MoveNext, MovePrevious, Seek. If the rowset contains at least one row, this method moves to the last row and returns True; otherwise, it returns False. After this method, properties Position and CurrentRow point to the first row.


BaseDataTableSource.MoveNext Method

BaseDataTableSource.MoveNext Method

Moves to the next row.

[Visual Basic]

Public Function MoveNext() As Boolean

[C#]

public bool MoveNext()

[Delphi]

public function MoveNext(): Boolean;

Remarks

Use this method to navigate the underlying rowset in virtual mode. Although this method is applicable in all modes, it is only necessary in virtual mode. In virtual mode, the underlying DataTable contains only a segment of available data. To navigate the whole rowset, you need to use methods MoveFirst, MoveLast, MoveNext, MovePrevious, Seek.

If the current row is not the last row in the underlying data table, this method moves to the next row and returns True; otherwise, it returns False. After this method, the Position property is incremented by 1 and the CurrentRow returns the next row.


BaseDataTableSource.MovePrevious Method

BaseDataTableSource.MovePrevious Method

Moves to the previous row.

[Visual Basic]

Public Function MovePrevious() As Boolean

[C#]

public bool MovePrevious()

[Delphi]

public function MovePrevious(): Boolean;

Remarks

Use this method to navigate the underlying rowset in virtual mode. Although this method is applicable in all modes, it is only necessary in virtual mode. In virtual mode, the underlying DataTable contains only a segment of available data. To navigate the whole rowset, you need to use methods MoveFirst, MoveLast, MoveNext, MovePrevious, Seek.

If the current row is not the first row in the underlying data table, this method moves to the next row and returns True; otherwise, it returns False. After this method, the Position property is decremented by 1 and the CurrentRow returns the next row.


BaseDataTableSource.Seek Method

BaseDataTableSource.Seek Method

Seeks a row by its primary key values.

[Visual Basic]

Public Function Seek( _

ByVal key As Object(), _

ByRef exactMatch As Boolean _

) As Boolean

[C#]

public bool Seek(

object[] key,

out bool exactMatch

);

[Delphi]

public function Seek(

key: array of Object;

out exactMatch: Boolean

): Boolean;

Parameters

key

The primary key value to search for.

exactMatch

This parameter is undefined when the method is called. After the method

returns, it contains a value indicating whether the found row contains exactly the key value

the method searched for, or it is the row with the next key value in the primary key order.

It is set to False if the row with exact key match was not found.

Remarks

Use this method to navigate the underlying rowset in virtual mode. In virtual mode, the underlying DataTable contains only a segment of available data. To navigate the whole rowset, you need to use methods MoveFirst, MoveLast, MoveNext, MovePrevious, Seek.

This method seeks for the search key in the whole rowset. If the search key is greater than all the keys in the rowset, the method returns False. Otherwise, it finds the first row with the key greater than or equal to the search key, positions the component on the found row (so the properties Position and CurrentRow point to the found row) and returns true. It also sets the ExactMatch argument to indicate whether an exact match was found or the first row with key value greater than the search key.


BaseDataTableSource Events

BaseDataTableSource Events

The events of the BaseDataTableSource class are listed here. For a complete list of BaseDataTableSource class members, see the BaseDataTableSource Members topic.

Public Events

AfterAddNew | Fired after a new (empty) row is added.
AfterBeginEdit | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete | Fired after a row has been deleted.
AfterEndAddNew | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange | Fired after a field value is set.
AfterFirstChange | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AsyncFetchComplete | Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.
BeforeAddNew | Fired before a new (empty) row is added.
BeforeBeginEdit | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete | Fired before a row is deleted.
BeforeEndAddNew | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange | Fired before a field value is set.
BeforeFirstChange | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


BaseDataTableSource.AfterAddNew Event

BaseDataTableSource.AfterAddNew Event

Fired after a new (empty) row is added.

[Visual Basic]

Public Event AfterAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterAddNew

[Delphi]

public property AfterAddNew: RowChangeEventHandler read remove_AfterAddNew write add_AfterAddNew;

Remarks

This event can be used to fill default values of the fields according to some rules that cannot be specified as simple values of the DefaultValue property. It can also be used to specify the primary key values, see Keys Assigned by Client: New Row Detached and Attached State. The ParentRow argument is used in AfterAddNew event on the data set level (in a C1DataSetLogic component), in a master-detail situation. When a new row is added to the child (detail) table view, this argument contains the parent row to which the new child row belongs. Under other circumstances and in other events this argument contains null. This argument is necessary because in this case parent row cannot be found using the GetParentRow (String), as the new row is yet in detached state, see Keys Assigned by Client: New Row Detached and Attached State. GetParentRow (String) becomes accessible only in the C1.Data.BaseDataTableSource.AfterEndAddNew event.


BaseDataTableSource.AfterBeginEdit Event

BaseDataTableSource.AfterBeginEdit Event

Fired when the user starts editing a row, after the row enters edit mode.

[Visual Basic]

Public Event AfterBeginEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterBeginEdit

[Delphi]

public property AfterBeginEdit: RowChangeEventHandler read remove_AfterBeginEdit write add_AfterBeginEdit;


BaseDataTableSource.AfterCancelEdit Event

BaseDataTableSource.AfterCancelEdit Event

Fired when the user cancels editing a row, after reverting the changes made to the row.

[Visual Basic]

Public Event AfterCancelEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterCancelEdit

[Delphi]

public property AfterCancelEdit: RowChangeEventHandler read remove_AfterCancelEdit write add_AfterCancelEdit;


BaseDataTableSource.AfterChanges Event

BaseDataTableSource.AfterChanges Event

Fired when all changes initiated by a field change are done and handled by the business logic code.

[Visual Basic]

Public Event AfterChanges As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterChanges

[Delphi]

public property AfterChanges: RowChangeEventHandler read remove_AfterChanges write add_AfterChanges;

Remarks

This event occurs when all changes to a row are finished, including both the changes made directly by the user and those resulting from executing event code that handled those changes. It is designed specifically to ensure that this is the “last change”, so the developers can put code that relies on the “finality” of changes to a row. For instance, this event is the best place to put code setting calculated field values (for calculations that cannot be specified as simple calculation expressions.

When a field value in a row changes, that change can be handled by event code that in its turn can make other changes to row fields, or it could change other rows or other tables. When all such handling is done, C1DataObjects collects all changed rows and fires the AfterChanges event for every row that has changed in the process.

Setting the ChangeInProgress property to True, firing AfterChanges event can be deferred until the property is set back to False. This allows multiple field changes to be performed with AfterChanges firing only once, when all changes are done.


BaseDataTableSource.AfterDelete Event

BaseDataTableSource.AfterDelete Event

Fired after a row has been deleted.

[Visual Basic]

Public Event AfterDelete As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterDelete

[Delphi]

public property AfterDelete: RowChangeEventHandler read remove_AfterDelete write add_AfterDelete;

Remarks

To access field values in the deleted row, use the ItemArray argument. The values are not accessible through regular row properties once the row has been deleted.


BaseDataTableSource.AfterEndAddNew Event

BaseDataTableSource.AfterEndAddNew Event

Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.

[Visual Basic]

Public Event AfterEndAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterEndAddNew

[Delphi]

public property AfterEndAddNew: RowChangeEventHandler read remove_AfterEndAddNew write add_AfterEndAddNew;

Remarks

A new row is created empty, filled with default values, its primary key undefined. A row with undefined primary key is in a special transitory state called detached, the process of adding this row to the rowset is yet incomplete. For example, such row will not be sent to the database for update. A row becomes a full-fledged table row only after its primary key is set and any fields with AllowDbNull=false are set too. This is when this event happens.


BaseDataTableSource.AfterEndEdit Event

BaseDataTableSource.AfterEndEdit Event

Fired when the user finishes editing a row, after the row leaves edit mode.

[Visual Basic]

Public Event AfterEndEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterEndEdit

[Delphi]

public property AfterEndEdit: RowChangeEventHandler read remove_AfterEndEdit write add_AfterEndEdit;


BaseDataTableSource.AfterFieldChange Event

BaseDataTableSource.AfterFieldChange Event

Fired after a field value is set.

[Visual Basic]

Public Event AfterFieldChange As FieldChangeEventHandler

[C#]

public event FieldChangeEventHandler AfterFieldChange

[Delphi]

public property AfterFieldChange: FieldChangeEventHandler read remove_AfterFieldChange write add_AfterFieldChange;

Remarks

This event, among other possible actions, allows other fields/rows/tables to be modified depending on this field. The new value is already assigned to the field, and the old field value is also available in this event, in its OldValue argument. Knowing the old value can be useful, for example, in updating counters, where you may need to add the new value and subtract the old one.


BaseDataTableSource.AfterFirstChange Event

BaseDataTableSource.AfterFirstChange Event

Fired after first change is made to a row (a field value changes) after the row last entered edit mode.

[Visual Basic]

Public Event AfterFirstChange As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterFirstChange

[Delphi]

public property AfterFirstChange: RowChangeEventHandler read remove_AfterFirstChange write add_AfterFirstChange;

Remarks

This event occurs after the first change has been successfully performed on a row. It can be used, for example, for showing some user interface clues indicating that the row has been changed (canceling them in C1.Data.BaseDataTableSource.AfterCancelEdit and C1.Data.BaseDataTableSource.AfterEndEdit, if necessary). After the AfterFirstChange event has been fired for the first time, successive changes to row fields do not fire the C1.Data.BaseDataTableSource.BeforeFirstChange/AfterFirstChange events until the row leaves edit mode.


BaseDataTableSource.AsyncFetchComplete Event

BaseDataTableSource.AsyncFetchComplete Event

Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.

[Visual Basic]

Public Event AsyncFetchComplete As EventHandler

[C#]

public event EventHandler AsyncFetchComplete

[Delphi]

public property AsyncFetchComplete: EventHandler read remove_AsyncFetchComplete write add_AsyncFetchComplete;

Remarks

This event is fired if the TableView is in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic. It indicates the end of the fetch process.


BaseDataTableSource.BeforeAddNew Event

BaseDataTableSource.BeforeAddNew Event

Fired before a new (empty) row is added.

[Visual Basic]

Public Event BeforeAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeAddNew

[Delphi]

public property BeforeAddNew: RowChangeEventHandler read remove_BeforeAddNew write add_BeforeAddNew;

Remarks

Throwing an exception in this event cancels adding a row.


BaseDataTableSource.BeforeBeginEdit Event

BaseDataTableSource.BeforeBeginEdit Event

Fired when the user starts editing a row, before the row enters edit mode.

[Visual Basic]

Public Event BeforeBeginEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeBeginEdit

[Delphi]

public property BeforeBeginEdit: RowChangeEventHandler read remove_BeforeBeginEdit write add_BeforeBeginEdit;

Remarks

Throwing an exception in this event prevents the row going into edit mode.

Writing code handling edit mode events, take into account that in addition to explicit programmatic calls to BeginEdit/EndEdit, edit mode is also used by data bound controls: when a row becomes current, it is automatically placed in edit mode (BeginEdit is called implicitly). For example, throwing an exception in BeforeBeginEdit event will prevent bound controls from positioning on a row. This also means that BeforeBeginEdit event does not indicate an attempt to change a row. If you need to execute some code when a row is being changed, consider using C1.Data.BaseDataTableSource.BeforeFirstChange/C1.Data.BaseDataTableSource.AfterFirstChange events instead.


BaseDataTableSource.BeforeCancelEdit Event

BaseDataTableSource.BeforeCancelEdit Event

Fired when the user cancels editing a row, before reverting the changes made to the row.

[Visual Basic]

Public Event BeforeCancelEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeCancelEdit

[Delphi]

public property BeforeCancelEdit: RowChangeEventHandler read remove_BeforeCancelEdit write add_BeforeCancelEdit;

Remarks

Throwing an exception in this event prevents reverting the changes in the row.


BaseDataTableSource.BeforeDelete Event

BaseDataTableSource.BeforeDelete Event

Fired before a row is deleted.

[Visual Basic]

Public Event BeforeDelete As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeDelete

[Delphi]

public property BeforeDelete: RowChangeEventHandler read remove_BeforeDelete write add_BeforeDelete;

Remarks

Throwing an exception in this event cancels deleting the row.


BaseDataTableSource.BeforeEndAddNew Event

BaseDataTableSource.BeforeEndAddNew Event

Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.

[Visual Basic]

Public Event BeforeEndAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeEndAddNew

[Delphi]

public property BeforeEndAddNew: RowChangeEventHandler read remove_BeforeEndAddNew write add_BeforeEndAddNew;

Remarks

Throwing an exception in this event aborts the process of attaching the row (making it a regular, that is, attached) row, as opposed to a just added, or detached row) and aborts EndEdit, if the row is being attached as a result of an EndEdit call.


BaseDataTableSource.BeforeEndEdit Event

BaseDataTableSource.BeforeEndEdit Event

Fired when the user finishes editing a row, before the row leaves edit mode.

[Visual Basic]

Public Event BeforeEndEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeEndEdit

[Delphi]

public property BeforeEndEdit: RowChangeEventHandler read remove_BeforeEndEdit write add_BeforeEndEdit;

Remarks

Throwing an exception in this event prevents the row from leaving edit mode.

Use this event for validating changes done to a row, testing conditions that depend on multiple fields, so these conditions can be tested only when all the changes are done, the whole row changed, as opposed to conditions depending on a single field. The latter are usually tested in the C1.Data.BaseDataTableSource.BeforeFieldChange event. See also ConstraintsFieldLevel, and ConstraintsRecordLevel for alternative, codeless ways of specifying validation conditions.

Writing code handling edit mode events, take into account that in addition to explicit programmatic calls to BeginEdit/EndEdit, edit mode is also used by data bound controls: when a row becomes current, it is automatically placed in edit mode (BeginEdit is called implicitly). When the user moves to another row, the row exits edit mode (EndEdit is called implicitly). For example, throwing and exception in BeforeEndEdit event will prevent bound controls from leaving the row.

If you want to test validation conditions only when the row has been changed while it was in edit mode and not when it was just moved to and out of edit mode without making changes, use the Modified argument to distinguish between these two cases.


BaseDataTableSource.BeforeFieldChange Event

BaseDataTableSource.BeforeFieldChange Event

Fired before a field value is set.

[Visual Basic]

Public Event BeforeFieldChange As FieldChangeEventHandler

[C#]

public event FieldChangeEventHandler BeforeFieldChange

[Delphi]

public property BeforeFieldChange: FieldChangeEventHandler read remove_BeforeFieldChange write add_BeforeFieldChange;

Remarks

This event can be used to specify validation logic that cannot be specified in the form of constraint expressions. Throwing an exception in this event disallows the change. When this event occurs, the field value is not yet modified. The new (proposed) value is available in the NewValue argument of the event.


BaseDataTableSource.BeforeFirstChange Event

BaseDataTableSource.BeforeFirstChange Event

Fired before first change is made to a row (a field value changes) after the row last entered edit mode.

[Visual Basic]

Public Event BeforeFirstChange As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeFirstChange

[Delphi]

public property BeforeFirstChange: RowChangeEventHandler read remove_BeforeFirstChange write add_BeforeFirstChange;

Remarks

Throwing an exception in this event disallows changes to the row.


BaseFormAwareComponent Class

BaseFormAwareComponent Class

Base class for C1DataTableSource, C1DataView and C1DataExpress components.

For a list of all members of this type, see BaseFormAwareComponent Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.Express.C1ExpressConnection

[Visual Basic]

MustInherit Public Class BaseFormAwareComponent

Inherits BaseComponent

[C#]

public abstract class BaseFormAwareComponent : BaseComponent

[Delphi]

type BaseFormAwareComponent = class abstract (BaseComponent);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


BaseFormAwareComponent Members

BaseFormAwareComponent Members

BaseFormAwareComponent overview


BaseFormAwareMarshalByValueComponent Class

BaseFormAwareMarshalByValueComponent Class

Base class for C1DataSet.

For a list of all members of this type, see BaseFormAwareMarshalByValueComponent Members.

System.Object

System.ComponentModel.MarshalByValueComponent

C1.Data.BaseFormAwareMarshalByValueComponent

C1.Data.C1DataSet

[Visual Basic]

MustInherit Public Class BaseFormAwareMarshalByValueComponent

Inherits MarshalByValueComponent

[C#]

public abstract class BaseFormAwareMarshalByValueComponent : MarshalByValueComponent

[Delphi]

type BaseFormAwareMarshalByValueComponent = class abstract (MarshalByValueComponent);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


BaseFormAwareMarshalByValueComponent Members

BaseFormAwareMarshalByValueComponent Members

BaseFormAwareMarshalByValueComponent overview


BaseLogic Class

BaseLogic Class

The BaseLogic class is a common base class from which C1TableLogic and C1DataSetLogic component classes are derived.

For a list of all members of this type, see BaseLogic Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseLogic

C1.Data.C1DataSetLogic

C1.Data.C1TableLogic

[Visual Basic]

MustInherit Public Class BaseLogic

Inherits BaseComponent

[C#]

public abstract class BaseLogic : BaseComponent

[Delphi]

type BaseLogic = class abstract (BaseComponent);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


BaseLogic Members

BaseLogic Members

BaseLogic overview

Public Properties

Schema | Returns or sets the C1SchemaDef component holding the owner schema.
SchemaComponent | This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.

Public Events

AfterAddNew | Fired after a new (empty) row is added.
AfterBeginEdit | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete | Fired after a row has been deleted.
AfterEndAddNew | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange | Fired after a field value is set.
AfterFirstChange | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterUpdateRow | Fired after modifications made to a row are committed to the database.
BeforeAddNew | Fired before a new (empty) row is added.
BeforeBeginEdit | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete | Fired before a row is deleted.
BeforeEndAddNew | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange | Fired before a field value is set.
BeforeFirstChange | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeUpdateRow | Fired before modifications made to a row are committed to the database.
ChangesAccepted | Fired when AcceptChanges has been performed for a table or for the whole data set.
ChangesRejected | Fired when RejectChanges has been performed for a table or for the whole data set.


BaseLogic Properties

BaseLogic Properties

The properties of the BaseLogic class are listed here. For a complete list of BaseLogic class members, see the BaseLogic Members topic.

Public Properties

Schema | Returns or sets the C1SchemaDef component holding the owner schema.
SchemaComponent | This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.


BaseLogic.Schema Property

BaseLogic.Schema Property

Returns or sets the C1SchemaDef component holding the owner schema.

[Visual Basic]

Public ReadOnly Property Schema As C1SchemaDef

[C#]

public C1SchemaDef Schema {get;}

[Delphi]

public property Schema: C1SchemaDef read get_Schema;


BaseLogic.SchemaComponent Property

BaseLogic.SchemaComponent Property

This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.

[Visual Basic]

Public Property SchemaComponent As SchemaBase

[C#]

public SchemaBase SchemaComponent {get;set;}

[Delphi]

public property SchemaComponent: SchemaBase read get_SchemaComponent write set_SchemaComponent;


BaseLogic Events

BaseLogic Events

The events of the BaseLogic class are listed here. For a complete list of BaseLogic class members, see the BaseLogic Members topic.

Public Events

AfterAddNew | Fired after a new (empty) row is added.
AfterBeginEdit | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete | Fired after a row has been deleted.
AfterEndAddNew | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange | Fired after a field value is set.
AfterFirstChange | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterUpdateRow | Fired after modifications made to a row are committed to the database.
BeforeAddNew | Fired before a new (empty) row is added.
BeforeBeginEdit | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete | Fired before a row is deleted.
BeforeEndAddNew | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange | Fired before a field value is set.
BeforeFirstChange | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeUpdateRow | Fired before modifications made to a row are committed to the database.
ChangesAccepted | Fired when AcceptChanges has been performed for a table or for the whole data set.
ChangesRejected | Fired when RejectChanges has been performed for a table or for the whole data set.


BaseLogic.AfterAddNew Event

BaseLogic.AfterAddNew Event

Fired after a new (empty) row is added.

[Visual Basic]

Public Event AfterAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterAddNew

[Delphi]

public property AfterAddNew: RowChangeEventHandler read remove_AfterAddNew write add_AfterAddNew;

Remarks

This event can be used to fill default values of the fields according to some rules that cannot be specified as simple values of the DefaultValue property. It can also be used to specify the primary key values, see Keys Assigned by Client: New Row Detached and Attached State.

The ParentRow argument is used in AfterAddNew event on the data set level (in a C1DataSetLogic component), in a master-detail situation. When a new row is added to the child (detail) table view, this argument contains the parent row to which the new child row belongs. Under other circumstances and in other events this argument contains null. This argument is necessary because in this case parent row cannot be found using the GetParentRow (String), as the new row is yet in detached state, see Keys Assigned by Client: New Row Detached and Attached State. GetParentRow (String) becomes accessible only in the C1.Data.BaseLogic.AfterEndAddNew event.


BaseLogic.AfterBeginEdit Event

BaseLogic.AfterBeginEdit Event

Fired when the user starts editing a row, after the row enters edit mode.

[Visual Basic]

Public Event AfterBeginEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterBeginEdit

[Delphi]

public property AfterBeginEdit: RowChangeEventHandler read remove_AfterBeginEdit write add_AfterBeginEdit;


BaseLogic.AfterCancelEdit Event

BaseLogic.AfterCancelEdit Event

Fired when the user cancels editing a row, after reverting the changes made to the row.

[Visual Basic]

Public Event AfterCancelEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterCancelEdit

[Delphi]

public property AfterCancelEdit: RowChangeEventHandler read remove_AfterCancelEdit write add_AfterCancelEdit;


BaseLogic.AfterChanges Event

BaseLogic.AfterChanges Event

Fired when all changes initiated by a field change are done and handled by the business logic code.

[Visual Basic]

Public Event AfterChanges As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterChanges

[Delphi]

public property AfterChanges: RowChangeEventHandler read remove_AfterChanges write add_AfterChanges;

Remarks

This event occurs when all changes to a row are finished, including both the changes made directly by the user and those resulting from executing event code that handled those changes. It is designed specifically to ensure that this is the “last change”, so the developers can put code that relies on the “finality” of changes to a row. For instance, this event is the best place to put code setting calculated field values (for calculations that cannot be specified as simple calculation expressions.

When a field value in a row changes, that change can be handled by event code that in its turn can make other changes to row fields, or it could change other rows or other tables. When all such handling is done, C1DataObjects collects all changed rows and fires the AfterChanges event for every row that has changed in the process.

Setting the ChangeInProgress property to True, firing AfterChanges event can be deferred until the property is set back to False. This allows multiple field changes to be performed with AfterChanges firing only once, when all changes are done.


BaseLogic.AfterDelete Event

BaseLogic.AfterDelete Event

Fired after a row has been deleted.

[Visual Basic]

Public Event AfterDelete As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterDelete

[Delphi]

public property AfterDelete: RowChangeEventHandler read remove_AfterDelete write add_AfterDelete;

Remarks

To access field values in the deleted row, use the ItemArray argument. The values are not accessible through regular row properties once the row has been deleted.


BaseLogic.AfterEndAddNew Event

BaseLogic.AfterEndAddNew Event

Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.

[Visual Basic]

Public Event AfterEndAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterEndAddNew

[Delphi]

public property AfterEndAddNew: RowChangeEventHandler read remove_AfterEndAddNew write add_AfterEndAddNew;

Remarks

A new row is created empty, filled with default values, its primary key undefined. A row with undefined primary key is in a special transitory state called detached, the process of adding this row to the rowset is yet incomplete. For example, such row will not be sent to the database for update. A row becomes a full-fledged table row only after its primary key is set and any fields with AllowDbNull=false are set too. This is when this event happens.


BaseLogic.AfterEndEdit Event

BaseLogic.AfterEndEdit Event

Fired when the user finishes editing a row, after the row leaves edit mode.

[Visual Basic]

Public Event AfterEndEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterEndEdit

[Delphi]

public property AfterEndEdit: RowChangeEventHandler read remove_AfterEndEdit write add_AfterEndEdit;


BaseLogic.AfterFieldChange Event

BaseLogic.AfterFieldChange Event

Fired after a field value is set.

[Visual Basic]

Public Event AfterFieldChange As FieldChangeEventHandler

[C#]

public event FieldChangeEventHandler AfterFieldChange

[Delphi]

public property AfterFieldChange: FieldChangeEventHandler read remove_AfterFieldChange write add_AfterFieldChange;

Remarks

This event, among other possible actions, allows other fields/rows/tables to be modified depending on this field. The new value is already assigned to the field, and the old field value is also available in this event, in its OldValue argument. Knowing the old value can be useful, for example, in updating counters, where you may need to add the new value and subtract the old one.


BaseLogic.AfterFirstChange Event

BaseLogic.AfterFirstChange Event

Fired after first change is made to a row (a field value changes) after the row last entered edit mode.

[Visual Basic]

Public Event AfterFirstChange As RowChangeEventHandler

[C#]

public event RowChangeEventHandler AfterFirstChange

[Delphi]

public property AfterFirstChange: RowChangeEventHandler read remove_AfterFirstChange write add_AfterFirstChange;

Remarks

This event occurs after the first change has been successfully performed on a row. It can be used, for example, for showing some user interface clues indicating that the row has been changed (canceling them in C1.Data.BaseLogic.AfterCancelEdit and C1.Data.BaseLogic.AfterEndEdit, if necessary). After the C1.Data.BaseLogic.AfterFirstChange event has been fired for the first time, successive changes to row fields do not fire the C1.Data.BaseLogic.BeforeFirstChange/AfterFirstChange events until the row leaves edit mode.


BaseLogic.AfterUpdateRow Event

BaseLogic.AfterUpdateRow Event

Fired after modifications made to a row are committed to the database.

[Visual Basic]

Public Event AfterUpdateRow As RowUpdateEventHandler

[C#]

public event RowUpdateEventHandler AfterUpdateRow

[Delphi]

public property AfterUpdateRow: RowUpdateEventHandler read remove_AfterUpdateRow write add_AfterUpdateRow;

Remarks

The AfterUpdateRow event is fired for every row that fired the C1.Data.BaseLogic.BeforeUpdateRow event, regardless of the outcome of the update operation for that row. If row update was unsuccessful, that is reflected in the values of Status, SqlStatus and Error arguments.

This event can be used to change the outcome of the operation from failure to success and vice versa, see the description of the Status, SqlStatus and Error arguments.

This event can also be used to modify values refreshed from the database after the update operation, see the description of the Row argument.


BaseLogic.BeforeAddNew Event

BaseLogic.BeforeAddNew Event

Fired before a new (empty) row is added.

[Visual Basic]

Public Event BeforeAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeAddNew

[Delphi]

public property BeforeAddNew: RowChangeEventHandler read remove_BeforeAddNew write add_BeforeAddNew;

Remarks

Throwing an exception in this event cancels adding a row.


BaseLogic.BeforeBeginEdit Event

BaseLogic.BeforeBeginEdit Event

Fired when the user starts editing a row, before the row enters edit mode.

[Visual Basic]

Public Event BeforeBeginEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeBeginEdit

[Delphi]

public property BeforeBeginEdit: RowChangeEventHandler read remove_BeforeBeginEdit write add_BeforeBeginEdit;

Remarks

Throwing an exception in this event prevents the row going into edit mode.

Writing code handling edit mode events, take into account that in addition to explicit programmatic calls to BeginEdit/EndEdit, edit mode is also used by data bound controls: when a row becomes current, it is automatically placed in edit mode (BeginEdit is called implicitly). For example, throwing an exception in BeforeBeginEdit event will prevent bound controls from positioning on a row. This also means that BeforeBeginEdit event does not indicate an attempt to change a row. If you need to execute some code when a row is being changed, consider using C1.Data.BaseLogic.BeforeFirstChange/C1.Data.BaseLogic.AfterFirstChange events instead.


BaseLogic.BeforeCancelEdit Event

BaseLogic.BeforeCancelEdit Event

Fired when the user cancels editing a row, before reverting the changes made to the row.

[Visual Basic]

Public Event BeforeCancelEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeCancelEdit

[Delphi]

public property BeforeCancelEdit: RowChangeEventHandler read remove_BeforeCancelEdit write add_BeforeCancelEdit;

Remarks

Throwing an exception in this event prevents reverting the changes in the row.


BaseLogic.BeforeDelete Event

BaseLogic.BeforeDelete Event

Fired before a row is deleted.

[Visual Basic]

Public Event BeforeDelete As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeDelete

[Delphi]

public property BeforeDelete: RowChangeEventHandler read remove_BeforeDelete write add_BeforeDelete;

Remarks

Throwing an exception in this event cancels deleting the row.


BaseLogic.BeforeEndAddNew Event

BaseLogic.BeforeEndAddNew Event

Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.

[Visual Basic]

Public Event BeforeEndAddNew As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeEndAddNew

[Delphi]

public property BeforeEndAddNew: RowChangeEventHandler read remove_BeforeEndAddNew write add_BeforeEndAddNew;

Remarks

Throwing an exception in this event aborts the process of attaching the row (making it a regular, that is, attached) row, as opposed to a just added, or detached row) and aborts EndEdit, if the row is being attached as a result of an EndEdit call.


BaseLogic.BeforeEndEdit Event

BaseLogic.BeforeEndEdit Event

Fired when the user finishes editing a row, before the row leaves edit mode.

[Visual Basic]

Public Event BeforeEndEdit As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeEndEdit

[Delphi]

public property BeforeEndEdit: RowChangeEventHandler read remove_BeforeEndEdit write add_BeforeEndEdit;

Remarks

Throwing an exception in this event prevents the row from leaving edit mode.

Use this event for validating changes done to a row, testing conditions that depend on multiple fields, so these conditions can be tested only when all the changes are done, the whole row changed, as opposed to conditions depending on a single field. The latter are usually tested in the C1.Data.BaseLogic.BeforeFieldChange event. See also ConstraintsFieldLevel, and ConstraintsRecordLevel for alternative, codeless ways of specifying validation conditions.

Writing code handling edit mode events, take into account that in addition to explicit programmatic calls to BeginEdit/EndEdit, edit mode is also used by data bound controls: when a row becomes current, it is automatically placed in edit mode (BeginEdit is called implicitly).

When the user moves to another row, the row exits edit mode (EndEdit is called implicitly). For example, throwing and exception in C1.Data.BaseLogic.BeforeEndEdit event will prevent bound controls from leaving the row.

If you want to test validation conditions only when the row has been changed while it was in edit mode and not when it was just moved to and out of edit mode without making changes, use the Modified argument to distinguish between these two cases.


BaseLogic.BeforeFieldChange Event

BaseLogic.BeforeFieldChange Event

Fired before a field value is set.

[Visual Basic]

Public Event BeforeFieldChange As FieldChangeEventHandler

[C#]

public event FieldChangeEventHandler BeforeFieldChange

[Delphi]

public property BeforeFieldChange: FieldChangeEventHandler read remove_BeforeFieldChange write add_BeforeFieldChange;

Remarks

This event can be used to specify validation logic that cannot be specified in the form of constraint expressions. Throwing an exception in this event disallows the change. When this event occurs, the field value is not yet modified. The new (proposed) value is available in the NewValue argument of the event.


BaseLogic.BeforeFirstChange Event

BaseLogic.BeforeFirstChange Event

Fired before first change is made to a row (a field value changes) after the row last entered edit mode.

[Visual Basic]

Public Event BeforeFirstChange As RowChangeEventHandler

[C#]

public event RowChangeEventHandler BeforeFirstChange

[Delphi]

public property BeforeFirstChange: RowChangeEventHandler read remove_BeforeFirstChange write add_BeforeFirstChange;

Remarks

Throwing an exception in this event disallows changes to the row.


BaseLogic.BeforeUpdateRow Event

BaseLogic.BeforeUpdateRow Event

Fired before modifications made to a row are committed to the database.

[Visual Basic]

Public Event BeforeUpdateRow As RowUpdateEventHandler

[C#]

public event RowUpdateEventHandler BeforeUpdateRow

[Delphi]

public property BeforeUpdateRow: RowUpdateEventHandler read remove_BeforeUpdateRow write add_BeforeUpdateRow;

Remarks

For a bound table, this event can be used to examine and possibly modify the SQL command performing the update.

For an SQL-based table, this event must be used to specify the SQL command performing the update. The IDbCommand object is created and passed as an argument to the event. Event code must set the CommandText property of the command object.

For an unbound table, updating the row must be performed in the event code. C1DataObjects does not create a command object in this case. The result of the update operation must be communicated to C1DataObjects by setting the Status, SqlStatus and Error arguments in the event code.

Although this is less frequently done, the Status, SqlStatus and Error arguments can be changed in event code for bound and SQL-based tables as well as for unbound tables. This too affects the success/failure status of the operations and determines further course of action followed by C1DataObjects.


BaseLogic.ChangesAccepted Event

BaseLogic.ChangesAccepted Event

Fired when AcceptChanges has been performed for a table or for the whole data set.

[Visual Basic]

Public Event ChangesAccepted As RowChangeEventHandler

[C#]

public event RowChangeEventHandler ChangesAccepted

[Delphi]

public property ChangesAccepted: RowChangeEventHandler read remove_ChangesAccepted write add_ChangesAccepted;

Remarks

Calling AcceptChanges triggers this event once in the C1DataSetLogic component attached to the data set definition, if one exists. In this case the e.DataTable argument is null.

Calling AcceptChanges triggers this event in the C1TableLogic component attached to the simple table in question (if such C1TableLogic component exists) and then in the C1DataSetLogic component. In this case, e.DataTable argument points to the C1DataTable for which AcceptChanges was called.

Calling C1DataRow.AcceptChanges also triggers this event in C1TableLogic component and then in C1DataSetLogic component.


BaseLogic.ChangesRejected Event

BaseLogic.ChangesRejected Event

Fired when RejectChanges has been performed for a table or for the whole data set.

[Visual Basic]

Public Event ChangesRejected As RowChangeEventHandler

[C#]

public event RowChangeEventHandler ChangesRejected

[Delphi]

public property ChangesRejected: RowChangeEventHandler read remove_ChangesRejected write add_ChangesRejected;

Remarks

Calling RejectChanges triggers this event once in the C1DataSetLogic component attached to the data set definition, if one exists. In this case the e.DataTable argument is null.

Calling RejectChanges triggers this event in the C1TableLogic component attached to the simple table in question (if such C1TableLogic component exists) and then in the C1DataSetLogic component. In this case, e.DataTable argument points to the C1DataTable for which RejectChanges was called.

Calling RejectChanges also triggers this event in C1TableLogic component and then in C1DataSetLogic component.


C1DataException Class

C1DataException Class

Base class for all C1DataObjects exception classes.

For a list of all members of this type, see C1DataException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.DataActionCanceledException

C1.Data.DbAccessException

C1.Data.DisabledOperationException

C1.Data.ExpressionException

C1.Data.InvalidDataOperationException

C1.Data.OperationFailureException

C1.Data.SchemaException

[Visual Basic]

Public Class C1DataException

Inherits ApplicationException

[C#]

public class C1DataException : ApplicationException

[Delphi]

type C1DataException = class (ApplicationException);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataException Members

C1DataException Members

C1DataException overview

Public Properties

ErrorField | Gets the name of the field where the exception occurred.
ErrorRow | Gets the index of the row where the exception occurred.
ErrorTable | Gets the name of the table or table view where the exception occurred.
IsTable | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


C1DataException Properties

C1DataException Properties

The properties of the C1DataException class are listed here. For a complete list of C1DataException class members, see the C1DataException Members topic.

Public Properties

ErrorField | Gets the name of the field where the exception occurred.
ErrorRow | Gets the index of the row where the exception occurred.
ErrorTable | Gets the name of the table or table view where the exception occurred.
IsTable | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


C1DataException.ErrorField Property

C1DataException.ErrorField Property

Gets the name of the field where the exception occurred.

[Visual Basic]

Public ReadOnly Property ErrorField As String

[C#]

public string ErrorField {get;}

[Delphi]

public property ErrorField: String read get_ErrorField;

Remarks

This property returns empty string if the exception is not related to a particular field.


C1DataException.ErrorRow Property

C1DataException.ErrorRow Property

Gets the index of the row where the exception occurred.

[Visual Basic]

Public ReadOnly Property ErrorRow As Integer

[C#]

public int ErrorRow {get;}

[Delphi]

public property ErrorRow: Int32 read get_ErrorRow;

Remarks

This property returns -1 if the exception is not related to a particular field.


C1DataException.ErrorTable Property

C1DataException.ErrorTable Property

Gets the name of the table or table view where the exception occurred.

[Visual Basic]

Public ReadOnly Property ErrorTable As String

[C#]

public string ErrorTable {get;}

[Delphi]

public property ErrorTable: String read get_ErrorTable;

Remarks

To distinguish between tables and table views, use properties IsTable and IsTableView. This property returns empty string if the exception is not related to a particular table or table view.


C1DataException.IsTable Property

C1DataException.IsTable Property

Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).

[Visual Basic]

Public ReadOnly Property IsTable As Boolean

[C#]

public bool IsTable {get;}

[Delphi]

public property IsTable: Boolean read get_IsTable;


C1DataException.IsTableView Property

C1DataException.IsTableView Property

Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).

[Visual Basic]

Public ReadOnly Property IsTableView As Boolean

[C#]

public bool IsTableView {get;}

[Delphi]

public property IsTableView: Boolean read get_IsTableView;


C1DataException.ShowMessage Property

C1DataException.ShowMessage Property

Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.

[Visual Basic]

Public Property ShowMessage As Boolean

[C#]

public bool ShowMessage {get;set;}

[Delphi]

public property ShowMessage: Boolean read get_ShowMessage write set_ShowMessage;

Remarks

This property is False by default. If an exception generates error messages in bound controls, and you want to suppress them because you already showed an error message or otherwise handled the error in C1DataSet object’s C1.Data.C1DataSet.Error event, set this property to true in the C1.Data.C1DataSet.Error event code. This behavior is only supported by data bound controls honoring the ShowMessage property, such as ComponentOne FlexGrid and C1TrueDBGrid.


C1DataRow Class

C1DataRow Class

Represents a row of data in a C1DataTable object.

For a list of all members of this type, see C1DataRow Members.

System.Object

C1.Data.C1DataRow

[Visual Basic]

Public Class C1DataRow

Implements ICustomTypeDescriptor, IDataErrorInfo, IEditableObject

[C#]

public class C1DataRow : ICustomTypeDescriptor, IDataErrorInfo, IEditableObject

[Delphi]

type C1DataRow = class (TObject, ICustomTypeDescriptor, IDataErrorInfo, IEditableObject);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataRow Members

C1DataRow Members

C1DataRow overview

Public Properties

DataItem | Gets the object representing this row in data binding interface IList.
DataTable | Gets the C1DataTable to which the row belongs.
ExtendedData | Gets a collection of custom user information associated with the row.
HasErrors | Gets a value indicating whether there are errors in some of the row field values.
Item | Overloaded. Gets or sets the data stored in the row in one of the fields.
ItemArray | Gets or sets all of the field values for this row through an array.
Modified | For a row in edit mode, gets a value indicating whether at least one of row values has been changed.
Ordinal | Gets the position of the row in the C1DataRowCollection.
RowError | Gets or sets the custom error description for a row.
RowState | Gets the current state of the row.
StorageDataRow | Gets the ADO.NET DataRow object storing data of this C1DataRow.

Public Methods

AcceptChanges | Commits all the changes made to the row since the last time AcceptChanges or RejectChanges was called.
BeginEdit | Begins an edit operation on the row.
CancelEdit | Cancels the current edit on the row.
ClearErrors | Clears the errors for the row, including the RowError and errors set with SetFieldError (Int32, String).
Delete | Deletes the row.
EndEdit | Ends the edit on the row.
FromDataItem | Gets the C1DataRow object associated with a row object (data item) obtained from data binding.
GetChildRows | Overloaded. Gets the child rows of this C1DataRow using the specified relation.
GetFieldError | Overloaded. Gets the error description for a field.
GetFieldsInError | Gets an array of fields that have errors in this row.
GetParentRow | Overloaded. Gets the parent row of this C1DataRow using the specified relation.
HasVersion | Gets a value indicating whether a specified row version exists.
IsNull | Overloaded. Gets a value indicating whether the specified field contains a null value in this row.
Refresh | Refreshes field values in the row.
RejectChanges | Rolls back all the changes made to the row since the last time AcceptChanges or RejectChanges was called.
SetFieldError | Overloaded. Sets the error description for a field in the row.
SetNull | Sets the value of the specified field to null.
SetRowStateModified | Changes RowState from Unchanged to Modified without modifying any field in the row.


C1DataRow Properties

C1DataRow Properties

The properties of the C1DataRow class are listed here. For a complete list of C1DataRow class members, see the C1DataRow Members topic.

Public Properties

DataItem | Gets the object representing this row in data binding interface IList.
DataTable | Gets the C1DataTable to which the row belongs.
ExtendedData | Gets a collection of custom user information associated with the row.
HasErrors | Gets a value indicating whether there are errors in some of the row field values.
Item | Overloaded. Gets or sets the data stored in the row in one of the fields.
ItemArray | Gets or sets all of the field values for this row through an array.
Modified | For a row in edit mode, gets a value indicating whether at least one of row values has been changed.
Ordinal | Gets the position of the row in the C1DataRowCollection.
RowError | Gets or sets the custom error description for a row.
RowState | Gets the current state of the row.
StorageDataRow | Gets the ADO.NET DataRow object storing data of this C1DataRow.


C1DataRow.DataItem Property

C1DataRow.DataItem Property

Gets the object representing this row in data binding interface IList.

[Visual Basic]

Public ReadOnly Property DataItem As DataItem

[C#]

public DataItem DataItem {get;}

[Delphi]

public property DataItem: DataItem read get_DataItem;


C1DataRow.DataTable Property

C1DataRow.DataTable Property

Gets the C1DataTable to which the row belongs.

[Visual Basic]

Public ReadOnly Property DataTable As C1DataTable

[C#]

public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;


C1DataRow.ExtendedData Property

C1DataRow.ExtendedData Property

Gets a collection of custom user information associated with the row.

[Visual Basic]

Public Property ExtendedData As Object

[C#]

public object ExtendedData {get;set;}

[Delphi]

public property ExtendedData: Object read get_ExtendedData write set_ExtendedData;


C1DataRow.HasErrors Property

C1DataRow.HasErrors Property

Gets a value indicating whether there are errors in some of the row field values.

[Visual Basic]

Public ReadOnly Property HasErrors As Boolean

[C#]

public bool HasErrors {get;}

[Delphi]

public property HasErrors: Boolean read get_HasErrors;

Remarks

Validating data, you can set an error on any field in a row. Data bound controls can use this information to show user interface clues for errors.

Also, an error can be assigned to a whole row using the RowError property. Update errors occurring in specific rows set the RowError property for rows with errors.

Use SetFieldError (Int32, String) to set an error on a field, and RowError property to set an error for the whole row.

Use the GetFieldError (Int32) and GetFieldsInError methods to return field errors.

Use the RowError property to return error information for the whole row.

The ClearErrors method clears all errors for the row.


C1DataRow.Item Property

C1DataRow.Item Property

Overload List

Gets or sets the data stored in the row in one of the fields.

[Visual Basic] Overloads Public Default Property Item(DataField) As Object

[C#] public object this[DataField]{get;set;}

[Delphi] public property Item[field: DataField]: Object read get_Item write set_Item;

Gets or sets the data stored in the row in one of the fields.

[Visual Basic] Overloads Public Default ReadOnly Property Item(DataField, DataRowVersionEnum) As Object

[C#] public object this[DataField, DataRowVersionEnum]{get;}

[Delphi] public property Item[field: DataField]: Object read get_Item;

Gets or sets the data stored in the row in one of the fields.

[Visual Basic] Overloads Public Default Property Item(Integer) As Object

[C#] public object this[int]{get;set;}

[Delphi] public property Item[fieldIndex: Int32]: Object read get_Item write set_Item;

Gets or sets the data stored in the row in one of the fields.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer, DataRowVersionEnum) As Object

[C#] public object this[int, DataRowVersionEnum]{get;}

[Delphi] public property Item[fieldIndex: Int32]: Object read get_Item;

Gets or sets the data stored in the row in one of the fields.

[Visual Basic] Overloads Public Default Property Item(String) As Object

[C#] public object this[string]{get;set;}

[Delphi] public property Item[fieldName: String]: Object read get_Item write set_Item;

Gets or sets the data stored in the row in one of the fields.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String, DataRowVersionEnum) As Object

[C#] public object this[string, DataRowVersionEnum]{get;}

[Delphi] public property Item[fieldName: String]: Object read get_Item;


C1DataRow.Item Property (DataField)

C1DataRow.Item Property (DataField)

Gets or sets the data stored in the row in one of the fields.

[Visual Basic]

Public Default Property Item( _

ByVal field As DataField _

) As Object

[C#]

public object this[

DataField field

] {get;set;}

[Delphi]

public property Item[

field: DataField

]: Object read get_Item write set_Item;

Parameters

field

The data field that contains the data.

Property Value

An Object that contains the data.


C1DataRow.Item Property (DataField, DataRowVersionEnum)

C1DataRow.Item Property (DataField, DataRowVersionEnum)

Gets or sets the data stored in the row in one of the fields.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal field As DataField, _

ByVal version As DataRowVersionEnum _

) As Object

[C#]

public object this[

DataField field,

DataRowVersionEnum version

] {get;}

[Delphi]

public property Item[

field: DataField;

version: DataRowVersionEnum

]: Object read get_Item;


C1DataRow.Item Property (Int32)

C1DataRow.Item Property (Int32)

Gets or sets the data stored in the row in one of the fields.

[Visual Basic]

Public Default Property Item( _

ByVal fieldIndex As Integer _

) As Object

[C#]

public object this[

int fieldIndex

] {get;set;}

[Delphi]

public property Item[

fieldIndex: Int32

]: Object read get_Item write set_Item;

Parameters

fieldIndex

The zero-based index of the field.

Property Value

An Object that contains the data.


C1DataRow.Item Property (Int32, DataRowVersionEnum)

C1DataRow.Item Property (Int32, DataRowVersionEnum)

Gets or sets the data stored in the row in one of the fields.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal fieldIndex As Integer, _

ByVal version As DataRowVersionEnum _

) As Object

[C#]

public object this[

int fieldIndex,

DataRowVersionEnum version

] {get;}

[Delphi]

public property Item[

fieldIndex: Int32;

version: DataRowVersionEnum

]: Object read get_Item;


C1DataRow.Item Property (String)

C1DataRow.Item Property (String)

Gets or sets the data stored in the row in one of the fields.

[Visual Basic]

Public Default Property Item( _

ByVal fieldName As String _

) As Object

[C#]

public object this[

string fieldName

] {get;set;}

[Delphi]

public property Item[

fieldName: String

]: Object read get_Item write set_Item;

Parameters

fieldName

The name of the field.

Property Value

An Object that contains the data.


C1DataRow.Item Property (String, DataRowVersionEnum)

C1DataRow.Item Property (String, DataRowVersionEnum)

Gets or sets the data stored in the row in one of the fields.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal fieldName As String, _

ByVal version As DataRowVersionEnum _

) As Object

[C#]

public object this[

string fieldName,

DataRowVersionEnum version

] {get;}

[Delphi]

public property Item[

fieldName: String;

version: DataRowVersionEnum

]: Object read get_Item;


C1DataRow.ItemArray Property

C1DataRow.ItemArray Property

Gets or sets all of the field values for this row through an array.

[Visual Basic]

Public Property ItemArray As Object()

[C#]

public object[] ItemArray {get;set;}

[Delphi]

public property ItemArray: array of Object read get_ItemArray write set_ItemArray;


C1DataRow.Modified Property

C1DataRow.Modified Property

For a row in edit mode, gets a value indicating whether at least one of row values has been changed.

[Visual Basic]

Public ReadOnly Property Modified As Boolean

[C#]

public bool Modified {get;}

[Delphi]

public property Modified: Boolean read get_Modified;

Remarks

For a row not in edit mode (not between BeginEdit and EndEdit), this property returns False. In this case, use the RowState property to determine if the row was changed.


C1DataRow.Ordinal Property

C1DataRow.Ordinal Property

Gets the position of the row in the C1DataRowCollection.

[Visual Basic]

Public ReadOnly Property Ordinal As Integer

[C#]

public int Ordinal {get;}

[Delphi]

public property Ordinal: Int32 read get_Ordinal;


C1DataRow.RowError Property

C1DataRow.RowError Property

Gets or sets the custom error description for a row.

[Visual Basic]

Public Property RowError As String

[C#]

public string RowError {get;set;}

[Delphi]

public property RowError: String read get_RowError write set_RowError;

Remarks

See HasErrors for details.


C1DataRow.RowState Property

C1DataRow.RowState Property

Gets the current state of the row.

[Visual Basic]

Public ReadOnly Property RowState As DataRowStateEnum

[C#]

public DataRowStateEnum RowState {get;}

[Delphi]

public property RowState: DataRowStateEnum read get_RowState;

Remarks

Modifying field values, deleting a row and adding a row changes the row state. While the row is in edit mode (see BeginEdit), the state does not change on field modifications until EndEdit is called (see also Modified property). Calling AcceptChanges or RejectChanges resets the state of all rows.


C1DataRow.StorageDataRow Property

C1DataRow.StorageDataRow Property

Gets the ADO.NET DataRow object storing data of this C1DataRow.

[Visual Basic]

Public ReadOnly Property StorageDataRow As DataRow

[C#]

public DataRow StorageDataRow {get;}

[Delphi]

public property StorageDataRow: DataRow read get_StorageDataRow;

Remarks

The DataRow belongs to the table StorageDataTable. This property returns a non-null value only for simple table rows. For rows belonging to C1DataTable objects representing composite tables and table views, this property returns null (Nothing in Visual Basic).


C1DataRow Methods

C1DataRow Methods

The methods of the C1DataRow class are listed here. For a complete list of C1DataRow class members, see the C1DataRow Members topic.

Public Methods

AcceptChanges | Commits all the changes made to the row since the last time AcceptChanges or RejectChanges was called.
BeginEdit | Begins an edit operation on the row.
CancelEdit | Cancels the current edit on the row.
ClearErrors | Clears the errors for the row, including the RowError and errors set with SetFieldError (Int32, String).
Delete | Deletes the row.
EndEdit | Ends the edit on the row.
FromDataItem | Gets the C1DataRow object associated with a row object (data item) obtained from data binding.
GetChildRows | Overloaded. Gets the child rows of this C1DataRow using the specified relation.
GetFieldError | Overloaded. Gets the error description for a field.
GetFieldsInError | Gets an array of fields that have errors in this row.
GetParentRow | Overloaded. Gets the parent row of this C1DataRow using the specified relation.
HasVersion | Gets a value indicating whether a specified row version exists.
IsNull | Overloaded. Gets a value indicating whether the specified field contains a null value in this row.
Refresh | Refreshes field values in the row.
RejectChanges | Rolls back all the changes made to the row since the last time AcceptChanges or RejectChanges was called.
SetFieldError | Overloaded. Sets the error description for a field in the row.
SetNull | Sets the value of the specified field to null.
SetRowStateModified | Changes RowState from Unchanged to Modified without modifying any field in the row.


C1DataRow.AcceptChanges Method

C1DataRow.AcceptChanges Method

Commits all the changes made to the row since the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub AcceptChanges()

[C#]

public void AcceptChanges()

[Delphi]

public procedure AcceptChanges();

Remarks

This method can be applied only to simple table rows (or to rows of a table view based on such table). It cannot be applied to composite table rows. Also, applying this method to a simple table that is used in a composite table as a main constituent table is not allowed (if it is connected to its parent in the composite table diagram with a one-to-many relation; the restriction does not apply to those connected many-to-one). In such cases, use AcceptChanges for the whole data set. If one of these restrictions is not satisfied, the method throws an exception.


C1DataRow.BeginEdit Method

C1DataRow.BeginEdit Method

Begins an edit operation on the row.

[Visual Basic]

Public Sub BeginEdit()

[C#]

public void BeginEdit()

[Delphi]

public procedure BeginEdit();


C1DataRow.CancelEdit Method

C1DataRow.CancelEdit Method

Cancels the current edit on the row.

[Visual Basic]

Public Sub CancelEdit()

[C#]

public void CancelEdit()

[Delphi]

public procedure CancelEdit();

Remarks

See BeginEdit for details.


C1DataRow.ClearErrors Method

C1DataRow.ClearErrors Method

Clears the errors for the row, including the RowError and errors set with SetFieldError (Int32, String).

[Visual Basic]

Public Sub ClearErrors()

[C#]

public void ClearErrors()

[Delphi]

public procedure ClearErrors();

Remarks

See HasErrors for details.


C1DataRow.Delete Method

C1DataRow.Delete Method

Deletes the row.

[Visual Basic]

Public Sub Delete()

[C#]

public void Delete()

[Delphi]

public procedure Delete();

Remarks

If the RowState of the row is Added, the row is removed from the data table. The RowState becomes Deleted after calling the Delete method. Deleted rows can be undeleted by calling RejectChanges.


C1DataRow.EndEdit Method

C1DataRow.EndEdit Method

Ends the edit on the row.

[Visual Basic]

Public Sub EndEdit()

[C#]

public void EndEdit()

[Delphi]

public procedure EndEdit();

Remarks

See BeginEdit for details.


C1DataRow.FromDataItem Method

C1DataRow.FromDataItem Method

Gets the C1DataRow object associated with a row object (data item) obtained from data binding.

[Visual Basic]

Public Shared Function FromDataItem( _

ByVal dataItem As Object _

) As C1DataRow

[C#]

public static C1DataRow FromDataItem(

object dataItem

);

[Delphi]

public class function FromDataItem(

dataItem: Object

): C1DataRow;

Parameters

dataItem

An object exposed by a C1DataObjects data source to bound controls.

Return Value

Returns C1DataRow object.

Remarks

This method allows programmers to obtain the C1DataRow object corresponding to an object returned by a C1DataObjects data source, from its IList interface (used in data binding). For example, such objects belong to a CurrencyManager.List collection, and CurrencyManager.Current returns one of them.

Objects obtained by bound controls from a C1DataObjects data source are not C1DataRow objects, although each of them corresponds to a C1DataRow object. The FromDataItem method represents this correspondence. Bound controls can get all information they need from the objects returned by the IList interface. However, if you want to work with such objects (data items) in code, get or set their field values, you need to treat them as C1DataRow objects. This method allows you to obtain a C1DataRow from an untyped row object (data item) returned by the IList interface. For example, C1WebGrid (bound grid control in ComponentOne Studio for ASP.NET) has a C1GridItem.DataItem property. This property returns an object obtained by the grid from the data source. It is not a C1DataRow object, so you must use C1DataRow.FromDataItem(C1GridItem.DataItem) to obtain the C1DataRow object corresponding to that data item.


C1DataRow.GetChildRows Method

C1DataRow.GetChildRows Method

Overload List

Gets the child rows of this C1DataRow using the specified relation.

[Visual Basic] Overloads Public Function GetChildRows() As C1DataRow[]

[C#] public C1DataRow[] GetChildRows();

[Delphi] public function GetChildRows() : array of C1DataRow; overload;

Gets the child rows of this C1DataRow using the specified relation.

[Visual Basic] Overloads Public Function GetChildRows(String) As C1DataRow[]

[C#] public C1DataRow[] GetChildRows(string);

[Delphi] public function GetChildRows(String) : array of C1DataRow; overload;


C1DataRow.GetChildRows Method ()

C1DataRow.GetChildRows Method ()

Gets the child rows of this C1DataRow using the specified relation.

[Visual Basic]

Overloads Public Function GetChildRows() As C1DataRow()

[C#]

public C1DataRow[] GetChildRows()

[Delphi]

public function GetChildRows():
array of C1DataRow;
overload;

Return Value

An array of C1DataRow objects (or a zero-length array).

Remarks

The overload without parameters can be used when the parent and the child are connected with a single relation.


C1DataRow.GetChildRows Method (String)

C1DataRow.GetChildRows Method (String)

Gets the child rows of this C1DataRow using the specified relation.

[Visual Basic]

Overloads Public Function GetChildRows( _

ByVal relationName As String _

) As C1DataRow()

[C#]

public C1DataRow[] GetChildRows(

string relationName

);

[Delphi]

public function GetChildRows(

relationName: String

): array of C1DataRow; overload;

Parameters

relationName

The name of the relation to use.

Return Value

An array of C1DataRow objects (or a zero-length array).

Remarks

The overload without parameters can be used when the parent and the child are connected with a single relation.


C1DataRow.GetFieldError Method

C1DataRow.GetFieldError Method

Overload List

Gets the error description for a field.

[Visual Basic] Overloads Public Function GetFieldError(DataField) As String

[C#] public string GetFieldError(DataField);

[Delphi] public function GetFieldError(DataField) : String; overload;

Gets the error description for a field.

[Visual Basic] Overloads Public Function GetFieldError(Integer) As String

[C#] public string GetFieldError(int);

[Delphi] public function GetFieldError(Int32) : String; overload;

Gets the error description for a field.

[Visual Basic] Overloads Public Function GetFieldError(String) As String

[C#] public string GetFieldError(string);

[Delphi] public function GetFieldError(String) : String; overload;


C1DataRow.GetFieldError Method (DataField)

C1DataRow.GetFieldError Method (DataField)

Gets the error description for a field.

[Visual Basic]

Overloads Public Function GetFieldError( _

ByVal field As DataField _

) As String

[C#]

public string GetFieldError(

DataField field

);

[Delphi]

public function GetFieldError(

field: DataField

): String; overload;

Parameters

field

The field in error.

Remarks

See HasErrors for details.


C1DataRow.GetFieldError Method (Int32)

C1DataRow.GetFieldError Method (Int32)

Gets the error description for a field.

[Visual Basic]

Overloads Public Function GetFieldError( _

ByVal fieldIndex As Integer _

) As String

[C#]

public string GetFieldError(

int fieldIndex

);

[Delphi]

public function GetFieldError(

fieldIndex: Int32

): String; overload;

Parameters

fieldIndex

The index of a field.

Remarks

See HasErrors for details.


C1DataRow.GetFieldError Method (String)

C1DataRow.GetFieldError Method (String)

Gets the error description for a field.

[Visual Basic]

Overloads Public Function GetFieldError( _

ByVal fieldName As String _

) As String

[C#]

public string GetFieldError(

string fieldName

);

[Delphi]

public function GetFieldError(

fieldName: String

): String; overload;

Parameters

fieldName

The name of a field.

Remarks

See HasErrors for details.


C1DataRow.GetFieldsInError Method

C1DataRow.GetFieldsInError Method

Gets an array of fields that have errors in this row.

[Visual Basic]

Public Function GetFieldsInError() As DataField()

[C#]

public DataField[] GetFieldsInError()

[Delphi]

public function GetFieldsInError(): array of DataField;

Remarks

See HasErrors for details.


C1DataRow.GetParentRow Method

C1DataRow.GetParentRow Method

Overload List

Gets the parent row of this C1DataRow using the specified relation.

[Visual Basic] Overloads Public Function GetParentRow() As C1DataRow

[C#] public C1DataRow GetParentRow();

[Delphi] public function GetParentRow() : C1DataRow; overload;

Gets the parent row of this C1DataRow using the specified relation.

[Visual Basic] Overloads Public Function GetParentRow(String) As C1DataRow

[C#] public C1DataRow GetParentRow(string);

[Delphi] public function GetParentRow(String) : C1DataRow; overload;


C1DataRow.GetParentRow Method ()

C1DataRow.GetParentRow Method ()

Gets the parent row of this C1DataRow using the specified relation.

[Visual Basic]

Overloads Public Function GetParentRow() As C1DataRow

[C#]

public C1DataRow GetParentRow()

[Delphi]

public function GetParentRow():
C1DataRow;
overload;

Return Value

An C1DataRow object (or null).

Remarks

The overload without parameters can be used when the parent and the child are connected with a single relation.


C1DataRow.GetParentRow Method (String)

C1DataRow.GetParentRow Method (String)

Gets the parent row of this C1DataRow using the specified relation.

[Visual Basic]

Overloads Public Function GetParentRow( _

ByVal relationName As String _

) As C1DataRow

[C#]

public C1DataRow GetParentRow(

string relationName

);

[Delphi]

public function GetParentRow(

relationName: String

): C1DataRow; overload;

Parameters

relationName

The name of the relation to use.

Return Value

An C1DataRow object (or null).

Remarks

The overload without parameters can be used when the parent and the child are connected with a single relation.


C1DataRow.HasVersion Method

C1DataRow.HasVersion Method

Gets a value indicating whether a specified row version exists.

[Visual Basic]

Public Function HasVersion( _

ByVal version As DataRowVersionEnum _

) As Boolean

[C#]

public bool HasVersion(

DataRowVersionEnum version

);

[Delphi]

public function HasVersion(

version: DataRowVersionEnum

): Boolean;

Parameters

version

One of the DataRowVersionEnum values.

Return Value

True if the version exists; otherwise, False.


C1DataRow.IsNull Method

C1DataRow.IsNull Method

Overload List

Gets a value indicating whether the specified field contains a null value in this row.

[Visual Basic] Overloads Public Function IsNull(Integer) As Boolean

[C#] public bool IsNull(int);

[Delphi] public function IsNull(Int32) : Boolean; overload;

Gets a value indicating whether the specified field contains a null value in this row.

[Visual Basic] Overloads Public Function IsNull(String) As Boolean

[C#] public bool IsNull(string);

[Delphi] public function IsNull(String) : Boolean; overload;


C1DataRow.IsNull Method (Int32)

C1DataRow.IsNull Method (Int32)

Gets a value indicating whether the specified field contains a null value in this row.

[Visual Basic]

Overloads Public Function IsNull( _

ByVal fieldIndex As Integer _

) As Boolean

[C#]

public bool IsNull(

int fieldIndex

);

[Delphi]

public function IsNull(

fieldIndex: Int32

): Boolean; overload;

Parameters

fieldIndex

The zero-based index of the field.


C1DataRow.IsNull Method (String)

C1DataRow.IsNull Method (String)

Gets a value indicating whether the specified field contains a null value in this row.

[Visual Basic]

Overloads Public Function IsNull( _

ByVal fieldName As String _

) As Boolean

[C#]

public bool IsNull(

string fieldName

);

[Delphi]

public function IsNull(

fieldName: String

): Boolean; overload;

Parameters

fieldName

The name of the field.


C1DataRow.Refresh Method

C1DataRow.Refresh Method

Refreshes field values in the row.

[Visual Basic]

Public Sub Refresh()

[C#]

public void Refresh()

[Delphi]

public procedure Refresh();

Remarks

This method performs Calculations for every field that has non-empty Calculations collection. Normally, calculations are performed automatically, without explicit Refresh call, when calculation arguments change. However, some calculation arguments changes cannot be detected automatically, for example, changes in Current, Original or BeforeChange field values, see C1DataObjects Expressions.


C1DataRow.RejectChanges Method

C1DataRow.RejectChanges Method

Rolls back all the changes made to the row since the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub RejectChanges()

[C#]

public void RejectChanges()

[Delphi]

public procedure RejectChanges();

Remarks

This method can be applied only to simple table rows (or to rows of a table view based on such table). It cannot be applied to composite table rows. Also, it is not allowed to apply this method to a simple table that is used in a composite table as a main constituent table (is connected to its parent in the composite table diagram with a one-to-many relation; the restriction does not apply to those connected many-to-one). In such case, use AcceptChanges for the whole data set. If one of these restrictions is not satisfied, the method throws an exception.


C1DataRow.SetFieldError Method

C1DataRow.SetFieldError Method

Overload List

Sets the error description for a field in the row.

[Visual Basic] Overloads Public Sub SetFieldError(DataField, String)

[C#] public SetFieldError(DataField, string);

[Delphi] public procedure SetFieldError(DataField; String); overload;

Sets the error description for a field in the row.

[Visual Basic] Overloads Public Sub SetFieldError(Integer, String)

[C#] public SetFieldError(int, string);

[Delphi] public procedure SetFieldError(Int32; String); overload;

Sets the error description for a field in the row.

[Visual Basic] Overloads Public Sub SetFieldError(String, String)

[C#] public SetFieldError(string, string);

[Delphi] public procedure SetFieldError(String; String); overload;


C1DataRow.SetFieldError Method (DataField, String)

C1DataRow.SetFieldError Method (DataField, String)

Sets the error description for a field in the row.

[Visual Basic]

Overloads Public Sub SetFieldError( _

ByVal field As DataField, _

ByVal errorMsg As String _

)

[C#]

public void SetFieldError(

DataField field,

string errorMsg

);

[Delphi]

public procedure SetFieldError(

field: DataField;

errorMsg: String

); overload;

Parameters

field

A data field.

errorMsg

The error description.

Remarks

See HasErrors for details.


C1DataRow.SetFieldError Method (Int32, String)

C1DataRow.SetFieldError Method (Int32, String)

Sets the error description for a field in the row.

[Visual Basic]

Overloads Public Sub SetFieldError( _

ByVal fieldIndex As Integer, _

ByVal errorMsg As String _

)

[C#]

public void SetFieldError(

int fieldIndex,

string errorMsg

);

[Delphi]

public procedure SetFieldError(

fieldIndex: Int32;

errorMsg: String

); overload;

Parameters

fieldIndex

The index of a field.

errorMsg

The error description.

Remarks

See HasErrors for details.


C1DataRow.SetFieldError Method (String, String)

C1DataRow.SetFieldError Method (String, String)

Sets the error description for a field in the row.

[Visual Basic]

Overloads Public Sub SetFieldError( _

ByVal fieldName As String, _

ByVal errorMsg As String _

)

[C#]

public void SetFieldError(

string fieldName,

string errorMsg

);

[Delphi]

public procedure SetFieldError(

fieldName: String;

errorMsg: String

); overload;

Parameters

fieldName

The name of a field.

errorMsg

The error description.

Remarks

See HasErrors for details.


C1DataRow.SetNull Method

C1DataRow.SetNull Method

Sets the value of the specified field to null.

[Visual Basic]

Public Sub SetNull( _

ByVal field As DataField _

)

[C#]

public void SetNull(

DataField field

);

[Delphi]

public procedure SetNull(

field: DataField

);

Parameters

field

A data field.


C1DataRow.SetRowStateModified Method

C1DataRow.SetRowStateModified Method

Changes RowState from Unchanged to Modified without modifying any field in the row.

[Visual Basic]

Public Sub SetRowStateModified()

[C#]

public void SetRowStateModified()

[Delphi]

public procedure SetRowStateModified();


C1DataRowCollection Class

C1DataRowCollection Class

Represents a collection of rows in a C1DataTable object.

For a list of all members of this type, see C1DataRowCollection Members.

System.Object

C1.Data.C1DataRowCollection

[Visual Basic]

Public Class C1DataRowCollection

Implements ICollection, IEnumerable

[C#]

public class C1DataRowCollection : ICollection, IEnumerable

[Delphi]

type C1DataRowCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataRowCollection Members

C1DataRowCollection Members

C1DataRowCollection overview

Public Properties

Count | Gets the total number of rows in the data table.
Item | Gets the row at the specified index.

Public Methods

Contains | Returns True if the collection contains the specific item, False otherwise.
CopyTo | Copies elements of the collection to an array starting at a particular array index.
Find | Overloaded. Gets the row specified by the primary key value.
IndexOf | Determines the index of a specific item in the collection, return -1 if this item not found.


C1DataRowCollection Properties

C1DataRowCollection Properties

The properties of the C1DataRowCollection class are listed here. For a complete list of C1DataRowCollection class members, see the C1DataRowCollection Members topic.

Public Properties

Count | Gets the total number of rows in the data table.
Item | Gets the row at the specified index.


C1DataRowCollection.Count Property

C1DataRowCollection.Count Property

Gets the total number of rows in the data table.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count


C1DataRowCollection.Item Property

C1DataRowCollection.Item Property

Gets the row at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As C1DataRow

[C#]

public C1DataRow this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: C1DataRow read get_Item;


C1DataRowCollection Methods

C1DataRowCollection Methods

The methods of the C1DataRowCollection class are listed here. For a complete list of C1DataRowCollection class members, see the C1DataRowCollection Members topic.

Public Methods

Contains | Returns True if the collection contains the specific item, False otherwise.
CopyTo | Copies elements of the collection to an array starting at a particular array index.
Find | Overloaded. Gets the row specified by the primary key value.
IndexOf | Determines the index of a specific item in the collection, return -1 if this item not found.


C1DataRowCollection.Contains Method

C1DataRowCollection.Contains Method

Returns True if the collection contains the specific item, False otherwise.

[Visual Basic]

Public Function Contains( _

ByVal row As C1DataRow _

) As Boolean

[C#]

public bool Contains(

C1DataRow row

);

[Delphi]

public function Contains(

row: C1DataRow

): Boolean;

Parameters

row

The object to locate in the collection.


C1DataRowCollection.CopyTo Method

C1DataRowCollection.CopyTo Method

Copies elements of the collection to an array starting at a particular array index.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As C1DataRow(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

C1DataRow[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of C1DataRow;

index: Int32

);

Parameters

array

The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


C1DataRowCollection.Find Method

C1DataRowCollection.Find Method

Overload List

Gets the row specified by the primary key value.

[Visual Basic] Overloads Public Function Find(Object) As C1DataRow

[C#] public C1DataRow Find(object);

[Delphi] public function Find(Object) : C1DataRow; overload;

Gets the row specified by the primary key value.

[Visual Basic] Overloads Public Function Find(Object()) As C1DataRow

[C#] public C1DataRow Find(object[]);

[Delphi] public function Find(array of Object) : C1DataRow; overload;


C1DataRowCollection.Find Method (Object)

C1DataRowCollection.Find Method (Object)

Gets the row specified by the primary key value.

[Visual Basic]

Overloads Public Function Find( _

ByVal key As Object _

) As C1DataRow

[C#]

public C1DataRow Find(

object key

);

[Delphi]

public function Find(

key: Object

): C1DataRow; overload;

Parameters

key

The primary key value of the row to find.

Return Value

The C1DataRow object.

Remarks

This method returns the C1DataRow object containing the primary key values specified; otherwise a null value if the primary key values do not exist in the C1DataRowCollection.

To use the Find method, the C1DataTable object must have at least one field designated as a primary key field, see PrimaryKey property.


C1DataRowCollection.Find Method (Object[])

C1DataRowCollection.Find Method (Object[])

Gets the row specified by the primary key value.

[Visual Basic]

Overloads Public Function Find( _

ByVal keys As Object() _

) As C1DataRow

[C#]

public C1DataRow Find(

object[] keys

);

[Delphi]

public function Find(

keys: array of Object

): C1DataRow; overload;

Parameters

keys

An array of primary key values to find.

Return Value

The C1DataRow object.


C1DataRowCollection.IndexOf Method

C1DataRowCollection.IndexOf Method

Determines the index of a specific item in the collection, return -1 if this item not found.

[Visual Basic]

Public Function IndexOf( _

ByVal row As C1DataRow _

) As Integer

[C#]

public int IndexOf(

C1DataRow row

);

[Delphi]

public function IndexOf(

row: C1DataRow

): Int32;

Parameters

row

The object to locate in the collection.


C1DataSet Class

C1DataSet Class

C1DataSet is the main client component of C1DataObjects.

For a list of all members of this type, see C1DataSet Members.

System.Object

System.ComponentModel.MarshalByValueComponent

C1.Data.BaseFormAwareMarshalByValueComponent

C1.Data.C1DataSet

[Visual Basic]

Public Class C1DataSet

Inherits BaseFormAwareMarshalByValueComponent

Implements IListSource, ISerializable, ISupportInitialize

[C#]

public class C1DataSet : BaseFormAwareMarshalByValueComponent , IListSource, ISerializable, ISupportInitialize

[Delphi]

type C1DataSet = class (BaseFormAwareMarshalByValueComponent, IListSource, ISerializable, ISupportInitialize);

Remarks

It contains the data as it is exposed to the user, that can be used both by data bound controls and programmatically. C1DataSet class has a [Serializable] attribute, so it can be passed as a parameter and returned from a method executed remotely in a different process or on a different computer.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataSet Members

C1DataSet Members

C1DataSet overview

Public Constructors

C1DataSet Constructor

Initializes a new instance of the C1DataSet class.

Public Properties

CaseSensitive | Determines whether string comparisons within the data set are case-sensitive.
ChangeInProgress | Gets or sets a value indicating whether firing C1.Data.BaseLogic.AfterChanges event is deferred.
Credentials | Gets or sets username, password and domain used to communicate with the server.
DataLibrary | Gets or sets the name of the data library containing the schema.
DataLibraryUrl | In a 3-tier client application, this property gets or sets the URL of the data library located on the server.
DataSetDef | Gets or sets the name of the data set in the schema.
DynamicConnections | Gets a collection of Connection objects used at run time as substitutes for schema connections.
EnforceConstraints | Gets or sets a value indicating whether relation constraints must be satisfied while modifying the data set.
ExecutionMode | Gets a value indicating whether actions in handling a business logic event are deferred or performed immediately.
ExtendedProperties | Gets a collection of custom user information associated with the data set.
Filled | Gets a value indicating whether the data set is filled with data.
FillOnRequest | Gets or sets a value indicating whether the data set will be automatically filled with data when a data bound control requests data from it.
HasErrors | Gets a value indicating whether there are errors in any of the rows in any of the tables of this data set.
Locale | Determines the locale information used in string comparisons within the data set.
NotificationModeFlags | Flags affecting the way change notifications are sent to data bound controls.
RemoteDataService | Gets the RemoteDataService-derived class of the data library.
Schema | Returns the Schema object representing the schema on which the data set is based.
SchemaDef | Returns or sets the C1SchemaDef component hosting the schema on which the data set is based.
StorageDataSet | Gets the ADO.NET DataSet where table data rows are stored.
SuppressNotifications | Gets or sets a value indicating whether data bound controls must be notified of changes in the data set.
Tables | This run-time property returns the collection of tables in the data set.
TableViews | This run-time property returns the collection of table views in the data set.

Public Methods

AcceptChanges | Commits all changes made to the data set since it was filled with data or the last time AcceptChanges or RejectChanges was called.
Clear | Removes all rows from all data set tables.
Fill | Overloaded. Fills the data set with data fetching it from the database.
GetChanges | Overloaded. Gets a copy of the data set containing all changes to simple tables made since it was last filled, or since AcceptChanges was called. Composite tables and table views are empty in the resulting data set.
GetDefaultTableViewRows | Returns the list of all potential table view rows, pointers to all existing table rows.
GetExportDataSet | Overloaded. Creates and fills with data an ADO.NET data set consisting of this data set's table views.
HasChanges | Overloaded. Gets a value indicating whether the data set has changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.
Merge | Merges the parameter data set containing only simple table data into this (caller) data set.
PopExecutionMode | Restores the execution mode affecting actions invoked while handling another action.
PushExecutionMode | Sets the execution mode affecting actions invoked while handling another action.
ReadXml | Overloaded. Reads XML data into the data set.
RejectChanges | Rolls back all changes made to the data set since it was filled with data or the last time AcceptChanges or RejectChanges was called.
SetTableViewRows |
StopAsyncFetch | For DataAccessMode = VirtualAutomatic, this property stops the background fetch, if a fetch is in progress.
StorageChangeBegin | Begins the process of modifying/synchronizing the underlying ADO.NET DataSet.
StorageChanged | Overloaded. Marks the end of the first stage of modifying/synchronizing the underlying ADO.NET DataSet.
StorageChangeEnd | Ends the process of modifying/synchronizing the underlying ADO.NET DataSet.
Update | Overloaded. Updates (commits) all changed data set rows to the database.
WriteXml | Overloaded. Writes XML data from the data set.

Public Events

AfterFill | Fired after the data set is filled with data.
BeforeFill | Fired before the data set fills with data.
CurrentRowChanged | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
Error | Fired when an error occurs.
PositionChanged | Fired when one of the data set data members changes current row position.
UpdateError | Fired when an error occurs committing changes to the dataset.


C1DataSet Constructor

C1DataSet Constructor

Initializes a new instance of the C1DataSet class.

[Visual Basic]

Public Function New()

[C#]

public C1DataSet()

[Delphi]

public constructor Create(); overload;


C1DataSet Properties

C1DataSet Properties

The properties of the C1DataSet class are listed here. For a complete list of C1DataSet class members, see the C1DataSet Members topic.

Public Properties

CaseSensitive | Determines whether string comparisons within the data set are case-sensitive.
ChangeInProgress | Gets or sets a value indicating whether firing C1.Data.BaseLogic.AfterChanges event is deferred.
Credentials | Gets or sets username, password and domain used to communicate with the server.
DataLibrary | Gets or sets the name of the data library containing the schema.
DataLibraryUrl | In a 3-tier client application, this property gets or sets the URL of the data library located on the server.
DataSetDef | Gets or sets the name of the data set in the schema.
DynamicConnections | Gets a collection of Connection objects used at run time as substitutes for schema connections.
EnforceConstraints | Gets or sets a value indicating whether relation constraints must be satisfied while modifying the data set.
ExecutionMode | Gets a value indicating whether actions in handling a business logic event are deferred or performed immediately.
ExtendedProperties | Gets a collection of custom user information associated with the data set.
Filled | Gets a value indicating whether the data set is filled with data.
FillOnRequest | Gets or sets a value indicating whether the data set will be automatically filled with data when a data bound control requests data from it.
HasErrors | Gets a value indicating whether there are errors in any of the rows in any of the tables of this data set.
Locale | Determines the locale information used in string comparisons within the data set.
NotificationModeFlags | Flags affecting the way change notifications are sent to data bound controls.
RemoteDataService | Gets the RemoteDataService-derived class of the data library.
Schema | Returns the Schema object representing the schema on which the data set is based.
SchemaDef | Returns or sets the C1SchemaDef component hosting the schema on which the data set is based.
StorageDataSet | Gets the ADO.NET DataSet where table data rows are stored.
SuppressNotifications | Gets or sets a value indicating whether data bound controls must be notified of changes in the data set.
Tables | This run-time property returns the collection of tables in the data set.
TableViews | This run-time property returns the collection of table views in the data set.


C1DataSet.CaseSensitive Property

C1DataSet.CaseSensitive Property

Determines whether string comparisons within the data set are case-sensitive.

[Visual Basic]

Public Property CaseSensitive As Boolean

[C#]

public bool CaseSensitive {get;set;}

[Delphi]

public property CaseSensitive: Boolean read get_CaseSensitive write set_CaseSensitive;

Remarks

This property affects string comparison in expression evaluation, sorting table views by the end user (via IBindingList.ApplySort) and sorting in C1DataView objects.

By default, all C1DataTable objects created by a C1DataSet use the CaseSensitive property of the C1DataSet, but it can be overridden setting the CaseSensitive property of the C1DataTable object.


C1DataSet.ChangeInProgress Property

C1DataSet.ChangeInProgress Property

Gets or sets a value indicating whether firing C1.Data.BaseLogic.AfterChanges event is deferred.

[Visual Basic]

Public Property ChangeInProgress As Boolean

[C#]

public bool ChangeInProgress {get;set;}

[Delphi]

public property ChangeInProgress: Boolean read get_ChangeInProgress write set_ChangeInProgress;

Remarks

This property, available only at run time, is set to False by default. Setting it to True, defers firing AfterChanges event until this property is set back to False.

Normally, C1.Data.BaseLogic.AfterChanges event is fired after every change to a field value. Sometimes, it is desirable to make multiple field changes in a batch without firing this event, and fire the event only when all changes are done. Setting ChangeInProgress to True enables this mode of firing C1.Data.BaseLogic.AfterChanges for all rows of the data set.


C1DataSet.Credentials Property

C1DataSet.Credentials Property

Gets or sets username, password and domain used to communicate with the server.

[Visual Basic]

Public Property Credentials As NetworkCredential

[C#]

public NetworkCredential Credentials {get;set;}

[Delphi]

public property Credentials: NetworkCredential read get_Credentials write set_Credentials;


C1DataSet.DataLibrary Property

C1DataSet.DataLibrary Property

Gets or sets the name of the data library containing the schema.

[Visual Basic]

Public Property DataLibrary As String

[C#]

public string DataLibrary {get;set;}

[Delphi]

public property DataLibrary: String read get_DataLibrary write set_DataLibrary;

Remarks

In a client application using a data library, this property determines the name of the data library containing the schema for this data set. It is the name of a data library assembly included in the project References. The name does not include the “.dll” extension.


C1DataSet.DataLibraryUrl Property

C1DataSet.DataLibraryUrl Property

In a 3-tier client application, this property gets or sets the URL of the data library located on the server.

[Visual Basic]

Public Property DataLibraryUrl As String

[C#]

public string DataLibraryUrl {get;set;}

[Delphi]

public property DataLibraryUrl: String read get_DataLibraryUrl write set_DataLibraryUrl;

Remarks

In a 3-tier application, data library runs both on the server and on the client. The DataLibrary property identifies the data library on the client. The DataLibraryUrl property identifies data library on the server. Using this URL, client-side data library invokes the data library on the server.


C1DataSet.DataSetDef Property

C1DataSet.DataSetDef Property

Gets or sets the name of the data set in the schema.

[Visual Basic]

Public Property DataSetDef As String

[C#]

public string DataSetDef {get;set;}

[Delphi]

public property DataSetDef: String read get_DataSetDef write set_DataSetDef;

Remarks

This property determines the schema data set definition represented by this data set.


C1DataSet.DynamicConnections Property

C1DataSet.DynamicConnections Property

Gets a collection of Connection objects used at run time as substitutes for schema connections.

[Visual Basic]

Public ReadOnly Property DynamicConnections As ConnectionCollection

[C#]

public ConnectionCollection DynamicConnections {get;}

[Delphi]

public property DynamicConnections: ConnectionCollection read get_DynamicConnections;

Remarks

This property changes connection at run time for a single data set. If you need to change schema connection for all data sets at once, set Connection.ConnectionString in the CreateSchema event.

By default, if C1DataSet.DynamicConnections is empty, data fetch and update for this data set uses the connections specified in the schema.

Add a connection object for each connection you want to change at run time for this data set. Usually, you will add a copy of a schema connection object(s) using Clone. Alternatively, you can create new connection objects from scratch, for example, new C1OleDbConnection(). Adding an existing connection object from schema to DynamicConnections throws an exception. This prevents changes unintentionally affecting other data sets attached to the same schema.

Having added a connection object, set its properties as desired. Usually, only the ConnectionString needs to be changed in connection objects obtained with Clone. If you created a new connection object, without using Clone, set its Name property to the name of the schema connection you want to modify.

When the data set performs a fetch or update operation while its DynamicConnections collection is not empty, it first looks for connection properties in DynamicConnection, and only then, if not found, in the schema. If DynamicConnections contains a connection with the same Name as the schema connection, that DynamicConnections element is used instead of the schema connection.


C1DataSet.EnforceConstraints Property

C1DataSet.EnforceConstraints Property

Gets or sets a value indicating whether relation constraints must be satisfied while modifying the data set.

[Visual Basic]

Public Property EnforceConstraints As Boolean

[C#]

public bool EnforceConstraints {get;set;}

[Delphi]

public property EnforceConstraints: Boolean read get_EnforceConstraints write set_EnforceConstraints;

Remarks

This run-time property is set to True by default, which means that C1DataObjects enforces relation parent-child constraints when the data set is modified. Relation constraints are imposed by simple relations with C1.Data.SchemaObjects.Relation.EnforceConstraints property set to True. They do not allow child records without parent.


C1DataSet.ExecutionMode Property

C1DataSet.ExecutionMode Property

Gets a value indicating whether actions in handling a business logic event are deferred or performed immediately.

[Visual Basic]

Public ReadOnly Property ExecutionMode As ExecutionModeEnum

[C#]

public ExecutionModeEnum ExecutionMode {get;}

[Delphi]

public property ExecutionMode: ExecutionModeEnum read get_ExecutionMode;

Remarks

This property affects how C1DataObjects performs actions while inside a business logic event. If this run-time property is set to Immediate (default), actions are performed immediately. If it is set to Deferred, actions are deferred until the current user action handling is completed.

This property is read-only. To set execution mode, call the PushExecutionMode method, passing it the new mode as a parameter. To restore the previous execution mode, call the PopExecutionMode method.


C1DataSet.ExtendedProperties Property

C1DataSet.ExtendedProperties Property

Gets a collection of custom user information associated with the data set.

[Visual Basic]

Public ReadOnly Property ExtendedProperties As PropertyCollection

[C#]

public PropertyCollection ExtendedProperties {get;}

[Delphi]

public property ExtendedProperties: PropertyCollection read get_ExtendedProperties;


C1DataSet.Filled Property

C1DataSet.Filled Property

Gets a value indicating whether the data set is filled with data.

[Visual Basic]

Public ReadOnly Property Filled As Boolean

[C#]

public bool Filled {get;}

[Delphi]

public property Filled: Boolean read get_Filled;

Remarks

This run-time read-only property returns True if the data set has already been filled with data, either by the Fill or, if the FillOnRequest property was set to True, by a request from a data bound control.


C1DataSet.FillOnRequest Property

C1DataSet.FillOnRequest Property

Gets or sets a value indicating whether the data set will be automatically filled with data when a data bound control requests data from it.

[Visual Basic]

Public Property FillOnRequest As Boolean

[C#]

public bool FillOnRequest {get;set;}

[Delphi]

public property FillOnRequest: Boolean read get_FillOnRequest write set_FillOnRequest;

Remarks

If this property is set to True (default), the data set is automatically filled with data at startup, once a control bound to it requests data.

If it is set to False, the data set remains empty until the Fill method is called.


C1DataSet.HasErrors Property

C1DataSet.HasErrors Property

Gets a value indicating whether there are errors in any of the rows in any of the tables of this data set.

[Visual Basic]

Public ReadOnly Property HasErrors As Boolean

[C#]

public bool HasErrors {get;}

[Delphi]

public property HasErrors: Boolean read get_HasErrors;

Remarks

You can use the HasErrors property of the data set to determine if any table has errors, before checking individual C1DataTable objects in the Tables collection. To get all errors of an individual C1DataTable, use its GetErrors method.


C1DataSet.Locale Property

C1DataSet.Locale Property

Determines the locale information used in string comparisons within the data set.

[Visual Basic]

Public Property Locale As CultureInfo

[C#]

public CultureInfo Locale {get;set;}

[Delphi]

public property Locale: CultureInfo read get_Locale write set_Locale;

Remarks

This property affects string comparison in expression evaluation, sorting table views by the end user (via IBindingList.ApplySort) and sorting in C1DataView objects.

By default, all C1DataTable objects created by a C1DataSet use the Locale property of the C1DataSet, but it can be overridden setting the Locale property of the C1DataTable object.


C1DataSet.NotificationModeFlags Property

C1DataSet.NotificationModeFlags Property

Flags affecting the way change notifications are sent to data bound controls.

[Visual Basic]

Public Property NotificationModeFlags As ListChangedFlags

[C#]

public ListChangedFlags NotificationModeFlags {get;set;}

[Delphi]

public property NotificationModeFlags: ListChangedFlags read get_NotificationModeFlags write set_NotificationModeFlags;

Remarks

For data bound controls that rely on specific ADO.NET notification behavior, set NotificationMode=ListChangedFlags.Ado.Net.

C1DataObjects uses a slightly different notification scheme (calling the IBindingList.ListChanged event) than ADO.NET does. C1DataObjects notifications are fully .NET data binding-compliant and optimized for data bound controls. All ComponentOne bound controls and Microsoft bound controls work properly with this notification scheme. However, some (very few) third-party bound controls may not work properly unless notifications are fully ADO.NET compliant. In fact, all data bound controls should work with C1DataObjects notifications without problems, but in the non-ideal world that can be broken. To prevent this problem and allow using any bound controls, C1DataObjects provides this property.

If you need this property in C1DataExpress, set C1ExpressConnection.DataSet.NotificationModeFlags or .ExpressConnection.DataSet.NotificationModeFlags in code, at run time.

The notifications can be turned off altogether using the SuppressNotifications property.


C1DataSet.RemoteDataService Property

C1DataSet.RemoteDataService Property

Gets the RemoteDataService-derived class of the data library.

[Visual Basic]

Public ReadOnly Property RemoteDataService As RemoteDataService

[C#]

public RemoteDataService RemoteDataService {get;}

[Delphi]

public property RemoteDataService: RemoteDataService read get_RemoteDataService;

Remarks

This property enables the programmer to access the RemoteDataService-derived class in the data library, both in 2-tier and 3-tier configuration. This property is necessary for calling business methods (methods added by the programmer to the RemoteDataService-derived class in the data library). For example, see the CustomFillUpdate sample.


C1DataSet.Schema Property

C1DataSet.Schema Property

Returns the Schema object representing the schema on which the data set is based.

[Visual Basic]

Public ReadOnly Property Schema As Schema

[C#]

public Schema Schema {get;}

[Delphi]

public property Schema: Schema read get_Schema;


C1DataSet.SchemaDef Property

C1DataSet.SchemaDef Property

Returns or sets the C1SchemaDef component hosting the schema on which the data set is based.

[Visual Basic]

Public Property SchemaDef As C1SchemaDef

[C#]

public C1SchemaDef SchemaDef {get;set;}

[Delphi]

public property SchemaDef: C1SchemaDef read get_SchemaDef write set_SchemaDef;

Remarks

This property determines the C1SchemaDef component to which the data set is connected.

In direct client applications, this property is usually set at design time to a C1SchemaDef component residing in the same form.

In a client application using a data library, this property is left empty. The Schema is retrieved from the data library.


C1DataSet.StorageDataSet Property

C1DataSet.StorageDataSet Property

Gets the ADO.NET DataSet where table data rows are stored.

[Visual Basic]

Public ReadOnly Property StorageDataSet As DataSet

[C#]

public DataSet StorageDataSet {get;}

[Delphi]

public property StorageDataSet: DataSet read get_StorageDataSet;


C1DataSet.SuppressNotifications Property

C1DataSet.SuppressNotifications Property

Gets or sets a value indicating whether data bound controls must be notified of changes in the data set.

[Visual Basic]

Public Property SuppressNotifications As Boolean

[C#]

public bool SuppressNotifications {get;set;}

[Delphi]

public property SuppressNotifications: Boolean read get_SuppressNotifications write set_SuppressNotifications;

Remarks

This run-time property is set to True by default, which means that data bound controls receive notifications of any change made to the data set. Notifications are issued by C1DataObjects after every end-user or programmatic action causing changes in the data set. C1DataObjects issues notifications when the action is completely handled. Having received a change notification, data bound controls usually repaint themselves to reflect the changed data.

In some cases, it is necessary to suppress notifications to be able to perform multiple actions in a batch without causing changes in data bound controls. Setting the SuppressNotifications property to False disables sending notifications to data bound controls. If you suppress notifications, data bound controls will not be notified of any changes, so you have to explicitly call Refresh for all changed table views to make data bound controls refresh their contents.


C1DataSet.Tables Property

C1DataSet.Tables Property

This run-time property returns the collection of tables in the data set.

[Visual Basic]

Public ReadOnly Property Tables As C1DataTableCollection

[C#]

public C1DataTableCollection Tables {get;}

[Delphi]

public property Tables: C1DataTableCollection read get_Tables;


C1DataSet.TableViews Property

C1DataSet.TableViews Property

This run-time property returns the collection of table views in the data set.

[Visual Basic]

Public ReadOnly Property TableViews As C1DataTableCollection

[C#]

public C1DataTableCollection TableViews {get;}

[Delphi]

public property TableViews: C1DataTableCollection read get_TableViews;


C1DataSet Methods

C1DataSet Methods

The methods of the C1DataSet class are listed here. For a complete list of C1DataSet class members, see the C1DataSet Members topic.

Public Methods

AcceptChanges | Commits all changes made to the data set since it was filled with data or the last time AcceptChanges or RejectChanges was called.
Clear | Removes all rows from all data set tables.
Fill | Overloaded. Fills the data set with data fetching it from the database.
GetChanges | Overloaded. Gets a copy of the data set containing all changes to simple tables made since it was last filled, or since AcceptChanges was called. Composite tables and table views are empty in the resulting data set.
GetDefaultTableViewRows | Returns the list of all potential table view rows, pointers to all existing table rows.
GetExportDataSet | Overloaded. Creates and fills with data an ADO.NET data set consisting of this data set's table views.
HasChanges | Overloaded. Gets a value indicating whether the data set has changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.
Merge | Merges the parameter data set containing only simple table data into this (caller) data set.
PopExecutionMode | Restores the execution mode affecting actions invoked while handling another action.
PushExecutionMode | Sets the execution mode affecting actions invoked while handling another action.
ReadXml | Overloaded. Reads XML data into the data set.
RejectChanges | Rolls back all changes made to the data set since it was filled with data or the last time AcceptChanges or RejectChanges was called.
SetTableViewRows |
StopAsyncFetch | For DataAccessMode = VirtualAutomatic, this property stops the background fetch, if a fetch is in progress.
StorageChangeBegin | Begins the process of modifying/synchronizing the underlying ADO.NET DataSet.
StorageChanged | Overloaded. Marks the end of the first stage of modifying/synchronizing the underlying ADO.NET DataSet.
StorageChangeEnd | Ends the process of modifying/synchronizing the underlying ADO.NET DataSet.
Update | Overloaded. Updates (commits) all changed data set rows to the database.
WriteXml | Overloaded. Writes XML data from the data set.


C1DataSet.AcceptChanges Method

C1DataSet.AcceptChanges Method

Commits all changes made to the data set since it was filled with data or the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub AcceptChanges()

[C#]

public void AcceptChanges()

[Delphi]

public procedure AcceptChanges();

Remarks

After this method the current state of all data set rows except deleted rows becomes also their original state.

Any C1DataRow objects still in edit mode successfully end their edits. The RowState property of each C1DataRow changes: Added and Modified rows become Unchanged, and Deleted rows are removed.

AcceptChanges can also be called for a single simple table.


C1DataSet.Clear Method

C1DataSet.Clear Method

Removes all rows from all data set tables.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

Remarks

Rows removed by the Clear method do not become deleted (DataRowStateEnum.Deleted), they are completely removed, destroyed.


C1DataSet.Fill Method

C1DataSet.Fill Method

Overload List

Fills the data set with data fetching it from the database.

[Visual Basic] Overloads Public Sub Fill()

[C#] public Fill();

[Delphi] public procedure Fill(); overload;

Fills the data set with data fetching it from the database.

[Visual Basic] Overloads Public Sub Fill(Boolean)

[C#] public Fill(bool);

[Delphi] public procedure Fill(Boolean); overload;

Fills the data set with data fetching it from the database.

[Visual Basic] Overloads Public Sub Fill(String())

[C#] public Fill(string[]);

[Delphi] public procedure Fill(array of String); overload;

Fills the data set with data fetching it from the database.

[Visual Basic] Overloads Public Sub Fill(FilterCondition, Boolean)

[C#] public Fill(FilterCondition, bool);

[Delphi] public procedure Fill(FilterCondition; Boolean); overload;

Fills the data set with data fetching it from the database.

[Visual Basic] Overloads Public Sub Fill(FilterConditions, Boolean)

[C#] public Fill(FilterConditions, bool);

[Delphi] public procedure Fill(FilterConditions; Boolean); overload;

Fills the data set with data fetching it from the database.

[Visual Basic] Overloads Public Sub Fill(FilterConditions, String())

[C#] public Fill(FilterConditions, string[]);

[Delphi] public procedure Fill(FilterConditions; array of String); overload;


C1DataSet.Fill Method ()

C1DataSet.Fill Method ()

Fills the data set with data fetching it from the database.

[Visual Basic]

Overloads Public Sub Fill()

[C#]

public void Fill()

[Delphi]

public procedure Fill(); overload;

Remarks

If data set schema has changed since the last time the data set was filled, you must call one of the Fill overloads with Recreate argument set to True. This recreates the structure of table view and table rowsets in the data set, synchronizing it with the changed schema. Calling Fill without Recreate or Recreate set to False after schema change can cause unpredictable results.

Filter conditions specify restrictions on the fetched rows. Each filter condition represents a restriction on one of the data set table views. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by BeforeFill event code implementing the fetch.

Specifying the TableViewNames argument allows you to selectively fetch certain table views without affecting other table views in the data set.

If the TableViewNames argument is not used, table views with FillIgnore property set to True are not fetched.

Before fetching data, C1DataObjects fires BeforeFill event. You can either pass filter conditions to the Fill method or set them in C1.Data.C1DataSet.BeforeFill event. C1.Data.C1DataSet.BeforeFill event fires both on calling Fill and when the data set is filled at startup due to FillOnRequest = True. After filling the data set, C1DataObjects fires C1.Data.C1DataSet.AfterFill event.


C1DataSet.Fill Method (Boolean)

C1DataSet.Fill Method (Boolean)

Fills the data set with data fetching it from the database.

[Visual Basic]

Overloads Public Sub Fill( _

ByVal recreate As Boolean _

)

[C#]

public void Fill(

bool recreate

);

[Delphi]

public procedure Fill(

recreate: Boolean

); overload;

Parameters

recreate

Set this parameter to True if data set schema has changed since the last time the data set was filled.

Remarks

If data set schema has changed since the last time the data set was filled, you must call one of the Fill overloads with Recreate argument set to True. This recreates the structure of table view and table rowsets in the data set, synchronizing it with the changed schema. Calling Fill without Recreate or Recreate set to False after schema change can cause unpredictable results.

Filter conditions specify restrictions on the fetched rows. Each filter condition represents a restriction on one of the data set table views. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by BeforeFill event code implementing the fetch.

Specifying the TableViewNames argument allows you to selectively fetch certain table views without affecting other table views in the data set.

If the TableViewNames argument is not used, table views with FillIgnore property set to True are not fetched.

Before fetching data, C1DataObjects fires BeforeFill event. You can either pass filter conditions to the Fill method or set them in C1.Data.C1DataSet.BeforeFill event. C1.Data.C1DataSet.BeforeFill event fires both on calling Fill and when the data set is filled at startup due to FillOnRequest = True. After filling the data set, C1DataObjects fires C1.Data.C1DataSet.AfterFill event.


C1DataSet.Fill Method (String[])

C1DataSet.Fill Method (String[])

Fills the data set with data fetching it from the database.

[Visual Basic]

Overloads Public Sub Fill( _

ByVal tableViewNames As String() _

)

[C#]

public void Fill(

string[] tableViewNames

);

[Delphi]

public procedure Fill(

tableViewNames: array of String

); overload;

Parameters

tableViewNames

Array of names specifying table views to be filled with data. Other table views are not changed.

Remarks

If data set schema has changed since the last time the data set was filled, you must call one of the Fill overloads with Recreate argument set to True. This recreates the structure of table view and table rowsets in the data set, synchronizing it with the changed schema. Calling Fill without Recreate or Recreate set to False after schema change can cause unpredictable results.

Filter conditions specify restrictions on the fetched rows. Each filter condition represents a restriction on one of the data set table views. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by BeforeFill event code implementing the fetch.

Specifying the TableViewNames argument allows you to selectively fetch certain table views without affecting other table views in the data set.

If the TableViewNames argument is not used, table views with FillIgnore property set to True are not fetched.

Before fetching data, C1DataObjects fires BeforeFill event. You can either pass filter conditions to the Fill method or set them in C1.Data.C1DataSet.BeforeFill event. C1.Data.C1DataSet.BeforeFill event fires both on calling Fill and when the data set is filled at startup due to FillOnRequest = True. After filling the data set, C1DataObjects fires C1.Data.C1DataSet.AfterFill event.


C1DataSet.Fill Method (FilterCondition, Boolean)

C1DataSet.Fill Method (FilterCondition, Boolean)

Fills the data set with data fetching it from the database.

[Visual Basic]

Overloads Public Sub Fill( _

ByVal filter As FilterCondition, _

ByVal recreate As Boolean _

)

[C#]

public void Fill(

FilterCondition filter,

bool recreate

);

[Delphi]

public procedure Fill(

filter: FilterCondition;

recreate: Boolean

); overload;

Parameters

filter

Filter condition restricting the fetched rows of one of the data set table views.

recreate

Set this parameter to True if data set schema has changed since the last time the data set was filled.

Remarks

If data set schema has changed since the last time the data set was filled, you must call one of the Fill overloads with Recreate argument set to True. This recreates the structure of table view and table rowsets in the data set, synchronizing it with the changed schema. Calling Fill without Recreate or Recreate set to False after schema change can cause unpredictable results.

Filter conditions specify restrictions on the fetched rows. Each filter condition represents a restriction on one of the data set table views. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by BeforeFill event code implementing the fetch.

Specifying the TableViewNames argument allows you to selectively fetch certain table views without affecting other table views in the data set.

If the TableViewNames argument is not used, table views with FillIgnore property set to True are not fetched.

Before fetching data, C1DataObjects fires BeforeFill event. You can either pass filter conditions to the Fill method or set them in C1.Data.C1DataSet.BeforeFill event. C1.Data.C1DataSet.BeforeFill event fires both on calling Fill and when the data set is filled at startup due to FillOnRequest = True. After filling the data set, C1DataObjects fires C1.Data.C1DataSet.AfterFill event.


C1DataSet.Fill Method (FilterConditions, Boolean)

C1DataSet.Fill Method (FilterConditions, Boolean)

Fills the data set with data fetching it from the database.

[Visual Basic]

Overloads Public Sub Fill( _

ByVal filters As FilterConditions, _

ByVal recreate As Boolean _

)

[C#]

public void Fill(

FilterConditions filters,

bool recreate

);

[Delphi]

public procedure Fill(

filters: FilterConditions;

recreate: Boolean

); overload;

Parameters

filters

Filter conditions restricting the fetched rows of some of the data set table views.

recreate

Set this parameter to True if data set schema has changed since the last time the data set was filled.

Remarks

If data set schema has changed since the last time the data set was filled, you must call one of the Fill overloads with Recreate argument set to True. This recreates the structure of table view and table rowsets in the data set, synchronizing it with the changed schema. Calling Fill without Recreate or Recreate set to False after schema change can cause unpredictable results.

Filter conditions specify restrictions on the fetched rows. Each filter condition represents a restriction on one of the data set table views. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by BeforeFill event code implementing the fetch.

Specifying the TableViewNames argument allows you to selectively fetch certain table views without affecting other table views in the data set.

If the TableViewNames argument is not used, table views with FillIgnore property set to True are not fetched.

Before fetching data, C1DataObjects fires BeforeFill event. You can either pass filter conditions to the Fill method or set them in C1.Data.C1DataSet.BeforeFill event. C1.Data.C1DataSet.BeforeFill event fires both on calling Fill and when the data set is filled at startup due to FillOnRequest = True. After filling the data set, C1DataObjects fires C1.Data.C1DataSet.AfterFill event.


C1DataSet.Fill Method (FilterConditions, String[])

C1DataSet.Fill Method (FilterConditions, String[])

Fills the data set with data fetching it from the database.

[Visual Basic]

Overloads Public Sub Fill( _

ByVal filters As FilterConditions, _

ByVal tableViewNames As String() _

)

[C#]

public void Fill(

FilterConditions filters,

string[] tableViewNames

);

[Delphi]

public procedure Fill(

filters: FilterConditions;

tableViewNames: array of String

); overload;

Parameters

filters

Filter conditions restricting the fetched rows of some of the data set table views.

tableViewNames

Array of names specifying table views to be filled with data. Other table views are not changed.

Remarks

If data set schema has changed since the last time the data set was filled, you must call one of the Fill overloads with Recreate argument set to True. This recreates the structure of table view and table rowsets in the data set, synchronizing it with the changed schema. Calling Fill without Recreate or Recreate set to False after schema change can cause unpredictable results.

Filter conditions specify restrictions on the fetched rows. Each filter condition represents a restriction on one of the data set table views. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by BeforeFill event code implementing the fetch.

Specifying the TableViewNames argument allows you to selectively fetch certain table views without affecting other table views in the data set.

If the TableViewNames argument is not used, table views with FillIgnore property set to True are not fetched.

Before fetching data, C1DataObjects fires BeforeFill event. You can either pass filter conditions to the Fill method or set them in C1.Data.C1DataSet.BeforeFill event. C1.Data.C1DataSet.BeforeFill event fires both on calling Fill and when the data set is filled at startup due to FillOnRequest = True. After filling the data set, C1DataObjects fires C1.Data.C1DataSet.AfterFill event.


C1DataSet.GetChanges Method

C1DataSet.GetChanges Method

Overload List

Gets a copy of the data set containing all changes to simple tables made since it was last filled, or since AcceptChanges was called. Composite tables and table views are empty in the resulting data set.

[Visual Basic] Overloads Public Function GetChanges() As C1DataSet

[C#] public C1DataSet GetChanges();

[Delphi] public function GetChanges() : C1DataSet; overload;

Gets a copy of the data set containing all changes to simple tables made since it was last filled, or since AcceptChanges was called. Composite tables and table views are empty in the resulting data set.

[Visual Basic] Overloads Public Function GetChanges(String(), DataRowStateEnum) As C1DataSet

[C#] public C1DataSet GetChanges(string[], DataRowStateEnum);

[Delphi] public function GetChanges(array of String; DataRowStateEnum) : C1DataSet; overload;


C1DataSet.GetChanges Method ()

C1DataSet.GetChanges Method ()

Gets a copy of the data set containing all changes to simple tables made since it was last filled, or since AcceptChanges was called. Composite tables and table views are empty in the resulting data set.

[Visual Basic]

Overloads Public Function GetChanges() As C1DataSet

[C#]

public C1DataSet GetChanges()

[Delphi]

public function GetChanges():
C1DataSet;
overload;


C1DataSet.GetChanges Method (String[], DataRowStateEnum)

C1DataSet.GetChanges Method (String[], DataRowStateEnum)

Gets a copy of the data set containing all changes to simple tables made since it was last filled, or since AcceptChanges was called. Composite tables and table views are empty in the resulting data set.

[Visual Basic]

Overloads Public Function GetChanges( _

ByVal tableNames As String(), _

ByVal rowStates As DataRowStateEnum _

) As C1DataSet

[C#]

public C1DataSet GetChanges(

string[] tableNames,

DataRowStateEnum rowStates

);

[Delphi]

public function GetChanges(

tableNames: array of String;

rowStates: DataRowStateEnum

): C1DataSet; overload;

Parameters

tableNames

Names of the tables whose modified rows are to be included in the resulting data set. If this argument is null, modified rows of all tables are included.

rowStates

One or more (combination of) flags Added, Modified, Deleted indicating what rows to include.


C1DataSet.GetDefaultTableViewRows Method

C1DataSet.GetDefaultTableViewRows Method

Returns the list of all potential table view rows, pointers to all existing table rows.

[Visual Basic]

Public Function GetDefaultTableViewRows( _

ByVal tableViewName As String _

) As ArrayList

[C#]

public ArrayList GetDefaultTableViewRows(

string tableViewName

);

[Delphi]

public function GetDefaultTableViewRows(

tableViewName: String

): ArrayList;

Parameters

tableViewName

The name of the table view for which to return the list of potential rows.

Remarks

This method can be used only on the second stage of ADO.NET data set modification/synchronization process, see Working with ADO.NET Dataset.

This method returns a list that can be passed as a parameter to SetTableViewRows. If you pass it unchanged, the table view will contain all existing table rows, unrestricted. Filtering this list, building another list from its elements, you can restrict (filter) the table view.

Elements of the returned ArrayList are:

For a table view based on a simple table: C1DataRow objects, rows of the corresponding table.

For a table view based on a composite table: arrays of type C1DataRow[], with length equal to the number of "main" simple tables in the composite table ("main" means connected to its parent with a 1-M relation, not with an M-1 one). That is, every element of the list is an array of table rows, one for each "main" constituent table. A composite table can also contain "linked" constituent tables (connected to their parents with M-1 relations). Since "linked" rows can be uniquely located given the values in "main" rows, they are not used here.


C1DataSet.GetExportDataSet Method

C1DataSet.GetExportDataSet Method

Overload List

Creates and fills with data an ADO.NET data set consisting of this data set's table views.

[Visual Basic] Overloads Public Function GetExportDataSet() As DataSet

[C#] public DataSet GetExportDataSet();

[Delphi] public function GetExportDataSet() : DataSet; overload;

Creates and fills with data an ADO.NET data set consisting of this data set's table views.

[Visual Basic] Overloads Public Function GetExportDataSet(Boolean) As DataSet

[C#] public DataSet GetExportDataSet(bool);

[Delphi] public function GetExportDataSet(Boolean) : DataSet; overload;


C1DataSet.GetExportDataSet Method ()

C1DataSet.GetExportDataSet Method ()

Creates and fills with data an ADO.NET data set consisting of this data set's table views.

[Visual Basic]

Overloads Public Function GetExportDataSet() As DataSet

[C#]

public DataSet GetExportDataSet()

[Delphi]

public function GetExportDataSet(): DataSet; overload;

Remarks

This method can be used to export data and to integrate C1DataObjects with reporters, such as CrystalReports.

It returns an ADO.NET DataSet containing a table for each table view in the C1DataObjects data set definition, and a relation for each view relation.


C1DataSet.GetExportDataSet Method (Boolean)

C1DataSet.GetExportDataSet Method (Boolean)

Creates and fills with data an ADO.NET data set consisting of this data set's table views.

[Visual Basic]

Overloads Public Function GetExportDataSet( _

ByVal schemaOnly As Boolean _

) As DataSet

[C#]

public DataSet GetExportDataSet(

bool schemaOnly

);

[Delphi]

public function GetExportDataSet(

schemaOnly: Boolean

): DataSet; overload;

Parameters

schemaOnly

If True, System.Data.DataSet is created and returned with schema information but without data rows.

Remarks

This method can be used to export data and to integrate C1DataObjects with reporters, such as CrystalReports.

It returns an ADO.NET DataSet containing a table for each table view in the C1DataObjects data set definition, and a relation for each view relation.


C1DataSet.HasChanges Method

C1DataSet.HasChanges Method

Overload List

Gets a value indicating whether the data set has changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic] Overloads Public Function HasChanges() As Boolean

[C#] public bool HasChanges();

[Delphi] public function HasChanges() : Boolean; overload;

Gets a value indicating whether the data set has changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic] Overloads Public Function HasChanges(DataRowStateEnum) As Boolean

[C#] public bool HasChanges(DataRowStateEnum);

[Delphi] public function HasChanges(DataRowStateEnum) : Boolean; overload;


C1DataSet.HasChanges Method ()

C1DataSet.HasChanges Method ()

Gets a value indicating whether the data set has changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic]

Overloads Public Function HasChanges() As Boolean

[C#]

public bool HasChanges()

[Delphi]

public function HasChanges(): Boolean; overload;

Remarks

You can examine HasChanges before calling GetChanges method.


C1DataSet.HasChanges Method (DataRowStateEnum)

C1DataSet.HasChanges Method (DataRowStateEnum)

Gets a value indicating whether the data set has changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic]

Overloads Public Function HasChanges( _

ByVal rowState As DataRowStateEnum _

) As Boolean

[C#]

public bool HasChanges(

DataRowStateEnum rowState

);

[Delphi]

public function HasChanges(

rowState: DataRowStateEnum

): Boolean; overload;

Parameters

rowState

One of the DataRowStateEnum values.

Remarks

You can examine HasChanges before calling GetChanges method.


C1DataSet.Merge Method

C1DataSet.Merge Method

Merges the parameter data set containing only simple table data into this (caller) data set.

[Visual Basic]

Public Sub Merge( _

ByVal dataSet As C1DataSet _

)

[C#]

public void Merge(

C1DataSet dataSet

);

[Delphi]

public procedure Merge(

dataSet: C1DataSet

);

Parameters

dataSet

The dataSet that will be merged into the calling data set.

Remarks

This method copies the data contained in the dataSet argument to the calling C1DataSet. It is used to refresh a data set after its modified rows are updated to the database in a business method, see "Business Methods". The normal sequence is to obtain a data set with the GetChanges method, pass it to the business method, return the passed data set back from the business method and call Merge for the original data set with the returned data set as the parameter.

The dataSet argument object must contain only simple table rows. If one of its table views or composite tables is not empty, this method throws an exception.

For example, see CustomFillUpdate sample.


C1DataSet.PopExecutionMode Method

C1DataSet.PopExecutionMode Method

Restores the execution mode affecting actions invoked while handling another action.

[Visual Basic]

Public Sub PopExecutionMode()

[C#]

public void PopExecutionMode()

[Delphi]

public procedure PopExecutionMode();

Remarks

When PopExecutionMode method is called, it restores the last mode that existed before PushExecutionMode call. PushExecutionMode and PopExecutionMode are the push/pop operations of a stack.


C1DataSet.PushExecutionMode Method

C1DataSet.PushExecutionMode Method

Sets the execution mode affecting actions invoked while handling another action.

[Visual Basic]

Public Sub PushExecutionMode( _

ByVal mode As ExecutionModeEnum _

)

[C#]

public void PushExecutionMode(

ExecutionModeEnum mode

);

[Delphi]

public procedure PushExecutionMode(

mode: ExecutionModeEnum

);

Parameters

mode

One of the ExecutionModeEnum values.

Remarks

When PopExecutionMode method is called, it restores the last mode that existed before PushExecutionMode call. PushExecutionMode and PopExecutionMode are the push/pop operations of a stack.


C1DataSet.ReadXml Method

C1DataSet.ReadXml Method

Overload List

Reads XML data into the data set.

[Visual Basic] Overloads Public Sub ReadXml(Stream)

[C#] public ReadXml(Stream);

[Delphi] public procedure ReadXml(Stream); overload;

Reads XML data into the data set.

[Visual Basic] Overloads Public Sub ReadXml(String)

[C#] public ReadXml(string);

[Delphi] public procedure ReadXml(String); overload;

Reads XML data into the data set.

[Visual Basic] Overloads Public Sub ReadXml(XmlReader)

[C#] public ReadXml(XmlReader);

[Delphi] public procedure ReadXml(XmlReader); overload;


C1DataSet.ReadXml Method (Stream)

C1DataSet.ReadXml Method (Stream)

Reads XML data into the data set.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal stream As Stream _

)

[C#]

public void ReadXml(

Stream stream

);

[Delphi]

public procedure ReadXml(

stream: Stream

); overload;

Parameters

stream

The stream from which to read.

Remarks

The ReadXml method is used to restore the data previously saved by WriteXml (String). Together, these methods allow to save the whole data contents of a C1DataSet and restore it later, for example, to save work when no database connection is available to save it in the database, and restore it and send to the database for update when the connection becomes available.


C1DataSet.ReadXml Method (String)

C1DataSet.ReadXml Method (String)

Reads XML data into the data set.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal fileName As String _

)

[C#]

public void ReadXml(

string fileName

);

[Delphi]

public procedure ReadXml(

fileName: String

); overload;

Parameters

fileName

The file name (including the path) from which to read.

Remarks

The ReadXml method is used to restore the data previously saved by WriteXml (String). Together, these methods allow to save the whole data contents of a C1DataSet and restore it later, for example, to save work when no database connection is available to save it in the database, and restore it and send to the database for update when the connection becomes available.


C1DataSet.ReadXml Method (XmlReader)

C1DataSet.ReadXml Method (XmlReader)

Reads XML data into the data set.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal reader As XmlReader _

)

[C#]

public void ReadXml(

XmlReader reader

);

[Delphi]

public procedure ReadXml(

reader: XmlReader

); overload;

Parameters

reader

The XmlReader which to read.

Remarks

The ReadXml method is used to restore the data previously saved by WriteXml (String). Together, these methods allow to save the whole data contents of a C1DataSet and restore it later, for example, to save work when no database connection is available to save it in the database, and restore it and send to the database for update when the connection becomes available.


C1DataSet.RejectChanges Method

C1DataSet.RejectChanges Method

Rolls back all changes made to the data set since it was filled with data or the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub RejectChanges()

[C#]

public void RejectChanges()

[Delphi]

public procedure RejectChanges();

Remarks

This method returns all data set rows to their original state.

When the RejectChanges method is called, any rows still in edit mode successfully cancel their edits. New rows are removed. Modified and deleted rows return back to their original state (See DataRowStateEnum).

RejectChanges can also be called for a single simple table.


C1DataSet.SetTableViewRows Method

C1DataSet.SetTableViewRows Method

[Visual Basic]

Public Sub SetTableViewRows( _

ByVal tableViewName As String, _

ByVal tableRows As ICollection, _

ByVal fillSort As String _

)

[C#]

public void SetTableViewRows(

string tableViewName,

ICollection tableRows,

string fillSort

);

[Delphi]

public procedure SetTableViewRows(

tableViewName: String;

tableRows: ICollection;

fillSort: String

);


C1DataSet.StopAsyncFetch Method

C1DataSet.StopAsyncFetch Method

For DataAccessMode = VirtualAutomatic, this property stops the background fetch, if a fetch is in progress.

[Visual Basic]

Public Sub StopAsyncFetch( _

ByVal tableViewName As String _

)

[C#]

public void StopAsyncFetch(

string tableViewName

);

[Delphi]

public procedure StopAsyncFetch(

tableViewName: String

);

Parameters

tableViewName

The name of the table view.


C1DataSet.StorageChangeBegin Method

C1DataSet.StorageChangeBegin Method

Begins the process of modifying/synchronizing the underlying ADO.NET DataSet.

[Visual Basic]

Public Sub StorageChangeBegin()

[C#]

public void StorageChangeBegin()

[Delphi]

public procedure StorageChangeBegin();

Remarks

The process of modifying/synchronizing the underlying ADO.NET DataSet, see Working with ADO.NET Dataset, consists of two stages:

First stage (between StorageChangeBegin and StorageChanged) is for modifying the ADO.NET data set C1DataSet.StorageDataSet by any means available in ADO.NET. Simple tables are filled with rows or modified at this stage.

Second stage (between StorageChanged and StorageChangeEnd) is for synchronizing the C1DataSet with changed underlying data. Table views are filled with rows on this stage, using the SetTableViewRowsmethod.


C1DataSet.StorageChanged Method

C1DataSet.StorageChanged Method

Overload List

Marks the end of the first stage of modifying/synchronizing the underlying ADO.NET DataSet.

[Visual Basic] Overloads Public Sub StorageChanged()

[C#] public StorageChanged();

[Delphi] public procedure StorageChanged(); overload;

Marks the end of the first stage of modifying/synchronizing the underlying ADO.NET DataSet.

[Visual Basic] Overloads Public Sub StorageChanged(Boolean)

[C#] public StorageChanged(bool);

[Delphi] public procedure StorageChanged(Boolean); overload;


C1DataSet.StorageChanged Method ()

C1DataSet.StorageChanged Method ()

Marks the end of the first stage of modifying/synchronizing the underlying ADO.NET DataSet.

[Visual Basic]

Overloads Public Sub StorageChanged()

[C#]

public void StorageChanged()

[Delphi]

public procedure StorageChanged(); overload;

Remarks

The process of modifying/synchronizing the underlying ADO.NET DataSet consists of two stages:

First stage (between StorageChangeBegin and StorageChanged) is for modifying the ADO.NET data set StorageDataSet by any means available in ADO.NET. Simple tables are filled with rows or modified at this stage.

Second stage (between StorageChanged and StorageChangeEnd) is for synchronizing the C1DataSet with changed underlying data. Table views are filled with rows on this stage, using the SetTableViewRows method.

StorageChanged call is required between StorageChangeBegin and StorageChangeEnd, to mark the end of the first stage and the beginning of the second.

Calling StorageChanged with clearTableViews=False allows to make simple changes to StorageDataSet without modifying table view rows. For example, you might want to change some field values in the underlying ADO.NET data set, and you are sure that this will not affect table view rows in any way, that is, all table view rows will still point to the same table rows, only data in the table rows will change. In such case, you can use clearTableViews=False and skip the second stage (synchronization). But this must be done with caution, because C1DataObjects does not verify these conditions. If, for example, you delete a table row that was pointed to by a table view row, it will cause unpredictable behavior. Also, using clearTableViews=False means that the collection of table view rows will not change, so any rows added to the ADO.NET data set will not be reflected in the table views.


C1DataSet.StorageChanged Method (Boolean)

C1DataSet.StorageChanged Method (Boolean)

Marks the end of the first stage of modifying/synchronizing the underlying ADO.NET DataSet.

[Visual Basic]

Overloads Public Sub StorageChanged( _

ByVal clearTableViews As Boolean _

)

[C#]

public void StorageChanged(

bool clearTableViews

);

[Delphi]

public procedure StorageChanged(

clearTableViews: Boolean

); overload;

Parameters

clearTableViews

Whether to clear all table view rows or not. This parameter is True by default, meaning that table views are cleared at the end of the first stage.

Remarks

The process of modifying/synchronizing the underlying ADO.NET DataSet consists of two stages:

First stage (between StorageChangeBegin and StorageChanged) is for modifying the ADO.NET data set StorageDataSet by any means available in ADO.NET. Simple tables are filled with rows or modified at this stage.

Second stage (between StorageChanged and StorageChangeEnd) is for synchronizing the C1DataSet with changed underlying data. Table views are filled with rows on this stage, using the SetTableViewRows method.

StorageChanged call is required between StorageChangeBegin and StorageChangeEnd, to mark the end of the first stage and the beginning of the second.

Calling StorageChanged with clearTableViews=False allows to make simple changes to StorageDataSet without modifying table view rows. For example, you might want to change some field values in the underlying ADO.NET data set, and you are sure that this will not affect table view rows in any way, that is, all table view rows will still point to the same table rows, only data in the table rows will change. In such case, you can use clearTableViews=False and skip the second stage (synchronization). But this must be done with caution, because C1DataObjects does not verify these conditions. If, for example, you delete a table row that was pointed to by a table view row, it will cause unpredictable behavior. Also, using clearTableViews=False means that the collection of table view rows will not change, so any rows added to the ADO.NET data set will not be reflected in the table views.


C1DataSet.StorageChangeEnd Method

C1DataSet.StorageChangeEnd Method

Ends the process of modifying/synchronizing the underlying ADO.NET DataSet.

[Visual Basic]

Public Sub StorageChangeEnd()

[C#]

public void StorageChangeEnd()

[Delphi]

public procedure StorageChangeEnd();

Remarks

Related topics: StorageChangeBegin Method, StorageChanged Method.


C1DataSet.Update Method

C1DataSet.Update Method

Overload List

Updates (commits) all changed data set rows to the database.

[Visual Basic] Overloads Public Sub Update()

[C#] public Update();

[Delphi] public procedure Update(); overload;

Updates (commits) all changed data set rows to the database.

[Visual Basic] Overloads Overridable Public Sub Update(String())

[C#] virtual public Update(string[]);

[Delphi] public procedure Update(array of String); overload; virtual;


C1DataSet.Update Method ()

C1DataSet.Update Method ()

Updates (commits) all changed data set rows to the database.

[Visual Basic]

Overloads Public Sub Update()

[C#]

public void Update()

[Delphi]

public procedure Update(); overload;

Remarks

Update method without parameters updates the whole data set.

Update method with tableNames parameter updates only changes in the tables listed in tableNames. The tableNames parameter must contain a list of simple tables (not composite tables or table views).

Update method with tableNames parameter does not allow updating a table that is used in a composite table as a main constituent table (is connected to its parent in the composite table diagram with a one-to-many relation; the restriction does not apply to those connected many-to-one). If this restriction is not satisfied, the method throws an exception. In such case, always use Update without parameters to update the whole data set.

An unsuccessful update, including one resulting in an exception, triggers C1.Data.C1DataSet.UpdateError event. If user code sets the event’s Status argument to Continue, an update attempt is made again. This loop continues until either the update succeeds or UpdateError event code does not set Status to Continue. See "Handling Update Errors on the Client" for details.


C1DataSet.Update Method (String[])

C1DataSet.Update Method (String[])

Updates (commits) all changed data set rows to the database.

[Visual Basic]

Overloads Overridable Public Sub Update( _

ByVal tableNames As String() _

)

[C#]

virtual public void Update(

string[] tableNames

);

[Delphi]

public procedure Update(

tableNames: array of String

); overload; virtual;

Parameters

tableNames

Array containing the names of simple tables to be updated to the database.

Remarks

Update method without parameters updates the whole data set.

Update method with tableNames parameter updates only changes in the tables listed in tableNames. The tableNames parameter must contain a list of simple tables (not composite tables or table views).

Update method with tableNames parameter does not allow updating a table that is used in a composite table as a main constituent table (is connected to its parent in the composite table diagram with a one-to-many relation; the restriction does not apply to those connected many-to-one). If this restriction is not satisfied, the method throws an exception. In such case, always use Update without parameters to update the whole data set.

An unsuccessful update, including one resulting in an exception, triggers C1.Data.C1DataSet.UpdateError event. If user code sets the event’s Status argument to Continue, an update attempt is made again. This loop continues until either the update succeeds or UpdateError event code does not set Status to Continue. See "Handling Update Errors on the Client" for details.


C1DataSet.WriteXml Method

C1DataSet.WriteXml Method

Overload List

Writes XML data from the data set.

[Visual Basic] Overloads Public Sub WriteXml(Stream)

[C#] public WriteXml(Stream);

[Delphi] public procedure WriteXml(Stream); overload;

Writes XML data from the data set.

[Visual Basic] Overloads Public Sub WriteXml(String)

[C#] public WriteXml(string);

[Delphi] public procedure WriteXml(String); overload;

Writes XML data from the data set.

[Visual Basic] Overloads Public Sub WriteXml(XmlTextWriter)

[C#] public WriteXml(XmlTextWriter);

[Delphi] public procedure WriteXml(XmlTextWriter); overload;


C1DataSet.WriteXml Method (Stream)

C1DataSet.WriteXml Method (Stream)

Writes XML data from the data set.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal stream As Stream _

)

[C#]

public void WriteXml(

Stream stream

);

[Delphi]

public procedure WriteXml(

stream: Stream

); overload;

Parameters

stream

The stream to which to write.

Remarks

The WriteXml method is used to save the data in an XML form so it can be later restored with ReadXml (String). Together, these methods allow to save the whole data contents of a C1DataSet and restore it later, for example, to save work when no database connection is available to save it in the database, and restore it and send to the database for update when the connection becomes available.


C1DataSet.WriteXml Method (String)

C1DataSet.WriteXml Method (String)

Writes XML data from the data set.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal fileName As String _

)

[C#]

public void WriteXml(

string fileName

);

[Delphi]

public procedure WriteXml(

fileName: String

); overload;

Parameters

fileName

The file name (including the path) to which to write.

Remarks

The WriteXml method is used to save the data in an XML form so it can be later restored with ReadXml (String). Together, these methods allow to save the whole data contents of a C1DataSet and restore it later, for example, to save work when no database connection is available to save it in the database, and restore it and send to the database for update when the connection becomes available.


C1DataSet.WriteXml Method (XmlTextWriter)

C1DataSet.WriteXml Method (XmlTextWriter)

Writes XML data from the data set.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal writer As XmlTextWriter _

)

[C#]

public void WriteXml(

XmlTextWriter writer

);

[Delphi]

public procedure WriteXml(

writer: XmlTextWriter

); overload;

Parameters

writer

The XmlReader to which to write.

Remarks

The WriteXml method is used to save the data in an XML form so it can be later restored with ReadXml (String). Together, these methods allow to save the whole data contents of a C1DataSet and restore it later, for example, to save work when no database connection is available to save it in the database, and restore it and send to the database for update when the connection becomes available.


C1DataSet Events

C1DataSet Events

The events of the C1DataSet class are listed here. For a complete list of C1DataSet class members, see the C1DataSet Members topic.

Public Events

AfterFill | Fired after the data set is filled with data.
BeforeFill | Fired before the data set fills with data.
CurrentRowChanged | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
Error | Fired when an error occurs.
PositionChanged | Fired when one of the data set data members changes current row position.
UpdateError | Fired when an error occurs committing changes to the dataset.


C1DataSet.AfterFill Event

C1DataSet.AfterFill Event

Fired after the data set is filled with data.

[Visual Basic]

Public Event AfterFill As FillEventHandler

[C#]

public event FillEventHandler AfterFill

[Delphi]

public property AfterFill: FillEventHandler read remove_AfterFill write add_AfterFill;

Remarks

This event is fired on the client after the data set is filled with data. It is fired both when Fill is called and when the data set is filled at startup due to FillOnRequest = True.

In this event, you can modify the data set after it has been filled with data fetched from the server.


C1DataSet.BeforeFill Event

C1DataSet.BeforeFill Event

Fired before the data set fills with data.

[Visual Basic]

Public Event BeforeFill As FillEventHandler

[C#]

public event FillEventHandler BeforeFill

[Delphi]

public property BeforeFill: FillEventHandler read remove_BeforeFill write add_BeforeFill;

Remarks

This event is fired on the client before calling the server to fill the data set with data. It is fired both when Fill is called and when the data set is filled at startup due to FillOnRequest = True.

In this event, you can add filter conditions to Filter before passing the request on to the server.


C1DataSet.CurrentRowChanged Event

C1DataSet.CurrentRowChanged Event

Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.

[Visual Basic]

Public Event CurrentRowChanged As CurrentRowChangedEventHandler

[C#]

public event CurrentRowChangedEventHandler CurrentRowChanged

[Delphi]

public property CurrentRowChanged: CurrentRowChangedEventHandler read remove_CurrentRowChanged write add_CurrentRowChanged;

Remarks

The CurrentRowChanged event is useful in scenarios like synchronizing detail data with the master row on every change occurring in the master row. The CurrentRowChanged event is triggered in two main cases:

1. When row currency changes, another row becomes current, or the whole rowset is refreshed. In this case, event argument property ChangeType is set to RowChangedTypeEnum.CurrentRowChanged.

2. When the value of a field (or several fields) in the current row is changed. In this case, event argument property ChangeType is set to RowChangedTypeEnum.FieldsChanged.


C1DataSet.Error Event

C1DataSet.Error Event

Fired when an error occurs.

[Visual Basic]

Public Event Error As DataSetEventHandler

[C#]

public event DataSetEventHandler Error

[Delphi]

public property Error: DataSetEventHandler read remove_Error write add_Error;

Remarks

This event gives developers full control over error (exception) handling. It allows to customize/localize error messages or provide a fully customized error handling if necessary.

When this event is fired, the Status argument is set either to ErrorsOccured or to Continue. It is set to ErrorsOccured if the error occurred during an action executed from code, and to Continue if it occurred performing an action requested by data bound controls.

What happens next, whether the error is considered handled or throws an exception, depends on the value you assign to the Status argument:

1. If you set Status to ErrorsOccured, an exception is thrown. To specify the exception information, set the Error argument. Use this option in cases where you do not need to override the standard exception handling.

2. If you set Status to Skip, the error is considered handled and operation resumes as if the error has not occurred (but subsequent actions may not be executed when they depend on the successful completion of the current action). Use this option when you want to handle the error in your code, suppress the standard error handling and consider the operation successful.

3. If you set Status to Continue, C1DataObjects shows a standard error message box and resumes operation without throwing an exception (as in the Skip case). Use this option when you are satisfied with the standard C1DataObjects error message and want to consider the operation successful.

4. It is also possible that you need to show a custom error message or otherwise handle the error in the Error event, then throw an exception, but do not want data bound controls to show their own error messages because you have already shown an error message. To accomplish that, set Status to ErrorsOccured and throw an exception derived from C1DataException with ShowMessage property set to False. Note that this behavior is only supported by data bound controls honoring the ShowMessage property, such as ComponentOne FlexGrid and C1TrueDBGrid.


C1DataSet.PositionChanged Event

C1DataSet.PositionChanged Event

Fired when one of the data set data members changes current row position.

[Visual Basic]

Public Event PositionChanged As PositionChangeEventHandler

[C#]

public event PositionChangeEventHandler PositionChanged

[Delphi]

public property PositionChanged: PositionChangeEventHandler read remove_PositionChanged write add_PositionChanged;

Remarks

Current row position is managed by the form containing the data set component. Each DataMember has its own current row position that is managed by a System.Windows.Forms.CurrencyManager object attached to it by the form. Data bound controls interact with CurrencyManager to synchronize with current row position and request moving to a new row position.

Whenever current row position changes for any of the data set data members, the PositionChanged event fires. It allows you to associate business logic with changes in current row position.


C1DataSet.UpdateError Event

C1DataSet.UpdateError Event

Fired when an error occurs committing changes to the dataset.

[Visual Basic]

Public Event UpdateError As DataSetEventHandler

[C#]

public event DataSetEventHandler UpdateError

[Delphi]

public property UpdateError: DataSetEventHandler read remove_UpdateError write add_UpdateError;

Remarks

An unsuccessful update, including one resulting in an exception, triggers UpdateError event. If user code sets the event’s Status argument to Continue, an update attempt is made again. This loop continues until either the update succeeds or UpdateError event code does not set Status to Continue. See Handling Update Errors on the Client for details.

If the error is a fatal failure (a program or physical error, see Handling Errors in Update), the Error argument contains the exception object describing the failure. If this is a concurrency conflict that could not be reconciled on the server (see Handling Concurrency Conflicts), the Error argument is set to null (Nothing in Visual Basic). In case of a concurrency conflict, the rows that failed update can be found in the DataSet using the properties RowError, HasErrors and GetErrors.


C1DataSetLogic Class

C1DataSetLogic Class

A C1DataSetLogic component hosts business logic event code for a data set, for all table views of that data set.

For a list of all members of this type, see C1DataSetLogic Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseLogic

C1.Data.C1DataSetLogic

[Visual Basic]

Public Class C1DataSetLogic

Inherits BaseLogic

[C#]

public class C1DataSetLogic : BaseLogic

[Delphi]

type C1DataSetLogic = class (BaseLogic);

Remarks

It connects to the schema by setting its Schema property, and to a particular data set definition in the schema by setting its DataSetDef property. Business logic is then specified in its events, most of which are inherited from the BaseLogic class.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataSetLogic Members

C1DataSetLogic Members

C1DataSetLogic overview

Public Properties

DataSetDef | Returns or sets the name of the data set represented by this component.
Schema (inherited from BaseLogic) | Returns or sets the C1SchemaDef component holding the owner schema.
SchemaComponent (inherited from BaseLogic) | This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.

Public Events

AfterAddNew (inherited from BaseLogic) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseLogic) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseLogic) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseLogic) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFetch | An AfterFetch event is fired after a table view has been fetched from the database. Also, after all AfterFetch events have been fired for individual table views, an AfterFetch event is fired for the whole fetch session, with the TableView argument set to null (Nothing in Visual Basic). Use this event to execute code after all table views have been fetched.
AfterFieldChange (inherited from BaseLogic) | Fired after a field value is set.
AfterFirstChange (inherited from BaseLogic) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterGenerateSql | Fired after generating the SQL SELECT statement for fetching a table view from the database.
AfterUpdate | Fired after all changes in the data set are updated to the database.
AfterUpdateRow (inherited from BaseLogic) | Fired after modifications made to a row are committed to the database.
BeforeAddNew (inherited from BaseLogic) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseLogic) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseLogic) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFetch | Fired before a table view is fetched from the database.
BeforeFieldChange (inherited from BaseLogic) | Fired before a field value is set.
BeforeFirstChange (inherited from BaseLogic) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeGenerateSql | Fired before generating the SQL SELECT statement for fetching a table view from the database.
BeforeUpdate | Fired before all changes in the data set are updated to the database.
BeforeUpdateRow (inherited from BaseLogic) | Fired before modifications made to a row are committed to the database.
ChangesAccepted (inherited from BaseLogic) | Fired when AcceptChanges has been performed for a table or for the whole data set.
ChangesRejected (inherited from BaseLogic) | Fired when RejectChanges has been performed for a table or for the whole data set.
GetChildRows | Used to programmatically specify the list of child rows for a relation.
GetParentRow | Used to programmatically specify the parent row for a relation.


C1DataSetLogic Properties

C1DataSetLogic Properties

The properties of the C1DataSetLogic class are listed here. For a complete list of C1DataSetLogic class members, see the C1DataSetLogic Members topic.

Public Properties

DataSetDef | Returns or sets the name of the data set represented by this component.
Schema (inherited from BaseLogic) | Returns or sets the C1SchemaDef component holding the owner schema.
SchemaComponent (inherited from BaseLogic) | This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.


C1DataSetLogic.DataSetDef Property

C1DataSetLogic.DataSetDef Property

Returns or sets the name of the data set represented by this component.

[Visual Basic]

Public Property DataSetDef As String

[C#]

public string DataSetDef {get;set;}

[Delphi]

public property DataSetDef: String read get_DataSetDef write set_DataSetDef;


C1DataSetLogic Events

C1DataSetLogic Events

The events of the C1DataSetLogic class are listed here. For a complete list of C1DataSetLogic class members, see the C1DataSetLogic Members topic.

Public Events

AfterAddNew (inherited from BaseLogic) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseLogic) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseLogic) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseLogic) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFetch | An AfterFetch event is fired after a table view has been fetched from the database. Also, after all AfterFetch events have been fired for individual table views, an AfterFetch event is fired for the whole fetch session, with the TableView argument set to null (Nothing in Visual Basic). Use this event to execute code after all table views have been fetched.
AfterFieldChange (inherited from BaseLogic) | Fired after a field value is set.
AfterFirstChange (inherited from BaseLogic) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterGenerateSql | Fired after generating the SQL SELECT statement for fetching a table view from the database.
AfterUpdate | Fired after all changes in the data set are updated to the database.
AfterUpdateRow (inherited from BaseLogic) | Fired after modifications made to a row are committed to the database.
BeforeAddNew (inherited from BaseLogic) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseLogic) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseLogic) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFetch | Fired before a table view is fetched from the database.
BeforeFieldChange (inherited from BaseLogic) | Fired before a field value is set.
BeforeFirstChange (inherited from BaseLogic) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeGenerateSql | Fired before generating the SQL SELECT statement for fetching a table view from the database.
BeforeUpdate | Fired before all changes in the data set are updated to the database.
BeforeUpdateRow (inherited from BaseLogic) | Fired before modifications made to a row are committed to the database.
ChangesAccepted (inherited from BaseLogic) | Fired when AcceptChanges has been performed for a table or for the whole data set.
ChangesRejected (inherited from BaseLogic) | Fired when RejectChanges has been performed for a table or for the whole data set.
GetChildRows | Used to programmatically specify the list of child rows for a relation.
GetParentRow | Used to programmatically specify the parent row for a relation.


C1DataSetLogic.AfterFetch Event

C1DataSetLogic.AfterFetch Event

An AfterFetch event is fired after a table view has been fetched from the database. Also, after all AfterFetch events have been fired for individual table views, an AfterFetch event is fired for the whole fetch session, with the TableView argument set to null (Nothing in Visual Basic). Use this event to execute code after all table views have been fetched.

[Visual Basic]

Public Event AfterFetch As FetchEventHandler

[C#]

public event FetchEventHandler AfterFetch

[Delphi]

public property AfterFetch: FetchEventHandler read remove_AfterFetch write add_AfterFetch;


C1DataSetLogic.AfterGenerateSql Event

C1DataSetLogic.AfterGenerateSql Event

Fired after generating the SQL SELECT statement for fetching a table view from the database.

[Visual Basic]

Public Event AfterGenerateSql As GenerateSqlEventHandler

[C#]

public event GenerateSqlEventHandler AfterGenerateSql

[Delphi]

public property AfterGenerateSql: GenerateSqlEventHandler read remove_AfterGenerateSql write add_AfterGenerateSql;

Remarks

In this event, you can examine and modify the SQL SELECT statement generated by C1DataObjects.


C1DataSetLogic.AfterUpdate Event

C1DataSetLogic.AfterUpdate Event

Fired after all changes in the data set are updated to the database.

[Visual Basic]

Public Event AfterUpdate As DataSetEventHandler

[C#]

public event DataSetEventHandler AfterUpdate

[Delphi]

public property AfterUpdate: DataSetEventHandler read remove_AfterUpdate write add_AfterUpdate;

Remarks

The AfterUpdate event is fired after the update process is completed or skipped, regardless of whether it was successful or failed. The success status of the update process is passed to the event in the Status argument. The Status argument can also be modified by the event code to make C1DataObjects ignore an error, or vice versa, to make the update fail.

Among its possible uses, this event allows to control the whole data set (via its Tables argument) sent back to the client for refreshing updated rows, see Changing Data as a Result of Update (Refresh).


C1DataSetLogic.BeforeFetch Event

C1DataSetLogic.BeforeFetch Event

Fired before a table view is fetched from the database.

[Visual Basic]

Public Event BeforeFetch As FetchEventHandler

[C#]

public event FetchEventHandler BeforeFetch

[Delphi]

public property BeforeFetch: FetchEventHandler read remove_BeforeFetch write add_BeforeFetch;

Remarks

This event is mainly intended for populating unbound tables. Unbound table fetch is performed in the event code. To provide data, you must create a data reader implementing the System.Data.IDataReader interface and assign it to the Reader argument. C1DataObjects provides a helper class UnboundDataReader that you can use to create your reader. If you have your data in the form of a System.Data.DataTable, create an UnboundDataReader passing the DataTable object to its constructor. You can also create standard .NET Framework or third-party objects implementing IDataReader, such as OleDbReader or SqlDataReader, or implement your own custom data reader, if necessary.

Before any BeforeFetch events are fired for individual table views, a BeforeFetch event is fired for the whole fetch session, with the TableView argument set to null (Nothing in Visual Basic). Use this event to execute code before any table views are fetched.


C1DataSetLogic.BeforeGenerateSql Event

C1DataSetLogic.BeforeGenerateSql Event

Fired before generating the SQL SELECT statement for fetching a table view from the database.

[Visual Basic]

Public Event BeforeGenerateSql As GenerateSqlEventHandler

[C#]

public event GenerateSqlEventHandler BeforeGenerateSql

[Delphi]

public property BeforeGenerateSql: GenerateSqlEventHandler read remove_BeforeGenerateSql write add_BeforeGenerateSql;

Remarks

This event is used for SQL-based tables to specify the SQL SELECT statement that populates the table, fetches data from the database. The SQL statement is assigned to the Sql argument or to the CommandText property of the Command argument.

If you use the Command argument, the command does not necessarily have to contain a SELECT statement. You can use a stored procedure instead, or you can use a parameterized SELECT. You can even create your own command object and assign it to the Command argument. The only requirement is that you set up the Command argument passed to the event with all necessary properties so it becomes a valid IDbCommand ready for execution. C1DataObjects executes the command’s ExecuteReader method.


C1DataSetLogic.BeforeUpdate Event

C1DataSetLogic.BeforeUpdate Event

Fired before all changes in the data set are updated to the database.

[Visual Basic]

Public Event BeforeUpdate As DataSetEventHandler

[C#]

public event DataSetEventHandler BeforeUpdate

[Delphi]

public property BeforeUpdate: DataSetEventHandler read remove_BeforeUpdate write add_BeforeUpdate;

Remarks

Before any modified rows are committed to the database, the BeforeUpdate event fires. The DataSet argument contains the data set passed to the server for update. By modifying this data set, you can customize the update process, control the set of rows and field values that undergo database update.

You can even perform the whole update process in your code in the BeforeUpdate event and tell C1DataObjects to skip further processing, consider it done, by setting the Status argument to Skip. If you detect an unrecoverable error in this event, set the Status argument to ErrorsOccurred and set the Error argument to describe the error.


C1DataSetLogic.GetChildRows Event

C1DataSetLogic.GetChildRows Event

Used to programmatically specify the list of child rows for a relation.

[Visual Basic]

Public Event GetChildRows As GetListEventHandler

[C#]

public event GetListEventHandler GetChildRows

[Delphi]

public property GetChildRows: GetListEventHandler read remove_GetChildRows write add_GetChildRows;

Remarks

This event can be used to create custom view relations, when the rule defining the list of child rows for a parent row cannot be formulated based on a simple relation between tables. For example, see CustomRelations sample in the Samples directory, where a custom relation is used to represent a many-to-many relation.

If the GetRowsEvent property is set to True for a view relation, the GetChildRows event is called every time C1DataObjects needs to obtain the list of child rows for a parent row for that relation. Event code sets the argument e.List to a list of rows, thus defining the child rows of the relation. The resulting list, if not empty, must contain C1DataRow objects belonging to the child table view of the relation.


C1DataSetLogic.GetParentRow Event

C1DataSetLogic.GetParentRow Event

Used to programmatically specify the parent row for a relation.

[Visual Basic]

Public Event GetParentRow As GetListEventHandler

[C#]

public event GetListEventHandler GetParentRow

[Delphi]

public property GetParentRow: GetListEventHandler read remove_GetParentRow write add_GetParentRow;

Remarks

This event can be used in addition to C1.Data.C1DataSetLogic.GetChildRows event for two-way custom view relations. If the OneWay property is set to True, the custom relation does not support getting parent row (note that only C1.Data.C1DataSetLogic.GetChildRows is used for master-detail data binding, GetParentRow is not necessary, it may only be needed in code). If OneWay =False for a custom relation, C1DataObjects calls the GetParentRow event to obtain the parent row whenever GetParentRow (String) is called.


C1DataTable Class

C1DataTable Class

Represents a table or table view rowset filled with data. Provides programmatic access to table view or table data. To obtain a C1DataTable object, use TableViews or Tables collection property of a C1DataSet component.

For a list of all members of this type, see C1DataTable Members.

System.Object

C1.Data.C1DataTable

[Visual Basic]

Public Class C1DataTable

Implements IListSource

[C#]

public class C1DataTable : IListSource

[Delphi]

type C1DataTable = class (TObject, IListSource);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataTable Members

C1DataTable Members

C1DataTable overview

Public Properties

CaseSensitive | Determines whether string comparisons within the data table are case-sensitive.
DataSet | Gets the data set this data table belongs to.
ExtendedProperties | Gets a collection of custom user information associated with the data table.
FetchIndex | Gets or sets fetch order of the data table representing a table view rowset.
Fields | This run-time property returns the collection of fields in the data table.
HasErrors | Gets a value indicating whether there are errors in any of the rows of this data table.
Locale | Determines the locale information used in string comparisons within the data table.
Name | Gets the name of the data table.
PrimaryKey | Gets an array of fields that function as primary key of this data table.
Rows | This run-time property returns the collection of rows belonging to this data table.
SchemaTable | Gets a Table or TableView schema object representing the schema of this data table.
StorageDataTable | Gets the ADO.NET DataTable storing data rows for a simple table.

Public Methods

AcceptChanges | Commits all changes made to the table since it was filled with data or the last time AcceptChanges or RejectChanges was called.
AddNew | Adds a new row to the data table.
Compute | Computes an aggregation expression on the rows that satisfy a filter condition.
GetErrors | Gets an array of C1DataRow objects that contain errors.
Refresh | Refreshes field values in all data table rows and notifies data bound controls that the rows have changed.
RejectChanges | Rolls back all changes made to the table since it was filled with data or the last time AcceptChanges or RejectChanges was called.


C1DataTable Properties

C1DataTable Properties

The properties of the C1DataTable class are listed here. For a complete list of C1DataTable class members, see the C1DataTable Members topic.

Public Properties

CaseSensitive | Determines whether string comparisons within the data table are case-sensitive.
DataSet | Gets the data set this data table belongs to.
ExtendedProperties | Gets a collection of custom user information associated with the data table.
FetchIndex | Gets or sets fetch order of the data table representing a table view rowset.
Fields | This run-time property returns the collection of fields in the data table.
HasErrors | Gets a value indicating whether there are errors in any of the rows of this data table.
Locale | Determines the locale information used in string comparisons within the data table.
Name | Gets the name of the data table.
PrimaryKey | Gets an array of fields that function as primary key of this data table.
Rows | This run-time property returns the collection of rows belonging to this data table.
SchemaTable | Gets a Table or TableView schema object representing the schema of this data table.
StorageDataTable | Gets the ADO.NET DataTable storing data rows for a simple table.


C1DataTable.CaseSensitive Property

C1DataTable.CaseSensitive Property

Determines whether string comparisons within the data table are case-sensitive.

[Visual Basic]

Public Property CaseSensitive As Boolean

[C#]

public bool CaseSensitive {get;set;}

[Delphi]

public property CaseSensitive: Boolean read get_CaseSensitive write set_CaseSensitive;

Remarks

This property affects string comparison in expression evaluation, sorting table views by the end user (via IBindingList.ApplySort) and sorting in C1DataView objects.

By default, all C1DataTable objects created by a C1DataSet use the CaseSensitive property of the C1DataSet, but it can be overridden setting the CaseSensitive property of the C1DataTable object.


C1DataTable.DataSet Property

C1DataTable.DataSet Property

Gets the data set this data table belongs to.

[Visual Basic]

Public ReadOnly Property DataSet As C1DataSet

[C#]

public C1DataSet DataSet {get;}

[Delphi]

public property DataSet: C1DataSet read get_DataSet;


C1DataTable.ExtendedProperties Property

C1DataTable.ExtendedProperties Property

Gets a collection of custom user information associated with the data table.

[Visual Basic]

Public ReadOnly Property ExtendedProperties As PropertyCollection

[C#]

public PropertyCollection ExtendedProperties {get;}

[Delphi]

public property ExtendedProperties: PropertyCollection read get_ExtendedProperties;

Remarks

This property allows you to store arbitrary custom information with the object.


C1DataTable.FetchIndex Property

C1DataTable.FetchIndex Property

Gets or sets fetch order of the data table representing a table view rowset.

[Visual Basic]

Public Property FetchIndex As Integer

[C#]

public int FetchIndex {get;set;}

[Delphi]

public property FetchIndex: Int32 read get_FetchIndex write set_FetchIndex;

Remarks

This property is used to modify fetch order dynamically in the C1.Data.C1DataSetLogic.BeforeFetch event when this event is fired with empty an TableView argument before fetching any table views. For example:

Visual Basic:

Private Sub DataSet_BeforeFetch(ByVal sender As Object, ByVal e As C1.Data.FetchEventArgs) Handles DataSet.BeforeFetch

If e.TableView Is Nothing Then

e.TableViews("maindata").FetchIndex = 0

End If

End Sub

C#:

private void dataset_DataSet_BeforeFetch(object sender, C1.Data.FetchEventArgs e)

{

if (e.TableView == null)

e.TableViews["maindata"].FetchIndex = 0;

}

Delphi:

procedure TForm.dataset_BeforeFetch(sender: System.Object; e: C1.Data.FetchEventArgs);

begin

if e.TableView = nil then

e.TableViews['maindata'].FetchIndex := 0;

end;

If you only need to modify fetch order statically, it is easier to do it setting the FetchIndex property in Schema Designer.

Possible values: from 0 up to the number of table views in the dataset.


C1DataTable.Fields Property

C1DataTable.Fields Property

This run-time property returns the collection of fields in the data table.

[Visual Basic]

Public ReadOnly Property Fields As DataFieldCollection

[C#]

public DataFieldCollection Fields {get;}

[Delphi]

public property Fields: DataFieldCollection read get_Fields;


C1DataTable.HasErrors Property

C1DataTable.HasErrors Property

Gets a value indicating whether there are errors in any of the rows of this data table.

[Visual Basic]

Public ReadOnly Property HasErrors As Boolean

[C#]

public bool HasErrors {get;}

[Delphi]

public property HasErrors: Boolean read get_HasErrors;

Remarks

To get all errors, use the GetErrors method.


C1DataTable.Locale Property

C1DataTable.Locale Property

Determines the locale information used in string comparisons within the data table.

[Visual Basic]

Public Property Locale As CultureInfo

[C#]

public CultureInfo Locale {get;set;}

[Delphi]

public property Locale: CultureInfo read get_Locale write set_Locale;

Remarks

This property affects string comparison in expression evaluation, sorting table views by the end user (via IBindingList.ApplySort) and sorting in C1DataView objects.

By default, all C1DataTable objects created by a C1DataSet use the Locale property of the C1DataSet, but it can be overridden setting the Locale property of the C1DataTable object.


C1DataTable.Name Property

C1DataTable.Name Property

Gets the name of the data table.

[Visual Basic]

Public ReadOnly Property Name As String

[C#]

public string Name {get;}

[Delphi]

public property Name: String read get_Name;

Remarks

This property is used to return this data table from the C1DataSet object’s two data table collections, Tables and TableViews.


C1DataTable.PrimaryKey Property

C1DataTable.PrimaryKey Property

Gets an array of fields that function as primary key of this data table.

[Visual Basic]

Public ReadOnly Property PrimaryKey As DataField()

[C#]

public DataField[] PrimaryKey {get;}

[Delphi]

public property PrimaryKey: array of DataField read get_PrimaryKey;


C1DataTable.Rows Property

C1DataTable.Rows Property

This run-time property returns the collection of rows belonging to this data table.

[Visual Basic]

Public ReadOnly Property Rows As C1DataRowCollection

[C#]

public C1DataRowCollection Rows {get;}

[Delphi]

public property Rows: C1DataRowCollection read get_Rows;


C1DataTable.SchemaTable Property

C1DataTable.SchemaTable Property

Gets a Table or TableView schema object representing the schema of this data table.

[Visual Basic]

Public ReadOnly Property SchemaTable As BaseTable

[C#]

public BaseTable SchemaTable {get;}

[Delphi]

public property SchemaTable: BaseTable read get_SchemaTable;


C1DataTable.StorageDataTable Property

C1DataTable.StorageDataTable Property

Gets the ADO.NET DataTable storing data rows for a simple table.

[Visual Basic]

Public ReadOnly Property StorageDataTable As DataTable

[C#]

public DataTable StorageDataTable {get;}

[Delphi]

public property StorageDataTable: DataTable read get_StorageDataTable;

Remarks

This data table belongs to the ADO.NET data set C1DataSet.StorageDataSet.

This property returns a non-null value only for C1DataTable objects representing simple tables. For C1DataTable objects representing composite tables and table views, this property returns null (Nothing in Visual Basic).


C1DataTable Methods

C1DataTable Methods

The methods of the C1DataTable class are listed here. For a complete list of C1DataTable class members, see the C1DataTable Members topic.

Public Methods

AcceptChanges | Commits all changes made to the table since it was filled with data or the last time AcceptChanges or RejectChanges was called.
AddNew | Adds a new row to the data table.
Compute | Computes an aggregation expression on the rows that satisfy a filter condition.
GetErrors | Gets an array of C1DataRow objects that contain errors.
Refresh | Refreshes field values in all data table rows and notifies data bound controls that the rows have changed.
RejectChanges | Rolls back all changes made to the table since it was filled with data or the last time AcceptChanges or RejectChanges was called.


C1DataTable.AcceptChanges Method

C1DataTable.AcceptChanges Method

Commits all changes made to the table since it was filled with data or the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub AcceptChanges()

[C#]

public void AcceptChanges()

[Delphi]

public procedure AcceptChanges();

Remarks

This method accepts changes in one simple table or simple table view, whereas method AcceptChanges accepts changes in the whole data set. This method cannot be applied to composite tables. Also, it is not allowed to apply this method to a simple table that is used in a composite table as a main constituent table (is connected to its parent in the composite table diagram with a one-to-many relation; the restriction does not apply to those connected many-to-one). If one of these restrictions is not satisfied, the method throws an exception. In such case, use AcceptChanges for the whole data set.


C1DataTable.AddNew Method

C1DataTable.AddNew Method

Adds a new row to the data table.

[Visual Basic]

Public Function AddNew() As C1DataRow

[C#]

public C1DataRow AddNew()

[Delphi]

public function AddNew(): C1DataRow;

Remarks

This method creates a new empty row and adds it to the data table. The new row is filled only with default values, its primary key undefined. A row with undefined primary key is in a special transitory state called detached, the process of adding this row to the rowset is yet incomplete. For example, such row will not be sent to the database for update. A row becomes a full-fledged table row only after its primary key is set and any fields with AllowDbNull = False are set too.


C1DataTable.Compute Method

C1DataTable.Compute Method

Computes an aggregation expression on the rows that satisfy a filter condition.

[Visual Basic]

Public Function Compute( _

ByVal expression As String, _

ByVal type As Type, _

ByVal filter As String _

) As Object

[C#]

public object Compute(

string expression,

Type type,

string filter

);

[Delphi]

public function Compute(

expression: String;

type: Type;

filter: String

): Object;

Remarks

This function computes aggregation expressions only. For example, you can use it to compute a sum of a field over rows, as in Sum(Quantity) (correct), but not to compute an expression depending on multiple fields in a single row, as in UnitPrice * Quantity (incorrect). For computations involving multiple fields in a single row use field Calculations.


C1DataTable.GetErrors Method

C1DataTable.GetErrors Method

Gets an array of C1DataRow objects that contain errors.

[Visual Basic]

Public Function GetErrors() As C1DataRow()

[C#]

public C1DataRow[] GetErrors()

[Delphi]

public function GetErrors(): array of C1DataRow;


C1DataTable.Refresh Method

C1DataTable.Refresh Method

Refreshes field values in all data table rows and notifies data bound controls that the rows have changed.

[Visual Basic]

Public Sub Refresh()

[C#]

public void Refresh()

[Delphi]

public procedure Refresh();

Remarks

This method performs Calculations for every field in every row that has non-empty Calculations collection. Normally, calculations are performed automatically, without explicit Refresh call, when calculation arguments change. However, some calculation arguments changes cannot be detected automatically, for example, changes in Current, Original or BeforeChange field values, see C1DataObjects Expressions. Calling the Refresh method is also necessary when you use the SuppressNotifications property of a data set, to notify data bound controls that row values have changed.


C1DataTable.RejectChanges Method

C1DataTable.RejectChanges Method

Rolls back all changes made to the table since it was filled with data or the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub RejectChanges()

[C#]

public void RejectChanges()

[Delphi]

public procedure RejectChanges();

Remarks

This method rolls back changes in one simple table or simple table view, whereas method RejectChanges rolls back changes in the whole data set. This method cannot be applied to composite tables. Also, it is not allowed to apply this method to a simple table that is used in a composite table as a main constituent table (is connected to its parent in the composite table diagram with a one-to-many relation; the restriction does not apply to those connected many-to-one). If one of these restrictions is not satisfied, the method throws an exception. In such case, use RejectChanges for the whole data set.


C1DataTableCollection Class

C1DataTableCollection Class

Represents a collection of C1DataTable objects.

For a list of all members of this type, see C1DataTableCollection Members.

System.Object

C1.Data.C1DataTableCollection

[Visual Basic]

Public Class C1DataTableCollection

Implements ICollection, IEnumerable

[C#]

public class C1DataTableCollection : ICollection, IEnumerable

[Delphi]

type C1DataTableCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataTableCollection Members

C1DataTableCollection Members

C1DataTableCollection overview

Public Properties

Count | Gets the total number of elements in a collection.
Item | Overloaded. Gets the element of the collection at the specified index.

Public Methods

CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Gets the index of the data table with a given name (the name is not case-sensitive).


C1DataTableCollection Properties

C1DataTableCollection Properties

The properties of the C1DataTableCollection class are listed here. For a complete list of C1DataTableCollection class members, see the C1DataTableCollection Members topic.

Public Properties

Count | Gets the total number of elements in a collection.
Item | Overloaded. Gets the element of the collection at the specified index.


C1DataTableCollection.Count Property

C1DataTableCollection.Count Property

Gets the total number of elements in a collection.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count


C1DataTableCollection.Item Property

C1DataTableCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(BaseTable) As C1DataTable

[C#] public C1DataTable this[BaseTable]{get;}

[Delphi] public property Item[schemaTable: BaseTable]: C1DataTable read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As C1DataTable

[C#] public C1DataTable this[int]{get;}

[Delphi] public property Item[index: Int32]: C1DataTable read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As C1DataTable

[C#] public C1DataTable this[string]{get;}

[Delphi] public property Item[name: String]: C1DataTable read get_Item;


C1DataTableCollection.Item Property (BaseTable)

C1DataTableCollection.Item Property (BaseTable)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal schemaTable As BaseTable _

) As C1DataTable

[C#]

public C1DataTable this[

BaseTable schemaTable

] {get;}

[Delphi]

public property Item[

schemaTable: BaseTable

]: C1DataTable read get_Item;

Parameters

schemaTable

The SchemaTable of the element.


C1DataTableCollection.Item Property (Int32)

C1DataTableCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As C1DataTable

[C#]

public C1DataTable this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: C1DataTable read get_Item;

Parameters

index

The zero-based index of the element.


C1DataTableCollection.Item Property (String)

C1DataTableCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As C1DataTable

[C#]

public C1DataTable this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: C1DataTable read get_Item;

Parameters

name

The Name of the element.


C1DataTableCollection Methods

C1DataTableCollection Methods

The methods of the C1DataTableCollection class are listed here. For a complete list of C1DataTableCollection class members, see the C1DataTableCollection Members topic.

Public Methods

CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Gets the index of the data table with a given name (the name is not case-sensitive).


C1DataTableCollection.CopyTo Method

C1DataTableCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As C1DataTable(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

C1DataTable[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of C1DataTable;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


C1DataTableCollection.IndexOf Method

C1DataTableCollection.IndexOf Method

Gets the index of the data table with a given name (the name is not case-sensitive).

[Visual Basic]

Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32;

Parameters

name

The Name of the element.

Return Value


C1DataTableSource Class

C1DataTableSource Class

C1DataTableSource has two main uses:

You can use C1DataTableSource to handle business logic events in your client application code, in addition to the business logic specified in the data library, see Business Logic for details.

You must use C1DataTableSource as the data source for your bound controls to make them work in virtual mode, see Virtual Mode - Dealing with Large Datasets for details.

C1DataTableSource is used as a data source for bound controls, such as grids and others.

For a list of all members of this type, see C1DataTableSource Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.BaseDataTableSource

C1.Data.C1DataTableSource

[Visual Basic]

Public Class C1DataTableSource

Inherits BaseDataTableSource

[C#]

public class C1DataTableSource : BaseDataTableSource

[Delphi]

type C1DataTableSource = class (BaseDataTableSource);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataTableSource Members

C1DataTableSource Members

C1DataTableSource overview

Public Constructors

C1DataTableSource Constructor

Initializes a new instance of the C1DataTableSource class.

Public Properties

CurrentRow (inherited from BaseDataTableSource) | Gets the C1DataRow object representing the current row.
DataSet | Gets or sets the C1DataSet to which this component belongs.
DataTable (inherited from BaseDataTableSource) | Gets the source C1DataTable containing the data.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
TableView | Gets or sets the name of the table view represented by this component.
UpdateLeavingRow (inherited from BaseDataTableSource) | Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.

Public Methods

MoveFirst (inherited from BaseDataTableSource) | Moves to the first row.
MoveLast (inherited from BaseDataTableSource) | Moves to the last row.
MoveNext (inherited from BaseDataTableSource) | Moves to the next row.
MovePrevious (inherited from BaseDataTableSource) | Moves to the previous row.
Seek (inherited from BaseDataTableSource) | Seeks a row by its primary key values.

Public Events

AfterAddNew (inherited from BaseDataTableSource) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseDataTableSource) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseDataTableSource) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseDataTableSource) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange (inherited from BaseDataTableSource) | Fired after a field value is set.
AfterFirstChange (inherited from BaseDataTableSource) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AsyncFetchComplete (inherited from BaseDataTableSource) | Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.
BeforeAddNew (inherited from BaseDataTableSource) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseDataTableSource) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseDataTableSource) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange (inherited from BaseDataTableSource) | Fired before a field value is set.
BeforeFirstChange (inherited from BaseDataTableSource) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


C1DataTableSource Constructor

C1DataTableSource Constructor

Initializes a new instance of the C1DataTableSource class.

[Visual Basic]

Public Function New()

[C#]

public C1DataTableSource()

[Delphi]

public constructor Create();


C1DataTableSource Properties

C1DataTableSource Properties

The properties of the C1DataTableSource class are listed here. For a complete list of C1DataTableSource class members, see the C1DataTableSource Members topic.

Public Properties

CurrentRow (inherited from BaseDataTableSource) | Gets the C1DataRow object representing the current row.
DataSet | Gets or sets the C1DataSet to which this component belongs.
DataTable (inherited from BaseDataTableSource) | Gets the source C1DataTable containing the data.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
TableView | Gets or sets the name of the table view represented by this component.
UpdateLeavingRow (inherited from BaseDataTableSource) | Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.


C1DataTableSource.DataSet Property

C1DataTableSource.DataSet Property

Gets or sets the C1DataSet to which this component belongs.

[Visual Basic]

Public Property DataSet As C1DataSet

[C#]

public C1DataSet DataSet {get;set;}

[Delphi]

public property DataSet: C1DataSet read get_DataSet write set_DataSet;


C1DataTableSource.TableView Property

C1DataTableSource.TableView Property

Gets or sets the name of the table view represented by this component.

[Visual Basic]

Public Property TableView As String

[C#]

public string TableView {get;set;}

[Delphi]

public property TableView: String read get_TableView write set_TableView;


C1DataTableSource Methods

C1DataTableSource Methods

The methods of the C1DataTableSource class are listed here. For a complete list of C1DataTableSource class members, see the C1DataTableSource Members topic.

Public Methods

MoveFirst (inherited from BaseDataTableSource) | Moves to the first row.
MoveLast (inherited from BaseDataTableSource) | Moves to the last row.
MoveNext (inherited from BaseDataTableSource) | Moves to the next row.
MovePrevious (inherited from BaseDataTableSource) | Moves to the previous row.
Seek (inherited from BaseDataTableSource) | Seeks a row by its primary key values.


C1DataTableSource Events

C1DataTableSource Events

The events of the C1DataTableSource class are listed here. For a complete list of C1DataTableSource class members, see the C1DataTableSource Members topic.

Public Events

AfterAddNew (inherited from BaseDataTableSource) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseDataTableSource) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseDataTableSource) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseDataTableSource) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange (inherited from BaseDataTableSource) | Fired after a field value is set.
AfterFirstChange (inherited from BaseDataTableSource) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AsyncFetchComplete (inherited from BaseDataTableSource) | Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.
BeforeAddNew (inherited from BaseDataTableSource) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseDataTableSource) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseDataTableSource) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange (inherited from BaseDataTableSource) | Fired before a field value is set.
BeforeFirstChange (inherited from BaseDataTableSource) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


C1DataView Class

C1DataView Class

C1DataView is used for sorting and filtering data.

For a list of all members of this type, see C1DataView Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.C1DataView

C1.Data.Express.C1ExpressView

[Visual Basic]

Public Class C1DataView

Inherits BaseDataSourceComponent

Implements IBindingList, ICollection, IEnumerable, IList, ISupportInitialize, ITypedList

[C#]

public class C1DataView : BaseDataSourceComponent , IBindingList, ICollection, IEnumerable, IList, ISupportInitialize, ITypedList

[Delphi]

type C1DataView = class (BaseDataSourceComponent, IBindingList, ICollection, IEnumerable, IList, ISupportInitialize, ITypedList);

Remarks

Data bound controls can bind directly to a C1DataView component, see Using a Data Library. This allows you to use C1DataView to provide separate views into the same data, with different row filter criteria and sorts. Each such view has independent current row, can be independently navigated.

Another common use of C1DataView is to obtain direct access to simple table data rows. Normal data binding, using C1DataSet or C1DataTableSource gives you access to table views. If, for some reason, you need direct access to simple tables behind those table views, you need to use C1DataView with non-empty TableName property. See How to Access Table Data for details.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1DataView Members

C1DataView Members

C1DataView overview

Public Constructors

C1DataView Constructor

Initializes a new instance of the C1DataView class.

Public Properties

AllowAddNew | Gets or sets a value indicating whether adding new rows to this data view is allowed.
AllowDelete | Gets or sets a value indicating whether deleting rows from this data view is allowed.
AutoRefresh | Gets or sets a value indicating whether the data view is automatically refreshed when one of the following properties changes: TableViewName, TableName, RowFilter, RowStateFilter, Sort.
Count | Gets the total number of rows in the data view.
DataSet | Gets the data set object to which the data view belongs.
DataTable | Overriden. Gets the data table object which is the source of this data view.
DefaultDataView | Gets the C1DataView component with IsDefault = True, if one is connected to this data view.
IsDefault | Gets or sets a value indicating whether this component's RowFilter and Sort settings are applied to any binding to the table view in the data set.
Item | Gets the row at the specified index in the data view.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
ReadOnly | Gets or sets a value indicating whether changes to the rows of this data view are allowed.
RowFilter | Gets or sets the expression used to filter rows in the data view.
RowStateFilter | Gets or sets the row state filter used in the data view.
Sort | Gets or sets the sort field or fields, and sort order for the data view.
Table | Gets the schema Table used in the data view, if the TableName property is set.
TableName | Gets or sets the name of the source table for this data view.
TableView | Gets the schema TableView used in the data view, if the TableViewName property is set.
TableViewName | Gets or sets the name of the source table view for this data view.

Public Methods

AddNew | Adds a new row to the data view.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
CreateChildView | Creates and returns a C1DataView object containing child rows of a parent row.
Delete | Deletes a row from the source table view or table.
Find | Overloaded. Finds a row in the data view by the specified sort key value.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Refresh | Overloaded. Refreshes the collection of data view rows.

Public Events

CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
GetRows | Used to programmatically specify the list of rows in a data view.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


C1DataView Constructor

C1DataView Constructor

Initializes a new instance of the C1DataView class.

[Visual Basic]

Public Function New()

[C#]

public C1DataView()

[Delphi]

public constructor Create(); overload;


C1DataView Properties

C1DataView Properties

The properties of the C1DataView class are listed here. For a complete list of C1DataView class members, see the C1DataView Members topic.

Public Properties

AllowAddNew | Gets or sets a value indicating whether adding new rows to this data view is allowed.
AllowDelete | Gets or sets a value indicating whether deleting rows from this data view is allowed.
AutoRefresh | Gets or sets a value indicating whether the data view is automatically refreshed when one of the following properties changes: TableViewName, TableName, RowFilter, RowStateFilter, Sort.
Count | Gets the total number of rows in the data view.
DataSet | Gets the data set object to which the data view belongs.
DataTable | Overriden. Gets the data table object which is the source of this data view.
DefaultDataView | Gets the C1DataView component with IsDefault = True, if one is connected to this data view.
IsDefault | Gets or sets a value indicating whether this component's RowFilter and Sort settings are applied to any binding to the table view in the data set.
Item | Gets the row at the specified index in the data view.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
ReadOnly | Gets or sets a value indicating whether changes to the rows of this data view are allowed.
RowFilter | Gets or sets the expression used to filter rows in the data view.
RowStateFilter | Gets or sets the row state filter used in the data view.
Sort | Gets or sets the sort field or fields, and sort order for the data view.
Table | Gets the schema Table used in the data view, if the TableName property is set.
TableName | Gets or sets the name of the source table for this data view.
TableView | Gets the schema TableView used in the data view, if the TableViewName property is set.
TableViewName | Gets or sets the name of the source table view for this data view.


C1DataView.AllowAddNew Property

C1DataView.AllowAddNew Property

Gets or sets a value indicating whether adding new rows to this data view is allowed.

[Visual Basic]

Public Property AllowAddNew As Boolean

[C#]

public bool AllowAddNew {get;set;}

[Delphi]

public property AllowAddNew: Boolean read get_AllowAddNew write set_AllowAddNew;

Remarks

If the Table or TableView on which the data view is based has AllowAddNew = False, adding new rows is not allowed regardless of the value of data view’s AllowAddNew property.


C1DataView.AllowDelete Property

C1DataView.AllowDelete Property

Gets or sets a value indicating whether deleting rows from this data view is allowed.

[Visual Basic]

Public Property AllowDelete As Boolean

[C#]

public bool AllowDelete {get;set;}

[Delphi]

public property AllowDelete: Boolean read get_AllowDelete write set_AllowDelete;

Remarks

If the Table or TableView on which the data view is based has AllowDelete = False, deleting rows is not allowed regardless of the value of data view’s AllowDelete property.


C1DataView.AutoRefresh Property

C1DataView.AutoRefresh Property

Gets or sets a value indicating whether the data view is automatically refreshed when one of the following properties changes: TableViewName, TableName, RowFilter, RowStateFilter, Sort.

[Visual Basic]

Public Property AutoRefresh As Boolean

[C#]

public bool AutoRefresh {get;set;}

[Delphi]

public property AutoRefresh: Boolean read get_AutoRefresh write set_AutoRefresh;

Remarks

This property is True by default. If it is set to False, changing any of the properties at run time does not automatically refresh the data view, refresh occurs when the Refresh method is called.


C1DataView.Count Property

C1DataView.Count Property

Gets the total number of rows in the data view.

[Visual Basic]

Public ReadOnly Property Count As Integer

[C#]

public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Remarks

This property returns the number of rows satisfying the conditions in RowFilter and RowStateFilter.


C1DataView.DataSet Property

C1DataView.DataSet Property

Gets the data set object to which the data view belongs.

[Visual Basic]

Overridable Public Property DataSet As C1DataSet

[C#]

virtual public C1DataSet DataSet {get;set;}

[Delphi]

public property DataSet: C1DataSet read get_DataSet write set_DataSet;

Remarks

This property returns the data set containing this data view’s DataTable.


C1DataView.DataTable Property

C1DataView.DataTable Property

Gets the data table object which is the source of this data view.

[Visual Basic]

Overrides Public ReadOnly Property DataTable As C1DataTable

[C#]

override public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;


C1DataView.DefaultDataView Property

C1DataView.DefaultDataView Property

Gets the C1DataView component with IsDefault = True, if one is connected to this data view.

[Visual Basic]

Public ReadOnly Property DefaultDataView As C1DataView

[C#]

public C1DataView DefaultDataView {get;}

[Delphi]

public property DefaultDataView: C1DataView read get_DefaultDataView;


C1DataView.IsDefault Property

C1DataView.IsDefault Property

Gets or sets a value indicating whether this component's RowFilter and Sort settings are applied to any binding to the table view in the data set.

[Visual Basic]

Public Property IsDefault As Boolean

[C#]

public bool IsDefault {get;set;}

[Delphi]

public property IsDefault: Boolean read get_IsDefault write set_IsDefault;

Remarks

This property is False by default, meaning that filtering and sorting affect only the data exposed by this C1DataView component. Binding to a C1DataSet directly or to another C1DataView is not affected by this view's filtering and sorting.

If this property is set to True, filtering and sorting affect the underlying table view data directly. So, all controls bound to that table view, in C1DataSet or in C1DataView, are filtered and sorted (including parent-child rows in master-detail). See the DefaultDataView sample in the Samples directory.

Only RowFilter and Sort properties affect table view data, other properties of C1DataView do not affect the whole table view.

IsDefault = True can be used only with a C1DataView attached to a table view (TableViewName specified), it cannot be used with a data view attached to a table (TableName specified).


C1DataView.Item Property

C1DataView.Item Property

Gets the row at the specified index in the data view.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As C1DataRow

[C#]

public C1DataRow this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: C1DataRow read get_Item;

Parameters

index

The zero-based index of the row.

Remarks

This property returns the rows satisfying the conditions in RowFilter and RowStateFilter.


C1DataView.ReadOnly Property

C1DataView.ReadOnly Property

Gets or sets a value indicating whether changes to the rows of this data view are allowed.

[Visual Basic]

Public Property ReadOnly As Boolean

[C#]

public bool ReadOnly {get;set;}

[Delphi]

public property ReadOnly: Boolean read get_ReadOnly write set_ReadOnly;

Remarks

If the Table or TableView on which the data view is based has ReadOnly = False, changing rows is not allowed regardless of the value of data view’s ReadOnly property.


C1DataView.RowFilter Property

C1DataView.RowFilter Property

Gets or sets the expression used to filter rows in the data view.

[Visual Basic]

Public Property RowFilter As String

[C#]

public string RowFilter {get;set;}

[Delphi]

public property RowFilter: String read get_RowFilter write set_RowFilter;

Remarks

Expression must return boolean values. If it evaluates to True on a row, the row is included in the data view. If it evaluates to false, the row is excluded. For example, expression “City = ‘London’” selects all rows where field City equals ‘London’.

To select rows with null values in a certain field, use the following expression:

"IsNull(Field1, 'Null Field’) = 'Null Field"


C1DataView.RowStateFilter Property

C1DataView.RowStateFilter Property

Gets or sets the row state filter used in the data view.

[Visual Basic]

Public Property RowStateFilter As DataViewRowStateEnum

[C#]

public DataViewRowStateEnum RowStateFilter {get;set;}

[Delphi]

public property RowStateFilter: DataViewRowStateEnum read get_RowStateFilter write set_RowStateFilter;

Remarks

Using this property you can select only added rows, or only deleted rows, or only modified rows, or a combination of those states, see DataViewRowStateEnum.

Using the Deleted row state filter is only allowed for simple tables (TableName property is set), it is not allowed for table views (TableViewName property is set).


C1DataView.Sort Property

C1DataView.Sort Property

Gets or sets the sort field or fields, and sort order for the data view.

[Visual Basic]

Public Property Sort As String

[C#]

public string Sort {get;set;}

[Delphi]

public property Sort: String read get_Sort write set_Sort;

Remarks

A string containing one or more field names followed by "ASC" (ascending; default, can be omitted) or "DESC" (descending). Multiple fields are separated by commas. Examples: “OrderID”, “CustomerID DESC”, “Quantity DESC, CustomerID”.


C1DataView.Table Property

C1DataView.Table Property

Gets the schema Table used in the data view, if the TableName property is set.

[Visual Basic]

Overridable Public ReadOnly Property Table As Table

[C#]

virtual public Table Table {get;}

[Delphi]

public property Table: Table read get_Table;

Remarks

Only one of the two properties, TableName or TableViewName can be set to a non-empty string.


C1DataView.TableName Property

C1DataView.TableName Property

Gets or sets the name of the source table for this data view.

[Visual Basic]

Overridable Public Property TableName As String

[C#]

virtual public string TableName {get;set;}

[Delphi]

public property TableName: String read get_TableName write set_TableName;

Remarks

Only one of the two properties, TableName or TableViewName can be set to a non-empty string.


C1DataView.TableView Property

C1DataView.TableView Property

Gets the schema TableView used in the data view, if the TableViewName property is set.

[Visual Basic]

Overridable Public ReadOnly Property TableView As TableView

[C#]

virtual public TableView TableView {get;}

[Delphi]

public property TableView: TableView read get_TableView;

Remarks

Only one of the two properties, TableName or TableViewName can be set to a non-empty string.


C1DataView.TableViewName Property

C1DataView.TableViewName Property

Gets or sets the name of the source table view for this data view.

[Visual Basic]

Overridable Public Property TableViewName As String

[C#]

virtual public string TableViewName {get;set;}

[Delphi]

public property TableViewName: String read get_TableViewName write set_TableViewName;

Remarks

Only one of the two properties, TableName or TableViewName can be set to a non-empty string.


C1DataView Methods

C1DataView Methods

The methods of the C1DataView class are listed here. For a complete list of C1DataView class members, see the C1DataView Members topic.

Public Methods

AddNew | Adds a new row to the data view.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
CreateChildView | Creates and returns a C1DataView object containing child rows of a parent row.
Delete | Deletes a row from the source table view or table.
Find | Overloaded. Finds a row in the data view by the specified sort key value.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Refresh | Overloaded. Refreshes the collection of data view rows.


C1DataView.AddNew Method

C1DataView.AddNew Method

Adds a new row to the data view.

[Visual Basic]

Public Function AddNew() As C1DataRow

[C#]

public C1DataRow AddNew()

[Delphi]

public function AddNew(): C1DataRow;

Remarks

This method creates a new empty row and adds it to the source data table of the data view. The new row is filled only with default values, so it may not satisfy the filter conditions if some are set in the RowFilter property. However, even if this new row does not satisfy filter conditions, it is always included in the data view until EndEdit is called, at which time the row is tested for filter conditions and either remains in the data view or not depending on the filter condition.


C1DataView.Contains Method

C1DataView.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal row As DataItem _

) As Boolean

[C#]

public bool Contains(

DataItem row

);

[Delphi]

public function Contains(

row: DataItem

): Boolean;

Parameters

row

The row to locate in the collection.

Return Value


C1DataView.CopyTo Method

C1DataView.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As DataItem(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

DataItem[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of DataItem;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


C1DataView.CreateChildView Method

C1DataView.CreateChildView Method

Creates and returns a C1DataView object containing child rows of a parent row.

[Visual Basic]

Public Shared Function CreateChildView( _

ByVal dataSet As C1DataSet, _

ByVal relationName As String, _

ByVal parentRow As C1DataRow _

) As C1DataView

[C#]

public static C1DataView CreateChildView(

C1DataSet dataSet,

string relationName,

C1DataRow parentRow

);

[Delphi]

public class function CreateChildView(

dataSet: C1DataSet;

relationName: String;

parentRow: C1DataRow

): C1DataView;

Parameters

dataSet

The data set to which the parent row and the child view belong.

relationName

The name of the view relation ( ViewRelation) between the parent and the child.

parentRow

The parent row.

Remarks

This method can be used as an alternative to GetChildRows (String) for master-detail navigation. For example, you might want to use the resulting C1DataView as a data source for a data bound control.


C1DataView.Delete Method

C1DataView.Delete Method

Deletes a row from the source table view or table.

[Visual Basic]

Public Sub Delete( _

ByVal index As Integer _

)

[C#]

public void Delete(

int index

);

[Delphi]

public procedure Delete(

index: Int32

);

Parameters

index

The index of the row to delete. This is an index in the data view, not in the source table view or table.

Remarks

After this method, the row is deleted from the source, from the data view and from all other data views based on that source.


C1DataView.Find Method

C1DataView.Find Method

Overload List

Finds a row in the data view by the specified sort key value.

[Visual Basic] Overloads Public Function Find(Object) As Integer

[C#] public int Find(object);

[Delphi] public function Find(Object) : Int32; overload;

Finds a row in the data view by the specified sort key value.

[Visual Basic] Overloads Public Function Find(Object()) As Integer

[C#] public int Find(object[]);

[Delphi] public function Find(array of Object) : Int32; overload;


C1DataView.Find Method (Object)

C1DataView.Find Method (Object)

Finds a row in the data view by the specified sort key value.

[Visual Basic]

Overloads Public Function Find( _

ByVal key As Object _

) As Integer

[C#]

public int Find(

object key

);

[Delphi]

public function Find(

key: Object

): Int32; overload;

Parameters

key

The value to search for.

Remarks

This method applies only to sorted view, with a non-empty Sort. It returns the index of the first row in the data view containing the specified sort key value(s). If no such rows are found, it returns a negative number, which is the bitwise complement of the index of the row whose sort key is next to the specified sort key value.


C1DataView.Find Method (Object[])

C1DataView.Find Method (Object[])

Finds a row in the data view by the specified sort key value.

[Visual Basic]

Overloads Public Function Find( _

ByVal key As Object() _

) As Integer

[C#]

public int Find(

object[] key

);

[Delphi]

public function Find(

key: array of Object

): Int32; overload;

Parameters

key

An array of values to search for.

Remarks

This method applies only to sorted view, with a non-empty Sort. It returns the index of the first row in the data view containing the specified sort key value(s). If no such rows are found, it returns a negative number, which is the bitwise complement of the index of the row whose sort key is next to the specified sort key value.


C1DataView.IndexOf Method

C1DataView.IndexOf Method

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal row As DataItem _

) As Integer

[C#]

public int IndexOf(

DataItem row

);

[Delphi]

public function IndexOf(

row: DataItem

): Int32;

Parameters

row

The row to locate in the collection.

Return Value


C1DataView.Refresh Method

C1DataView.Refresh Method

Overload List

Refreshes the collection of data view rows.

[Visual Basic] Overloads Public Sub Refresh()

[C#] public Refresh();

[Delphi] public procedure Refresh(); overload;

Refreshes the collection of data view rows.

[Visual Basic] Overloads Public Sub Refresh(Boolean)

[C#] public Refresh(bool);

[Delphi] public procedure Refresh(Boolean); overload;


C1DataView.Refresh Method ()

C1DataView.Refresh Method ()

Refreshes the collection of data view rows.

[Visual Basic]

Overloads Public Sub Refresh()

[C#]

public void Refresh()

[Delphi]

public procedure Refresh(); overload;

Remarks

This method re-populates the data view rows, testing the filter conditions and applying sort, if specified. Call this method after changing filter conditions and sort, if AutoRefresh is set to False.


C1DataView.Refresh Method (Boolean)

C1DataView.Refresh Method (Boolean)

Refreshes the collection of data view rows.

[Visual Basic]

Overloads Public Sub Refresh( _

ByVal thisViewOnly As Boolean _

)

[C#]

public void Refresh(

bool thisViewOnly

);

[Delphi]

public procedure Refresh(

thisViewOnly: Boolean

); overload;

Parameters

thisViewOnly

If the thisViewOnly argument is True, only this C1DataView is refreshed.

If it is False (default), all C1DataView components based on the same table view are refreshed.

Remarks

This method re-populates the data view rows, testing the filter conditions and applying sort, if specified. Call this method after changing filter conditions and sort, if AutoRefresh is set to False.


C1DataView Events

C1DataView Events

The events of the C1DataView class are listed here. For a complete list of C1DataView class members, see the C1DataView Members topic.

Public Events

CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
GetRows | Used to programmatically specify the list of rows in a data view.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


C1DataView.GetRows Event

C1DataView.GetRows Event

Used to programmatically specify the list of rows in a data view.

[Visual Basic]

Public Event GetRows As GetListEventHandler

[C#]

public event GetListEventHandler GetRows

[Delphi]

public property GetRows: GetListEventHandler read remove_GetRows write add_GetRows;

Remarks

This event can be used to create custom data views in cases where filtering cannot be specified by a simple expression in the RowFilter property or sorting by a list of fields in the Sort property.

The GetRows event is called every time C1DataObjects needs to obtain the list of rows for the data view. It gives the developer an opportunity to specify a list of rows comprising the data view by assigning such list to the e.List event argument. This list can be filtered and sorted in whatever fashion the developer needs it to be, provided it consists of C1DataRow objects belonging to the table view or table on which the data view is based. The list supplied in the event handler will become exactly the list of rows of this data view, unless RowFilter and/or Sort properties are not empty, in which case they are applied to the list of rows resulting from the GetRows event.

Writing code in GetRows event, you can use the e.List argument value passed to the event, which is the complete list of rows as it would appear in the data view if there were no GetRows handler and no RowFilter and Sort properties. You can filter and/or sort this list to obtain your custom list, although this is only one possible technique, you can form the resulting list in any other way you need.


C1SchemaDef Class

C1SchemaDef Class

The C1SchemaDef component hosts a Schema object that is the basis of a C1DataObjects data library or direct client.

For a list of all members of this type, see C1SchemaDef Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.SchemaBase

C1.Data.C1SchemaDef

[Visual Basic]

Public Class C1SchemaDef

Inherits SchemaBase

Implements ISupportInitialize

[C#]

public class C1SchemaDef : SchemaBase , ISupportInitialize

[Delphi]

type C1SchemaDef = class (SchemaBase, ISupportInitialize);

Remarks

The Schema object associated with a C1SchemaDef component is created and edited using the Schema Designer invoked from the context menu of a C1SchemaDef component. A C1DataObjects data library always contains a single schema, that is, a single C1SchemaDef component. An application that uses C1DataObjects directly, without a data library ( Direct Client) is allowed to have multiple schemas, each stored in its own C1SchemaDef component.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1SchemaDef Members

C1SchemaDef Members

C1SchemaDef overview

Public Constructors

C1SchemaDef Constructor

Initializes a new instance of the C1SchemaDef class.

Public Properties

DataObjectsAssemblyFlags | Flags affecting generated classes in the data objects assembly (*.DataObjects.dll).
RunsAt | Returns a value indicating where the instance of the data library is running.
Schema | Overriden. Returns or sets the Schema object.
SessionCacheProperties | This property is used in ComponentOne WebDataObjects for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.

Public Methods

Add

Adds an element to the list of C1SchemaRef components associated with the C1SchemaDef component.

Public Events

CreateSchema

Fired after the Schema object has been created at startup.


C1SchemaDef Constructor

C1SchemaDef Constructor

Initializes a new instance of the C1SchemaDef class.

[Visual Basic]

Public Function New()

[C#]

public C1SchemaDef()

[Delphi]

public constructor Create();


C1SchemaDef Properties

C1SchemaDef Properties

The properties of the C1SchemaDef class are listed here. For a complete list of C1SchemaDef class members, see the C1SchemaDef Members topic.

Public Properties

DataObjectsAssemblyFlags | Flags affecting generated classes in the data objects assembly (*.DataObjects.dll).
RunsAt | Returns a value indicating where the instance of the data library is running.
Schema | Overriden. Returns or sets the Schema object.
SessionCacheProperties | This property is used in ComponentOne WebDataObjects for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.


C1SchemaDef.DataObjectsAssemblyFlags Property

C1SchemaDef.DataObjectsAssemblyFlags Property

Flags affecting generated classes in the data objects assembly (*.DataObjects.dll).

[Visual Basic]

Public Property DataObjectsAssemblyFlags As DataObjectsAssemblyFlags

[C#]

public DataObjectsAssemblyFlags DataObjectsAssemblyFlags {get;set;}

[Delphi]

public property DataObjectsAssemblyFlags: DataObjectsAssemblyFlags read get_DataObjectsAssemblyFlags write set_DataObjectsAssemblyFlags;

Remarks

This property affects the way classes are generated in the data objects assembly, that is, the *.DataObjects.dll assembly automatically generated on saving schema, see Schema Objects.

Setting flag DataObjectsAssemblyFlags.DataSetNamespaces makes table view classes belong to special namespaces, a namespace for each data set, for example, Northwind.DataObjects.CustOrders.EmployeesRow for table view Employees in data set CustOrders. Table classes still belong to the root namespace: Northwind.DataObjects.EmployeesRow for table Employees.

Setting flag DataObjectsAssemblyFlags.StaticNameFields generates static string properties returning field, table, table view and relation names, so that they can be used instead of constant strings in code thus making it compile-time safe (errors detected at compile time), for example:

Northwind.DataObjects.EmployeesRow.FieldNameEmployeeID (field name returning "EmployeeID" for field EmployeeID of table Employees),

Northwind.DataObjects.EmployeesRow.TableName (table name returning "Employees", for table Employees),

Northwind.DataObjects.EmployeesRow.RelationNameEmployees__Orders (relation name returning "Employees - Orders", for simple relation "Employees - Orders"),

Northwind.DataObjects.CustOrders.EmployeesRow.TableViewName (table view name returning "Employees", for table view Employees in data set CustOrders),

Northwind.DataObjects.CustOrders.EmployeesRow.FieldNameEmployeeID (field name returning "EmployeeID" for field EmployeeID of table Employees),

Northwind.DataObjects.CustOrders.CustOrdersRow.RelationNameCO__ODP (relation name returning "CO - ODP", for view relation "CO - ODP" between table views CustOrders and OrderDetailsProducts in data set CustOrders).


C1SchemaDef.RunsAt Property

C1SchemaDef.RunsAt Property

Returns a value indicating where the instance of the data library is running.

[Visual Basic]

Public ReadOnly Property RunsAt As RunsAtEnum

[C#]

public RunsAtEnum RunsAt {get;}

[Delphi]

public property RunsAt: RunsAtEnum read get_RunsAt;

Remarks

The main purpose of this property is to distinguish between RunsAtEnum.ThreeTierServer and RunsAtEnum.ThreeTierClient. This is sometimes necessary in business logic to take different actions depending on whether it runs in the client-side or in the server-side instance of a data library. For example, you might want to assign a ConnectionString in C1.Data.C1SchemaDef.CreateSchema event on the server, but leave ConnectionString empty on the client in a 3-tier configuration, since the client does not perform database access.


C1SchemaDef.Schema Property

C1SchemaDef.Schema Property

Returns or sets the Schema object.

[Visual Basic]

Overrides Public Property Schema As Schema

[C#]

override public Schema Schema {get;set;}

[Delphi]

public property Schema: Schema read get_Schema write set_Schema;

Remarks

Normally, this property is not set by user code. It is set by C1DataObjects SchemaDesigner. User code gets the value of this property to gain access to schema objects and possibly modify them at run time, in the C1.Data.C1SchemaDef.CreateSchema event.


C1SchemaDef.SessionCacheProperties Property

C1SchemaDef.SessionCacheProperties Property

This property is used in ComponentOne WebDataObjects for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.

[Visual Basic]

Public Property SessionCacheProperties As SessionCacheProperties

[C#]

public SessionCacheProperties SessionCacheProperties {get;set;}

[Delphi]

public property SessionCacheProperties: SessionCacheProperties read get_SessionCacheProperties write set_SessionCacheProperties;


C1SchemaDef Methods

C1SchemaDef Methods

The methods of the C1SchemaDef class are listed here. For a complete list of C1SchemaDef class members, see the C1SchemaDef Members topic.

Public Methods

Add

Adds an element to the list of C1SchemaRef components associated with the C1SchemaDef component.


C1SchemaDef.Add Method

C1SchemaDef.Add Method

Adds an element to the list of C1SchemaRef components associated with the C1SchemaDef component.

[Visual Basic]

Public Sub Add( _

ByVal schemaRef As C1SchemaRef _

)

[C#]

public void Add(

C1SchemaRef schemaRef

);

[Delphi]

public procedure Add(

schemaRef: C1SchemaRef

);

Remarks

This method is used to specify a list of C1SchemaRef components representing (associated with) a C1SchemaDef component. It is useful in large data library projects where it is desirable to use multiple source code files to write business logic code. A C1SchemaRef component represents the C1SchemaDef component holding the library’s schema when it resides in a different file in the project. Every C1SchemaRef component representing a C1SchemaDef must have its SchemaDef property set to the C1SchemaDef component and it also has to be associated with the C1SchemaDef component at run time calling the Add method.


C1SchemaDef Events

C1SchemaDef Events

The events of the C1SchemaDef class are listed here. For a complete list of C1SchemaDef class members, see the C1SchemaDef Members topic.

Public Events

CreateSchema

Fired after the Schema object has been created at startup.


C1SchemaDef.CreateSchema Event

C1SchemaDef.CreateSchema Event

Fired after the Schema object has been created at startup.

[Visual Basic]

Public Event CreateSchema As EventHandler

[C#]

public event EventHandler CreateSchema

[Delphi]

public property CreateSchema: EventHandler read remove_CreateSchema write add_CreateSchema;

Remarks

In most cases, a schema is created at design time in the Schema Designer, and used at run time without modifications. However, all schema objects are programmatically accessible at run time through the schema object model, with the Schema class being the root of that object model. Using this object model, it is possible to modify the schema or even define it from scratch at run time, using the CreateSchema event. To access and modify the Schema object, use the Schema property. In a 3-Tier Application, this event is called both for the client and server instances of the data library. If you modify schema in this event, you may need to know whether it occurs on the client or on the server, for example, to modify database connections differently depending on where the event occurs. This information can be obtained from the RunsAt property.


C1SchemaRef Class

C1SchemaRef Class

C1SchemaRef components are used in a data library with multiple source code files.

For a list of all members of this type, see C1SchemaRef Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.SchemaBase

C1.Data.C1SchemaRef

[Visual Basic]

Public Class C1SchemaRef

Inherits SchemaBase

[C#]

public class C1SchemaRef : SchemaBase

[Delphi]

type C1SchemaRef = class (SchemaBase);

Remarks

A C1SchemaRef component represents the C1SchemaDef component holding the library’s schema when it resides in a different file in the project.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1SchemaRef Members

C1SchemaRef Members

C1SchemaRef overview

Public Constructors

C1SchemaRef Constructor

Initializes a new instance of the C1SchemaRef class.

Public Properties

Schema | Overriden. Returns the Schema object of the corresponding C1SchemaDef component.
SchemaDef | Returns or sets the name of the C1SchemaDef component referred to by this component.


C1SchemaRef Constructor

C1SchemaRef Constructor

Initializes a new instance of the C1SchemaRef class.

[Visual Basic]

Public Function New()

[C#]

public C1SchemaRef()

[Delphi]

public constructor Create();


C1SchemaRef Properties

C1SchemaRef Properties

The properties of the C1SchemaRef class are listed here. For a complete list of C1SchemaRef class members, see the C1SchemaRef Members topic.

Public Properties

Schema | Overriden. Returns the Schema object of the corresponding C1SchemaDef component.
SchemaDef | Returns or sets the name of the C1SchemaDef component referred to by this component.


C1SchemaRef.Schema Property

C1SchemaRef.Schema Property

Returns the Schema object of the corresponding C1SchemaDef component.

[Visual Basic]

Overrides Public Property Schema As Schema

[C#]

override public Schema Schema {get;set;}

[Delphi]

public property Schema: Schema read get_Schema write set_Schema;


C1SchemaRef.SchemaDef Property

C1SchemaRef.SchemaDef Property

Returns or sets the name of the C1SchemaDef component referred to by this component.

[Visual Basic]

Public Property SchemaDef As String

[C#]

public string SchemaDef {get;set;}

[Delphi]

public property SchemaDef: String read get_SchemaDef write set_SchemaDef;

Remarks

This property determines the C1SchemaDef component referred to by this component. In addition to setting this property, you must call the Add method at run time.


C1TableLogic Class

C1TableLogic Class

A C1TableLogic component hosts business logic event code for a table.

For a list of all members of this type, see C1TableLogic Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseLogic

C1.Data.C1TableLogic

[Visual Basic]

Public Class C1TableLogic

Inherits BaseLogic

[C#]

public class C1TableLogic : BaseLogic

[Delphi]

type C1TableLogic = class (BaseLogic);

Remarks

It connects to the schema by setting its Schema property, and to a particular table in the schema by setting its Table property. Business logic is then specified in its events inherited from the BaseLogic class.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


C1TableLogic Members

C1TableLogic Members

C1TableLogic overview

Public Properties

DataAdapter | Returns or sets the ADO.NET IDBDataAdapter component used to fill and update the table with DataMode = SqlBased.
Schema (inherited from BaseLogic) | Returns or sets the C1SchemaDef component holding the owner schema.
SchemaComponent (inherited from BaseLogic) | This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.
Table | Returns or sets the name of the table represented by this component.

Public Events

AfterAddNew (inherited from BaseLogic) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseLogic) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseLogic) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseLogic) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange (inherited from BaseLogic) | Fired after a field value is set.
AfterFirstChange (inherited from BaseLogic) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterUpdateRow (inherited from BaseLogic) | Fired after modifications made to a row are committed to the database.
BeforeAddNew (inherited from BaseLogic) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseLogic) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseLogic) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange (inherited from BaseLogic) | Fired before a field value is set.
BeforeFirstChange (inherited from BaseLogic) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeUpdateRow (inherited from BaseLogic) | Fired before modifications made to a row are committed to the database.
ChangesAccepted (inherited from BaseLogic) | Fired when AcceptChanges has been performed for a table or for the whole data set.
ChangesRejected (inherited from BaseLogic) | Fired when RejectChanges has been performed for a table or for the whole data set.


C1TableLogic Properties

C1TableLogic Properties

The properties of the C1TableLogic class are listed here. For a complete list of C1TableLogic class members, see the C1TableLogic Members topic.

Public Properties

DataAdapter | Returns or sets the ADO.NET IDBDataAdapter component used to fill and update the table with DataMode = SqlBased.
Schema (inherited from BaseLogic) | Returns or sets the C1SchemaDef component holding the owner schema.
SchemaComponent (inherited from BaseLogic) | This property determines the schema owning this business logic component. The component specifies business logic for a table in the schema, if it is a C1TableLogic component, or to one or more table views in the schema, if it is a C1DataSetLogic component.
Table | Returns or sets the name of the table represented by this component.


C1TableLogic.DataAdapter Property

C1TableLogic.DataAdapter Property

Returns or sets the ADO.NET IDBDataAdapter component used to fill and update the table with DataMode = SqlBased.

[Visual Basic]

Public Property DataAdapter As IDbDataAdapter

[C#]

public IDbDataAdapter DataAdapter {get;set;}

[Delphi]

public property DataAdapter: IDbDataAdapter read get_DataAdapter write set_DataAdapter;

Remarks

This property allows to support updateable SQL-based tables based on a SQL SELECT statement or a stored procedure, without manual code, using ADO.NET data adapter. This makes working with SQL-based tables in C1DataObjects almost as easy as working with bound tables (when DataMode=Bound, DbTableName set to a database table name). However, bound tables should be always preferable when you have a choice. Bound tables are more intimately related to database tables, so C1DataObjects can support features, such as virtual mode, that are unavailable for SQL-based tables, see Bound, SQL-Based and Unbound tables.

See the SQLBasedTablesEasy sample in the samples directory for an example of using a data adapter.

In C1DataObjects Enterprise edition, data adapter is specified in the DataAdapter property of a C1TableLogic component attached to a table. The table must be SQL-based (DataMode=SqlBased). In C1DataExpress, it is specified in the C1ExpressTable DataAdapter property. In both editions, a data adapter component can be created using the Create DataAdapter context menu item or created manually and attached to the DataAdapter property.

If specified, the DataAdapter is used to fill and update the table. Filling the table, only its SelectCommand property is used, not the whole data adapter component. The SelectCommand is executed to fetch the data on filling the data set. Updating modified rows to the database, C1DataObjects calls the data adapter's method DbDataAdapter.Update(DataRow[]) for each modified row (each call uses a single element in the DataRow[] array).

A data adapter component must be attached to a Connection component. The Create DataAdapter menu item creates that component automatically. The connection component is used only at design time. At run time, it is always ignored, the schema connection (or, in the Express edition, C1ExpressConnection.ConnectionString) is always used at run time regardless of what you specify in DataAdapter.Connection.

You are not required to set up the adapter's TableMappings property. It is not used at run time. C1DataObjects always uses the mapping between your table fields and the database fields that you already have in the schema in the fields' DbFieldName property. In fact, the adapter's TableMappings are automatically updated to reflect the mappings specified in the fields' DbFieldName property.

ADO.NET data adapter supports both SQL statements and stored procedures. To fill a SQL-based table with data returned by a stored procedure, set SelectCommandType=StoredProcedure and type the procedure name in the SelectCommandText property or select it from the dropdown list of stored procedures in SelectCommandText.

When you set SelectCommandText to a procedure name, the fields returned by the procedure are automatically retrieved (if the procedure returns a recordset; only procedures returning a recordset as return value or one of out parameters can be used in C1DataObjects as well as in ADO.NET).

When you use a stored procedure as your SelectCommandText (SelectCommandType=StoredProcedure; in this case your adapter's SelectCommand will also be the same stored procedure), you can specify parameter values in the data adapter's SelectCommand property. Even if you do not use data adapter for update (in which case you can leave its UpdateCommand/ InsertCommand/DeleteCommand properties empty), you can use it this way to specify parameter values for the stored procedure you use to fill the table.

Regardless of whether you use a stored procedure or a SQL statement in SelectCommandText, your data adapter commands for updating modified rows (data adapter properties UpdateCommand, InsertCommand, DeleteCommand) can be either SQL statements or stored procedures, as supported by the data adapter (so you can select Create New Stored Procedures or Use Existing Stored Procedures in the wizard).

If a data adapter is used for update, some C1DataObjects update features become unavailable, as they only relate to update made by SQL commands generated by C1DataObjects itself, not by an external component. These are table properties UpdateLocateMode, UpdateRefreshMode, IgnoreDeleteError, field properties AutoIncrement (only on the server, it still works on the client), UpdateLocate, UpdateRefresh, UpdateSet. This does not mean that features supported by these properties are unavailable, it only means that they must be supported in a different way. All these features are supported by ADO.NET DataAdapter, but may require more property settings and some coding, see the ADO.NET documentation.

To control the update process for every row, you can use C1.Data.BaseLogic.BeforeUpdateRow and C1.Data.BaseLogic.AfterUpdateRow events in SQL-based tables with DataAdapter as well as in bound tables. You can also use RowUpdating and RowUpdated events of the data adapter component. These events fire between C1.Data.BaseLogic.BeforeUpdateRow and C1.Data.BaseLogic.AfterUpdateRow events. They (and data adapter's ContinueUpdateOnError property) allow you to specify whether to continue or throw an exception, allow to make this decision in the context of the data adapter component itself. If an exception is thrown, it is passed to the C1.Data.BaseLogic.AfterUpdateRow event, and, if it is suppressed in the adapter event, then, accordingly, C1.Data.BaseLogic.AfterUpdateRow does not receive an error. But using adapter events is optional, you can do all necessary error handling in the C1.Data.BaseLogic.AfterUpdateRow event.


C1TableLogic.Table Property

C1TableLogic.Table Property

Returns or sets the name of the table represented by this component.

[Visual Basic]

Public Property Table As String

[C#]

public string Table {get;set;}

[Delphi]

public property Table: String read get_Table write set_Table;

Remarks

Normally, this property is not set by user code. It is set by C1DataObjects SchemaDesigner. User code gets the value of this property to gain access to schema objects and possibly modify them at run time, in the C1.Data.C1SchemaDef.CreateSchema event.


C1TableLogic Events

C1TableLogic Events

The events of the C1TableLogic class are listed here. For a complete list of C1TableLogic class members, see the C1TableLogic Members topic.

Public Events

AfterAddNew (inherited from BaseLogic) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseLogic) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseLogic) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseLogic) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange (inherited from BaseLogic) | Fired after a field value is set.
AfterFirstChange (inherited from BaseLogic) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterUpdateRow (inherited from BaseLogic) | Fired after modifications made to a row are committed to the database.
BeforeAddNew (inherited from BaseLogic) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseLogic) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseLogic) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseLogic) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseLogic) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseLogic) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange (inherited from BaseLogic) | Fired before a field value is set.
BeforeFirstChange (inherited from BaseLogic) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeUpdateRow (inherited from BaseLogic) | Fired before modifications made to a row are committed to the database.
ChangesAccepted (inherited from BaseLogic) | Fired when AcceptChanges has been performed for a table or for the whole data set.
ChangesRejected (inherited from BaseLogic) | Fired when RejectChanges has been performed for a table or for the whole data set.


CacheModeEnum Enumeration

CacheModeEnum Enumeration

Specifies the conditions for enabling caching.

[Visual Basic]

Public Enum CacheModeEnum

[C#]

public enum CacheModeEnum

[Delphi]

type CacheModeEnum = (Always, InWebForms, NotCached);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Always | Reserved for future use (in current version this value is equivalent to InWebForms)
InWebForms | Global caching for this data set is enabled only in WebForms.
NotCached | Global caching is disabled for this data set.

See Also

C1.Data Namespace


CacheStorageEnum Enumeration

CacheStorageEnum Enumeration

[Visual Basic]

Public Enum CacheStorageEnum

[C#]

public enum CacheStorageEnum

[Delphi]

type CacheStorageEnum = (File, Memory);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
File | Cached data stored in files on the server.
Memory | Cached data stored in server memory. In InProc session state mode, it is always physical memory. In SqlServer session state mode, the actual storage can be a database where the memory-based data is persisted. In StateServer session state mode, it is still server memory, but data ends up on a different server, the state server.

See Also

C1.Data Namespace


CommandTypeEnum Enumeration

CommandTypeEnum Enumeration

Specifies how a command string is interpreted.

[Visual Basic]

Public Enum CommandTypeEnum

[C#]

public enum CommandTypeEnum

[Delphi]

type CommandTypeEnum = (StoredProcedure, Text);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
StoredProcedure | A stored procedure name.
Text | A SQL statement.

See Also

C1.Data Namespace


CompositeTableRow Class

CompositeTableRow Class

For a list of all members of this type, see CompositeTableRow Members.

System.Object

C1.Data.DataItem

C1.Data.CompositeTableRow

[Visual Basic]

Public Class CompositeTableRow

Inherits DataItem

[C#]

public class CompositeTableRow : DataItem

[Delphi]

type CompositeTableRow = class (DataItem);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


CompositeTableRow Members

CompositeTableRow Members

CompositeTableRow overview

Public Properties

DataRow (inherited from DataItem)

Gets the C1DataRow object represented by this data item.


CompositeTableRow Properties

CompositeTableRow Properties

The properties of the CompositeTableRow class are listed here. For a complete list of CompositeTableRow class members, see the CompositeTableRow Members topic.

Public Properties

DataRow (inherited from DataItem)

Gets the C1DataRow object represented by this data item.


ConstraintCollection Class

ConstraintCollection Class

Represents a collection of ConstraintInfo objects.

For a list of all members of this type, see ConstraintCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.ConstraintCollection

[Visual Basic]

Public Class ConstraintCollection

Inherits CollectionBase

[C#]

public class ConstraintCollection : CollectionBase

[Delphi]

type ConstraintCollection = class (CollectionBase);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


ConstraintCollection Members

ConstraintCollection Members

ConstraintCollection overview

Public Properties

Item

Gets the element of the collection at the specified index.

Public Methods

Add | Adds an element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Remove | Removes the first occurrence of a specific object from the collection.


ConstraintCollection Properties

ConstraintCollection Properties

The properties of the ConstraintCollection class are listed here. For a complete list of ConstraintCollection class members, see the ConstraintCollection Members topic.

Public Properties

Item

Gets the element of the collection at the specified index.


ConstraintCollection.Item Property

ConstraintCollection.Item Property

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As ConstraintInfo

[C#]

public ConstraintInfo this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: ConstraintInfo read get_Item;


ConstraintCollection Methods

ConstraintCollection Methods

The methods of the ConstraintCollection class are listed here. For a complete list of ConstraintCollection class members, see the ConstraintCollection Members topic.

Public Methods

Add | Adds an element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Remove | Removes the first occurrence of a specific object from the collection.


ConstraintCollection.Add Method

ConstraintCollection.Add Method

Adds an element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal constraint As ConstraintInfo _

)

[C#]

public void Add(

ConstraintInfo constraint

);

[Delphi]

public procedure Add(

constraint: ConstraintInfo

);

Parameters

constraint

The object to be added to the end of the collection.


ConstraintCollection.Contains Method

ConstraintCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal constraint As ConstraintInfo _

) As Boolean

[C#]

public bool Contains(

ConstraintInfo constraint

);

[Delphi]

public function Contains(

constraint: ConstraintInfo

): Boolean;

Parameters

constraint

The Object to locate in the collection.

Return Value


ConstraintCollection.CopyTo Method

ConstraintCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal ar As ConstraintInfo(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

ConstraintInfo[] ar,

int index

);

[Delphi]

public procedure CopyTo(

ar: array of ConstraintInfo;

index: Int32

);

Parameters

ar

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


ConstraintCollection.IndexOf Method

ConstraintCollection.IndexOf Method

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal constraint As ConstraintInfo _

) As Integer

[C#]

public int IndexOf(

ConstraintInfo constraint

);

[Delphi]

public function IndexOf(

constraint: ConstraintInfo

): Int32;

Parameters

constraint

The Object to locate in the collection.

Return Value


ConstraintCollection.Remove Method

ConstraintCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal constraint As ConstraintInfo _

)

[C#]

public void Remove(

ConstraintInfo constraint

);

[Delphi]

public procedure Remove(

constraint: ConstraintInfo

);

Parameters

constraint

The object to remove from the collection.


ConstraintException Class

ConstraintException Class

Represents the exception that is thrown when attempting an action that violates a constraint.

For a list of all members of this type, see ConstraintException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.ConstraintException

[Visual Basic]

Public Class ConstraintException

Inherits ApplicationException

[C#]

public class ConstraintException : ApplicationException

[Delphi]

type ConstraintException = class (ApplicationException);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


ConstraintException Members

ConstraintException Members

ConstraintException overview

Public Properties

ErrorField | Gets the DataField where the exception occured.
ErrorTable | Gets the C1DataTable where the exception occured.


ConstraintException Properties

ConstraintException Properties

The properties of the ConstraintException class are listed here. For a complete list of ConstraintException class members, see the ConstraintException Members topic.

Public Properties

ErrorField | Gets the DataField where the exception occured.
ErrorTable | Gets the C1DataTable where the exception occured.


ConstraintException.ErrorField Property

ConstraintException.ErrorField Property

Gets the DataField where the exception occured.

[Visual Basic]

Public ReadOnly Property ErrorField As DataField

[C#]

public DataField ErrorField {get;}

[Delphi]

public property ErrorField: DataField read get_ErrorField;


ConstraintException.ErrorTable Property

ConstraintException.ErrorTable Property

Gets the C1DataTable where the exception occured.

[Visual Basic]

Public ReadOnly Property ErrorTable As C1DataTable

[C#]

public C1DataTable ErrorTable {get;}

[Delphi]

public property ErrorTable: C1DataTable read get_ErrorTable;


ConstraintInfo Class

ConstraintInfo Class

An element of a field’s Constraints collection.

For a list of all members of this type, see ConstraintInfo Members.

System.Object

C1.Data.ConstraintInfo

[Visual Basic]

Public Class ConstraintInfo

[C#]

public class ConstraintInfo

[Delphi]

type ConstraintInfo = class;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


ConstraintInfo Members

ConstraintInfo Members

ConstraintInfo overview

Public Properties

Condition | Gets or sets an optional boolean expression defining applicability of a constraint.
ErrorDescription | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
Expression | Gets or sets the boolean expression used to test a constraint.


ConstraintInfo Properties

ConstraintInfo Properties

The properties of the ConstraintInfo class are listed here. For a complete list of ConstraintInfo class members, see the ConstraintInfo Members topic.

Public Properties

Condition | Gets or sets an optional boolean expression defining applicability of a constraint.
ErrorDescription | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
Expression | Gets or sets the boolean expression used to test a constraint.


ConstraintInfo.Condition Property

ConstraintInfo.Condition Property

Gets or sets an optional boolean expression defining applicability of a constraint.

[Visual Basic]

Public Property Condition As String

[C#]

public string Condition {get;set;}

[Delphi]

public property Condition: String read get_Condition write set_Condition;

Remarks

If this expression is empty or evaluates to True, the ConstraintExpression is evaluated. If it evaluates to False, this constraint is skipped.


ConstraintInfo.ErrorDescription Property

ConstraintInfo.ErrorDescription Property

Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.

[Visual Basic]

Public Property ErrorDescription As String

[C#]

public string ErrorDescription {get;set;}

[Delphi]

public property ErrorDescription: String read get_ErrorDescription write set_ErrorDescription;


ConstraintInfo.Expression Property

ConstraintInfo.Expression Property

Gets or sets the boolean expression used to test a constraint.

[Visual Basic]

Public Property Expression As String

[C#]

public string Expression {get;set;}

[Delphi]

public property Expression: String read get_Expression write set_Expression;


CurrentRowChangedEventArgs Class

CurrentRowChangedEventArgs Class

Provides data for the C1.Data.C1DataSet.CurrentRowChanged event in C1DataSet and C1DataExpress components.

For a list of all members of this type, see CurrentRowChangedEventArgs Members.

System.Object

System.EventArgs

C1.Data.CurrentRowChangedEventArgs

[Visual Basic]

Public Class CurrentRowChangedEventArgs

Inherits EventArgs

[C#]

public class CurrentRowChangedEventArgs : EventArgs

[Delphi]

type CurrentRowChangedEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


CurrentRowChangedEventArgs Members

CurrentRowChangedEventArgs Members

CurrentRowChangedEventArgs overview

Public Properties

ChangeType | Indicates a type of change occurred.
CurrencyManager | Returns the CurrencyManager object that manages this rowset.
DataMember | For C1DataSet rowsets, that is, when a C1DataSet component is specified as the DataSource value for a bound control, this property returns the DataMember value used to bind to this rowset. In other cases, the value is empty string.
Position | Position of Row in the list.
Row | Row that became current, or null if there is no current row (empty rowset).
TableName | Name the of table on which the rowset is based.
TableViewName | Name of the table view on which the rowset is based. In C1DataView, if the rowset represents rows directly from a table, that is, when TableName property is used to define the rowset source, this property value is empty string.


CurrentRowChangedEventArgs Properties

CurrentRowChangedEventArgs Properties

The properties of the CurrentRowChangedEventArgs class are listed here. For a complete list of CurrentRowChangedEventArgs class members, see the CurrentRowChangedEventArgs Members topic.

Public Properties

ChangeType | Indicates a type of change occurred.
CurrencyManager | Returns the CurrencyManager object that manages this rowset.
DataMember | For C1DataSet rowsets, that is, when a C1DataSet component is specified as the DataSource value for a bound control, this property returns the DataMember value used to bind to this rowset. In other cases, the value is empty string.
Position | Position of Row in the list.
Row | Row that became current, or null if there is no current row (empty rowset).
TableName | Name the of table on which the rowset is based.
TableViewName | Name of the table view on which the rowset is based. In C1DataView, if the rowset represents rows directly from a table, that is, when TableName property is used to define the rowset source, this property value is empty string.


CurrentRowChangedEventArgs.ChangeType Property

CurrentRowChangedEventArgs.ChangeType Property

Indicates a type of change occurred.

[Visual Basic]

Public ReadOnly Property ChangeType As RowChangedTypeEnum

[C#]

public RowChangedTypeEnum ChangeType {get;}

[Delphi]

public property ChangeType: RowChangedTypeEnum read get_ChangeType;


CurrentRowChangedEventArgs.CurrencyManager Property

CurrentRowChangedEventArgs.CurrencyManager Property

Returns the CurrencyManager object that manages this rowset.

[Visual Basic]

Public ReadOnly Property CurrencyManager As CurrencyManager

[C#]

public CurrencyManager CurrencyManager {get;}

[Delphi]

public property CurrencyManager: CurrencyManager read get_CurrencyManager;


CurrentRowChangedEventArgs.DataMember Property

CurrentRowChangedEventArgs.DataMember Property

For C1DataSet rowsets, that is, when a C1DataSet component is specified as the DataSource value for a bound control, this property returns the DataMember value used to bind to this rowset. In other cases, the value is empty string.

[Visual Basic]

Public ReadOnly Property DataMember As String

[C#]

public string DataMember {get;}

[Delphi]

public property DataMember: String read get_DataMember;


CurrentRowChangedEventArgs.Position Property

CurrentRowChangedEventArgs.Position Property

Position of Row in the list.

[Visual Basic]

Public ReadOnly Property Position As Integer

[C#]

public int Position {get;}

[Delphi]

public property Position: Int32 read get_Position;


CurrentRowChangedEventArgs.Row Property

CurrentRowChangedEventArgs.Row Property

Row that became current, or null if there is no current row (empty rowset).

[Visual Basic]

Public ReadOnly Property Row As C1DataRow

[C#]

public C1DataRow Row {get;}

[Delphi]

public property Row: C1DataRow read get_Row;


CurrentRowChangedEventArgs.TableName Property

CurrentRowChangedEventArgs.TableName Property

Name the of table on which the rowset is based.

[Visual Basic]

Public ReadOnly Property TableName As String

[C#]

public string TableName {get;}

[Delphi]

public property TableName: String read get_TableName;


CurrentRowChangedEventArgs.TableViewName Property

CurrentRowChangedEventArgs.TableViewName Property

Name of the table view on which the rowset is based. In C1DataView, if the rowset represents rows directly from a table, that is, when TableName property is used to define the rowset source, this property value is empty string.

[Visual Basic]

Public ReadOnly Property TableViewName As String

[C#]

public string TableViewName {get;}

[Delphi]

public property TableViewName: String read get_TableViewName;


CurrentRowChangedEventHandler Delegate

CurrentRowChangedEventHandler Delegate

Represents the method that handles the CurrentRowChanged event in C1DataSet and C1DataExpress components.

[Visual Basic]

Public Delegate Sub CurrentRowChangedEventHandler( _

ByVal sender As Object, _

ByVal e As CurrentRowChangedEventArgs _

)

[C#]

public delegate void CurrentRowChangedEventHandler(

object sender,

CurrentRowChangedEventArgs e

);

[Delphi]

type CurrentRowChangedEventHandler = procedure (

sender: Object;

e: CurrentRowChangedEventArgs

) of object;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


DataActionCanceledException Class

DataActionCanceledException Class

Represents an exception that is thrown when an action is canceled by throwing an exception in a business logic event (see Business Logic).

For a list of all members of this type, see DataActionCanceledException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.DataActionCanceledException

[Visual Basic]

Public Class DataActionCanceledException

Inherits C1DataException

[C#]

public class DataActionCanceledException : C1DataException

[Delphi]

type DataActionCanceledException = class (C1DataException);

Remarks

To retrieve the exception thrown by the user code in a business logic event, use the InnerException property belonging to the System.Exception class.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DataActionCanceledException Members

DataActionCanceledException Members

DataActionCanceledException overview

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


DataActionCanceledException Properties

DataActionCanceledException Properties

The properties of the DataActionCanceledException class are listed here. For a complete list of DataActionCanceledException class members, see the DataActionCanceledException Members topic.

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


DataField Class

DataField Class

Represents a field of a C1DataTable, an item of the Fields collection.

For a list of all members of this type, see DataField Members.

System.Object

C1.Data.DataField

[Visual Basic]

Public Class DataField

[C#]

public class DataField

[Delphi]

type DataField = class;

Remarks

Data table fields correspond to schema fields, Field objects of the corresponding schema table or table view. The DataField class contains only a few most important field properties. To access other field property values, use the schema Field accessible through the SchemaField property.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DataField Members

DataField Members

DataField overview

Public Properties

DataTable | Gets the C1DataTable to which the field belongs.
DataType | Gets the type of field data.
ExtendedProperties | Gets a collection of custom user information associated with the data set.
Name | Gets the name of the field in the DataFieldCollection.
Ordinal | Gets the position of the field in the DataFieldCollection.
SchemaField | Gets the schema Field object on which the field is based.
StorageDataColumn | Gets the ADO.NET DataColumn object storing this field's data.


DataField Properties

DataField Properties

The properties of the DataField class are listed here. For a complete list of DataField class members, see the DataField Members topic.

Public Properties

DataTable | Gets the C1DataTable to which the field belongs.
DataType | Gets the type of field data.
ExtendedProperties | Gets a collection of custom user information associated with the data set.
Name | Gets the name of the field in the DataFieldCollection.
Ordinal | Gets the position of the field in the DataFieldCollection.
SchemaField | Gets the schema Field object on which the field is based.
StorageDataColumn | Gets the ADO.NET DataColumn object storing this field's data.


DataField.DataTable Property

DataField.DataTable Property

Gets the C1DataTable to which the field belongs.

[Visual Basic]

Public ReadOnly Property DataTable As C1DataTable

[C#]

public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;


DataField.DataType Property

DataField.DataType Property

Gets the type of field data.

[Visual Basic]

Public ReadOnly Property DataType As Type

[C#]

public Type DataType {get;}

[Delphi]

public property DataType: Type read get_DataType;


DataField.ExtendedProperties Property

DataField.ExtendedProperties Property

Gets a collection of custom user information associated with the data set.

[Visual Basic]

Public ReadOnly Property ExtendedProperties As PropertyCollection

[C#]

public PropertyCollection ExtendedProperties {get;}

[Delphi]

public property ExtendedProperties: PropertyCollection read get_ExtendedProperties;

Remarks

This property allows you to store arbitrary custom information with the object.


DataField.Name Property

DataField.Name Property

Gets the name of the field in the DataFieldCollection.

[Visual Basic]

Public ReadOnly Property Name As String

[C#]

public string Name {get;}

[Delphi]

public property Name: String read get_Name;

Remarks

This property is used to return this data field from the C1DataTable object’s Fields collection.


DataField.Ordinal Property

DataField.Ordinal Property

Gets the position of the field in the DataFieldCollection.

[Visual Basic]

Public ReadOnly Property Ordinal As Integer

[C#]

public int Ordinal {get;}

[Delphi]

public property Ordinal: Int32 read get_Ordinal;

Remarks

This property is used to return this data field from the C1DataTable object’s Fields collection.


DataField.SchemaField Property

DataField.SchemaField Property

Gets the schema Field object on which the field is based.

[Visual Basic]

Public ReadOnly Property SchemaField As Field

[C#]

public Field SchemaField {get;}

[Delphi]

public property SchemaField: Field read get_SchemaField;

Remarks

Data table fields correspond to schema fields, C1.Data.SchemaObjects.Field objects of the corresponding schema table or table view that can be accessed through the SchemaTable property of the C1DataTable.


DataField.StorageDataColumn Property

DataField.StorageDataColumn Property

Gets the ADO.NET DataColumn object storing this field's data.

[Visual Basic]

Public ReadOnly Property StorageDataColumn As DataColumn

[C#]

public DataColumn StorageDataColumn {get;}

[Delphi]

public property StorageDataColumn: DataColumn read get_StorageDataColumn;

Remarks

The DataColumn belongs to the table StorageDataTable.

This property returns a non-null value only for fields of C1DataTable objects representing simple tables. For C1DataTable objects representing composite tables and table views, this property returns null (Nothing in Visual Basic) for all fields.


DataFieldCollection Class

DataFieldCollection Class

Represents a collection of DataField objects, fields of a C1DataTable.

For a list of all members of this type, see DataFieldCollection Members.

System.Object

C1.Data.DataFieldCollection

[Visual Basic]

Public Class DataFieldCollection

Implements ICollection, IEnumerable

[C#]

public class DataFieldCollection : ICollection, IEnumerable

[Delphi]

type DataFieldCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DataFieldCollection Members

DataFieldCollection Members

DataFieldCollection overview

Public Properties

Count | Gets the total number of elements in a collection.
Item | Overloaded. Gets the element of the collection at the specified index.

Public Methods

CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.


DataFieldCollection Properties

DataFieldCollection Properties

The properties of the DataFieldCollection class are listed here. For a complete list of DataFieldCollection class members, see the DataFieldCollection Members topic.

Public Properties

Count | Gets the total number of elements in a collection.
Item | Overloaded. Gets the element of the collection at the specified index.


DataFieldCollection.Count Property

DataFieldCollection.Count Property

Gets the total number of elements in a collection.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count


DataFieldCollection.Item Property

DataFieldCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As DataField

[C#] public DataField this[int]{get;}

[Delphi] public property Item[index: Int32]: DataField read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As DataField

[C#] public DataField this[string]{get;}

[Delphi] public property Item[name: String]: DataField read get_Item;


DataFieldCollection.Item Property (Int32)

DataFieldCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As DataField

[C#]

public DataField this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: DataField read get_Item;

Parameters

index

The zero-based index of the element.


DataFieldCollection.Item Property (String)

DataFieldCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As DataField

[C#]

public DataField this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: DataField read get_Item;

Parameters

name

The Name of the element.


DataFieldCollection Methods

DataFieldCollection Methods

The methods of the DataFieldCollection class are listed here. For a complete list of DataFieldCollection class members, see the DataFieldCollection Members topic.

Public Methods

CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.


DataFieldCollection.CopyTo Method

DataFieldCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As DataField(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

DataField[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of DataField;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


DataFieldCollection.IndexOf Method

DataFieldCollection.IndexOf Method

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


DataItem Class

DataItem Class

Represents a C1DataRow exposed to data bound controls. The corresponding C1DataRow object can be obtained as DataItem.DataRow. Alternatively, the same C1DataRow objects can be obtained as FromDataItem(dataItem).

For a list of all members of this type, see DataItem Members.

System.Object

C1.Data.DataItem

C1.Data.CompositeTableRow

[Visual Basic]

Public Class DataItem

Implements ICustomTypeDescriptor, IDataErrorInfo, IEditableObject

[C#]

public class DataItem : ICustomTypeDescriptor, IDataErrorInfo, IEditableObject

[Delphi]

type DataItem = class (TObject, ICustomTypeDescriptor, IDataErrorInfo, IEditableObject);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DataItem Members

DataItem Members

DataItem overview

Public Properties

DataRow

Gets the C1DataRow object represented by this data item.


DataItem Properties

DataItem Properties

The properties of the DataItem class are listed here. For a complete list of DataItem class members, see the DataItem Members topic.

Public Properties

DataRow

Gets the C1DataRow object represented by this data item.


DataItem.DataRow Property

DataItem.DataRow Property

Gets the C1DataRow object represented by this data item.

[Visual Basic]

Public ReadOnly Property DataRow As C1DataRow

[C#]

public C1DataRow DataRow {get;}

[Delphi]

public property DataRow: C1DataRow read get_DataRow;


DataObjectsAssemblyFlags Enumeration

DataObjectsAssemblyFlags Enumeration

Flags affecting generated classes in the data objects assembly (*.DataObjects.dll).

[Visual Basic]

Public Enum DataObjectsAssemblyFlags

[C#]

public enum DataObjectsAssemblyFlags

[Delphi]

type DataObjectsAssemblyFlags = (All, DataSetNamespaces, None, StaticNameFields);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Remarks

Used in the DataObjectsAssemblyFlags property.

Members

Member name | Description
All | DataSetNamespaces | StaticNameFields
DataSetNamespaces | Generated table view classes belong to special namespaces, a namespace for each data set.
None | All generated classes belong to a single namespace, no static name fields are generated.
StaticNameFields | Enables generating static string properties returning field, table, table view and relation names, to be used in code instead of constant strings, to prevent errors in naming objects.

See Also

C1.Data Namespace


DataRowActionEnum Enumeration

DataRowActionEnum Enumeration

Indicates an action performed on a data row.

[Visual Basic]

Public Enum DataRowActionEnum

[C#]

public enum DataRowActionEnum

[Delphi]

type DataRowActionEnum = (AcceptChanges, AddNew, AfterChanges, BeginEdit, CancelEdit, Delete, EndAddNew, EndEdit, FirstChange, Nothing, RejectChanges);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
AcceptChanges | AcceptChanges or AcceptChanges called.
AddNew | A new (empty) row added.
AfterChanges | All actions directly triggered by the user and by code that handled them, have been handled. After that, C1DataObjects gives the programmer an opportunity to perform whatever actions necessary after handling all the changes.
BeginEdit | Row switched to edit mode.
CancelEdit | Canceled changes made to the row in edit mode.
Delete | Row deleted.
EndAddNew | An added row becomes a regular row in the rowset. It happens when its primary key and other required ( AllowDbNull=false) fields are specified.
EndEdit | Row left edit mode.
FirstChange | Row changed first time since it entered edit mode.
Nothing | No action.
RejectChanges | RejectChanges or RejectChanges called.

See Also

C1.Data Namespace


DataRowStateEnum Enumeration

DataRowStateEnum Enumeration

Specifies the state of a C1DataRow.

[Visual Basic]

Public Enum DataRowStateEnum

[C#]

public enum DataRowStateEnum

[Delphi]

type DataRowStateEnum = (Added, Deleted, Detached, Modified, Unchanged);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Added | The row was added using the AddNew method of C1DataTable.
Deleted | The row was deleted using the Delete method of C1DataRow.
Detached | The row was removed from the table and will be destroyed. Detached rows are not considered deleted, they are completely removed from the data set and will not be accessible.
Modified | Some row field values were modified. If the modification occurred in edit mode, the edit was ended.
Unchanged | The row has not changed since Fill, AcceptChanges or RejectChanges.

See Also

C1.Data Namespace


DataRowVersionEnum Enumeration

DataRowVersionEnum Enumeration

Specifies the version of a C1DataRow.

[Visual Basic]

Public Enum DataRowVersionEnum

[C#]

public enum DataRowVersionEnum

[Delphi]

type DataRowVersionEnum = (Current, Default, Original, Proposed);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Current | Current values in the row.
Default | Default values in an added row, as they were immediately after the row was added.
Original | Original values in the row, as they were fetched from the database.
Proposed | Values set in edit mode, they have not yet become current, will become current when edit mode ends.

See Also

C1.Data Namespace


DataSetEventArgs Class

DataSetEventArgs Class

Provides data for the C1.Data.C1DataSetLogic.BeforeUpdate and C1.Data.C1DataSetLogic.AfterUpdate events.

For a list of all members of this type, see DataSetEventArgs Members.

System.Object

System.EventArgs

C1.Data.DataSetEventArgs

[Visual Basic]

Public Class DataSetEventArgs

Inherits EventArgs

[C#]

public class DataSetEventArgs : EventArgs

[Delphi]

type DataSetEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DataSetEventArgs Members

DataSetEventArgs Members

DataSetEventArgs overview

Public Properties

DataSet | The data set where the event has occurred.
Error | For an unsuccessful operation, information detailing the error.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
Tables | Returns the table collection of the data set. Use this property to gain access to table data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.
TableViews | Returns the table view collection of the data set. Use this property to gain access to table view data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.


DataSetEventArgs Properties

DataSetEventArgs Properties

The properties of the DataSetEventArgs class are listed here. For a complete list of DataSetEventArgs class members, see the DataSetEventArgs Members topic.

Public Properties

DataSet | The data set where the event has occurred.
Error | For an unsuccessful operation, information detailing the error.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
Tables | Returns the table collection of the data set. Use this property to gain access to table data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.
TableViews | Returns the table view collection of the data set. Use this property to gain access to table view data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.


DataSetEventArgs.DataSet Property

DataSetEventArgs.DataSet Property

The data set where the event has occurred.

[Visual Basic]

Public ReadOnly Property DataSet As C1DataSet

[C#]

public C1DataSet DataSet {get;}

[Delphi]

public property DataSet: C1DataSet read get_DataSet;


DataSetEventArgs.Error Property

DataSetEventArgs.Error Property

For an unsuccessful operation, information detailing the error.

[Visual Basic]

Public Property Error As Exception

[C#]

public Exception Error {get;set;}

[Delphi]

public property Error: Exception read get_Error write set_Error;


DataSetEventArgs.Status Property

DataSetEventArgs.Status Property

Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.

[Visual Basic]

Public Property Status As DataSetEventStatusEnum

[C#]

public DataSetEventStatusEnum Status {get;set;}

[Delphi]

public property Status: DataSetEventStatusEnum read get_Status write set_Status;


DataSetEventArgs.Tables Property

DataSetEventArgs.Tables Property

Returns the table collection of the data set. Use this property to gain access to table data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.

[Visual Basic]

Public ReadOnly Property Tables As C1DataTableCollection

[C#]

public C1DataTableCollection Tables {get;}

[Delphi]

public property Tables: C1DataTableCollection read get_Tables;


DataSetEventArgs.TableViews Property

DataSetEventArgs.TableViews Property

Returns the table view collection of the data set. Use this property to gain access to table view data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.

[Visual Basic]

Public ReadOnly Property TableViews As C1DataTableCollection

[C#]

public C1DataTableCollection TableViews {get;}

[Delphi]

public property TableViews: C1DataTableCollection read get_TableViews;


DataSetEventHandler Delegate

DataSetEventHandler Delegate

Represents the method that handles the C1.Data.C1DataSetLogic.BeforeUpdate and C1.Data.C1DataSetLogic.AfterUpdate events.

[Visual Basic]

Public Delegate Sub DataSetEventHandler( _

ByVal sender As Object, _

ByVal e As DataSetEventArgs _

)

[C#]

public delegate void DataSetEventHandler(

object sender,

DataSetEventArgs e

);

[Delphi]

type DataSetEventHandler = procedure (

sender: Object;

e: DataSetEventArgs

) of object;

Parameters

sender

The source of the event.

e

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


DataSetEventStatusEnum Enumeration

DataSetEventStatusEnum Enumeration

Indicates status before and after an operation on a table view in a data set or on a whole data set.

[Visual Basic]

Public Enum DataSetEventStatusEnum

[C#]

public enum DataSetEventStatusEnum

[Delphi]

type DataSetEventStatusEnum = (Continue, ErrorsOccured, Skip);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Continue | Successful operation.
ErrorsOccured | Operation failed.
Skip | If this status value is set in event code, operation must be skipped and considered successful.

See Also

C1.Data Namespace


DataViewRowStateEnum Enumeration

DataViewRowStateEnum Enumeration

Specifies a subset of rows satisfying certain status and version conditions.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

[Visual Basic]

Public Enum DataViewRowStateEnum

[C#]

public enum DataViewRowStateEnum

[Delphi]

type DataViewRowStateEnum = (Added, CurrentRows, Deleted, ModifiedCurrent, ModifiedOriginal, None, OriginalRows, Unchanged);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Added | New rows.
CurrentRows | Current rows including unchanged, new, and modified rows.
Deleted | Deleted rows, not including rows that were first added, then deleted (those are completely removed and cannot be accessed).
ModifiedCurrent | Modified rows.
ModifiedOriginal | The original version of modified rows (the modified version is available as ModifiedCurrent).
None | None
OriginalRows | Original rows, including ModifiedOriginal, deleted and unchanged.
Unchanged | Unchanged rows.

See Also

C1.Data Namespace


DbAccessException Class

DbAccessException Class

Represents an exception that is thrown while performing database access operations fetching data or updating the database.

For a list of all members of this type, see DbAccessException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.DbAccessException

[Visual Basic]

Public Class DbAccessException

Inherits C1DataException

[C#]

public class DbAccessException : C1DataException

[Delphi]

type DbAccessException = class (C1DataException);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DbAccessException Members

DbAccessException Members

DbAccessException overview

Public Properties

Connection | Gets the name of the Connection object used to connect to the database.
ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


DbAccessException Properties

DbAccessException Properties

The properties of the DbAccessException class are listed here. For a complete list of DbAccessException class members, see the DbAccessException Members topic.

Public Properties

Connection | Gets the name of the Connection object used to connect to the database.
ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


DbAccessException.Connection Property

DbAccessException.Connection Property

Gets the name of the Connection object used to connect to the database.

[Visual Basic]

Public ReadOnly Property Connection As String

[C#]

public string Connection {get;}

[Delphi]

public property Connection: String read get_Connection;


DisabledOperationException Class

DisabledOperationException Class

Represents an exception that is thrown on attempt to perform an action that is disabled by the current property settings.

For a list of all members of this type, see DisabledOperationException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.DisabledOperationException

[Visual Basic]

Public Class DisabledOperationException

Inherits C1DataException

[C#]

public class DisabledOperationException : C1DataException

[Delphi]

type DisabledOperationException = class (C1DataException);

Remarks

Represents an exception that is thrown on attempt to perform an action that is disabled by the current property settings (such as C1.Data.SchemaObjects.ReadOnly, C1.Data.SchemaObjects.AllowDelete, etc.) or the current state of an object.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


DisabledOperationException Members

DisabledOperationException Members

DisabledOperationException overview

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
Operation | Gets the attempted operation
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


DisabledOperationException Properties

DisabledOperationException Properties

The properties of the DisabledOperationException class are listed here. For a complete list of DisabledOperationException class members, see the DisabledOperationException Members topic.

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
Operation | Gets the attempted operation
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


DisabledOperationException.Operation Property

DisabledOperationException.Operation Property

Gets the attempted operation

[Visual Basic]

Public ReadOnly Property Operation As OperationEnum

[C#]

public OperationEnum Operation {get;}

[Delphi]

public property Operation: OperationEnum read get_Operation;


ErrorEventArgs Class

ErrorEventArgs Class

For a list of all members of this type, see ErrorEventArgs Members.

System.Object

System.EventArgs

C1.Data.ErrorEventArgs

[Visual Basic]

Public Class ErrorEventArgs

Inherits EventArgs

[C#]

public class ErrorEventArgs : EventArgs

[Delphi]

type ErrorEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


ErrorEventArgs Members

ErrorEventArgs Members

ErrorEventArgs overview

Public Properties

Error | Exception object describing the error.
ShowMessage | Indicates whether an error message is shown. Set this argument to False if you have already shown an error message or otherwise handled the error and do not want the standard error message to appear.


ErrorEventArgs Properties

ErrorEventArgs Properties

The properties of the ErrorEventArgs class are listed here. For a complete list of ErrorEventArgs class members, see the ErrorEventArgs Members topic.

Public Properties

Error | Exception object describing the error.
ShowMessage | Indicates whether an error message is shown. Set this argument to False if you have already shown an error message or otherwise handled the error and do not want the standard error message to appear.


ErrorEventArgs.Error Property

ErrorEventArgs.Error Property

Exception object describing the error.

[Visual Basic]

Public ReadOnly Property Error As Exception

[C#]

public Exception Error {get;}

[Delphi]

public property Error: Exception read get_Error;


ErrorEventArgs.ShowMessage Property

ErrorEventArgs.ShowMessage Property

Indicates whether an error message is shown. Set this argument to False if you have already shown an error message or otherwise handled the error and do not want the standard error message to appear.

[Visual Basic]

Public Property ShowMessage As Boolean

[C#]

public bool ShowMessage {get;set;}

[Delphi]

public property ShowMessage: Boolean read get_ShowMessage write set_ShowMessage;


ExecutionModeEnum Enumeration

ExecutionModeEnum Enumeration

Specifies whether actions in handling business object events are deferred or performed immediately.

[Visual Basic]

Public Enum ExecutionModeEnum

[C#]

public enum ExecutionModeEnum

[Delphi]

type ExecutionModeEnum = (Deferred, Immediate);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Remarks

Use the members of this enumeration to determine the action performed on a data row.

Members

Member name | Description
Deferred | Actions deferred until the current user action handling is completed.
Immediate | Actions performed immediately.

See Also

C1.Data Namespace


ExpressionException Class

ExpressionException Class

Represents an exception that is thrown when attempting an operation using an invalid field expression.

For a list of all members of this type, see ExpressionException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.ExpressionException

[Visual Basic]

Public Class ExpressionException

Inherits C1DataException

[C#]

public class ExpressionException : C1DataException

[Delphi]

type ExpressionException = class (C1DataException);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


ExpressionException Members

ExpressionException Members

ExpressionException overview

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


ExpressionException Properties

ExpressionException Properties

The properties of the ExpressionException class are listed here. For a complete list of ExpressionException class members, see the ExpressionException Members topic.

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


FetchEventArgs Class

FetchEventArgs Class

Provides data for the C1.Data.C1DataSetLogic.BeforeFetch and C1.Data.C1DataSetLogic.AfterFetch events.

For a list of all members of this type, see FetchEventArgs Members.

System.Object

System.EventArgs

C1.Data.FetchEventArgs

[Visual Basic]

Public Class FetchEventArgs

Inherits EventArgs

[C#]

public class FetchEventArgs : EventArgs

[Delphi]

type FetchEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FetchEventArgs Members

FetchEventArgs Members

FetchEventArgs overview

Public Properties

Command | For a bound or SQL-based table, the IDbCommand object containing the generated SQL SELECT statement. This argument is null for an unbound table.
Filter | Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.
Reader | The reader object providing the fetched data.
Sql | The generated SQL SELECT statement.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
Tables | Returns the table collection of the data set being populated.
TableView | The table view being populated.
TableViews | Returns the table views collection of the data set being populated.


FetchEventArgs Properties

FetchEventArgs Properties

The properties of the FetchEventArgs class are listed here. For a complete list of FetchEventArgs class members, see the FetchEventArgs Members topic.

Public Properties

Command | For a bound or SQL-based table, the IDbCommand object containing the generated SQL SELECT statement. This argument is null for an unbound table.
Filter | Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.
Reader | The reader object providing the fetched data.
Sql | The generated SQL SELECT statement.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
Tables | Returns the table collection of the data set being populated.
TableView | The table view being populated.
TableViews | Returns the table views collection of the data set being populated.


FetchEventArgs.Command Property

FetchEventArgs.Command Property

For a bound or SQL-based table, the IDbCommand object containing the generated SQL SELECT statement. This argument is null for an unbound table.

[Visual Basic]

Public ReadOnly Property Command As Object

[C#]

public object Command {get;}

[Delphi]

public property Command: Object read get_Command;


FetchEventArgs.Filter Property

FetchEventArgs.Filter Property

Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.

[Visual Basic]

Public ReadOnly Property Filter As FilterConditions

[C#]

public FilterConditions Filter {get;}

[Delphi]

public property Filter: FilterConditions read get_Filter;


FetchEventArgs.Reader Property

FetchEventArgs.Reader Property

The reader object providing the fetched data.

[Visual Basic]

Public Property Reader As IDataReader

[C#]

public IDataReader Reader {get;set;}

[Delphi]

public property Reader: IDataReader read get_Reader write set_Reader;


FetchEventArgs.Sql Property

FetchEventArgs.Sql Property

The generated SQL SELECT statement.

[Visual Basic]

Public ReadOnly Property Sql As String

[C#]

public string Sql {get;}

[Delphi]

public property Sql: String read get_Sql;


FetchEventArgs.Status Property

FetchEventArgs.Status Property

Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.

[Visual Basic]

Public Property Status As DataSetEventStatusEnum

[C#]

public DataSetEventStatusEnum Status {get;set;}

[Delphi]

public property Status: DataSetEventStatusEnum read get_Status write set_Status;


FetchEventArgs.Tables Property

FetchEventArgs.Tables Property

Returns the table collection of the data set being populated.

[Visual Basic]

Public ReadOnly Property Tables As C1DataTableCollection

[C#]

public C1DataTableCollection Tables {get;}

[Delphi]

public property Tables: C1DataTableCollection read get_Tables;


FetchEventArgs.TableView Property

FetchEventArgs.TableView Property

The table view being populated.

[Visual Basic]

Public ReadOnly Property TableView As TableView

[C#]

public TableView TableView {get;}

[Delphi]

public property TableView: TableView read get_TableView;


FetchEventArgs.TableViews Property

FetchEventArgs.TableViews Property

Returns the table views collection of the data set being populated.

[Visual Basic]

Public ReadOnly Property TableViews As C1DataTableCollection

[C#]

public C1DataTableCollection TableViews {get;}

[Delphi]

public property TableViews: C1DataTableCollection read get_TableViews;


FetchEventHandler Delegate

FetchEventHandler Delegate

Represents the method that handles the C1.Data.C1DataSetLogic.BeforeFetch and C1.Data.C1DataSetLogic.AfterFetch events.

[Visual Basic]

Public Delegate Sub FetchEventHandler( _

ByVal sender As Object, _

ByVal e As FetchEventArgs _

)

[C#]

public delegate void FetchEventHandler(

object sender,

FetchEventArgs e

);

[Delphi]

type FetchEventHandler = procedure (

sender: Object;

e: FetchEventArgs

) of object;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


FieldCalculationCollection Class

FieldCalculationCollection Class

For a list of all members of this type, see FieldCalculationCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.FieldCalculationCollection

[Visual Basic]

Public Class FieldCalculationCollection

Inherits CollectionBase

[C#]

public class FieldCalculationCollection : CollectionBase

[Delphi]

type FieldCalculationCollection = class (CollectionBase);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FieldCalculationCollection Members

FieldCalculationCollection Members

FieldCalculationCollection overview

Public Properties

Item

Gets the element of the collection at the specified index.

Public Methods

Add | Adds an element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the FieldCalculationCollection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


FieldCalculationCollection Properties

FieldCalculationCollection Properties

The properties of the FieldCalculationCollection class are listed here. For a complete list of FieldCalculationCollection class members, see the FieldCalculationCollection Members topic.

Public Properties

Item

Gets the element of the collection at the specified index.


FieldCalculationCollection.Item Property

FieldCalculationCollection.Item Property

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As FieldCalculationInfo

[C#]

public FieldCalculationInfo this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: FieldCalculationInfo read get_Item;

Parameters

index

The zero-based index of the element.


FieldCalculationCollection Methods

FieldCalculationCollection Methods

The methods of the FieldCalculationCollection class are listed here. For a complete list of FieldCalculationCollection class members, see the FieldCalculationCollection Members topic.

Public Methods

Add | Adds an element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the FieldCalculationCollection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


FieldCalculationCollection.Add Method

FieldCalculationCollection.Add Method

Adds an element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal calculation As FieldCalculationInfo _

)

[C#]

public void Add(

FieldCalculationInfo calculation

);

[Delphi]

public procedure Add(

calculation: FieldCalculationInfo

);

Parameters

calculation

The object to be added to the end of the collection.


FieldCalculationCollection.Contains Method

FieldCalculationCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal calculation As FieldCalculationInfo _

) As Boolean

[C#]

public bool Contains(

FieldCalculationInfo calculation

);

[Delphi]

public function Contains(

calculation: FieldCalculationInfo

): Boolean;

Parameters

calculation

The Object to locate in the collection.

Return Value


FieldCalculationCollection.CopyTo Method

FieldCalculationCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As FieldCalculationInfo(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

FieldCalculationInfo[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of FieldCalculationInfo;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


FieldCalculationCollection.IndexOf Method

FieldCalculationCollection.IndexOf Method

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal calculation As FieldCalculationInfo _

) As Integer

[C#]

public int IndexOf(

FieldCalculationInfo calculation

);

[Delphi]

public function IndexOf(

calculation: FieldCalculationInfo

): Int32;

Parameters

calculation

The object to locate in the collection.

Return Value


FieldCalculationCollection.Insert Method

FieldCalculationCollection.Insert Method

Inserts an element into the FieldCalculationCollection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal calculation As FieldCalculationInfo _

)

[C#]

public void Insert(

int index,

FieldCalculationInfo calculation

);

[Delphi]

public procedure Insert(

index: Int32;

calculation: FieldCalculationInfo

);

Parameters

index

The zero-based index at which calculation should be inserted.

calculation

The object to insert.


FieldCalculationCollection.Remove Method

FieldCalculationCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal calculation As FieldCalculationInfo _

)

[C#]

public void Remove(

FieldCalculationInfo calculation

);

[Delphi]

public procedure Remove(

calculation: FieldCalculationInfo

);

Parameters

calculation

The object to remove from the collection.


FieldCalculationInfo Class

FieldCalculationInfo Class

An element of a field’s Calculations collection.

For a list of all members of this type, see FieldCalculationInfo Members.

System.Object

C1.Data.FieldCalculationInfo

[Visual Basic]

Public Class FieldCalculationInfo

[C#]

public class FieldCalculationInfo

[Delphi]

type FieldCalculationInfo = class;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FieldCalculationInfo Members

FieldCalculationInfo Members

FieldCalculationInfo overview

Public Properties

Condition | Gets or sets an optional boolean expression defining applicability of a calculation.
Expression | Gets or sets the expression producing the result of a calculation.
FireEvent | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.


FieldCalculationInfo Properties

FieldCalculationInfo Properties

The properties of the FieldCalculationInfo class are listed here. For a complete list of FieldCalculationInfo class members, see the FieldCalculationInfo Members topic.

Public Properties

Condition | Gets or sets an optional boolean expression defining applicability of a calculation.
Expression | Gets or sets the expression producing the result of a calculation.
FireEvent | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.


FieldCalculationInfo.Condition Property

FieldCalculationInfo.Condition Property

Gets or sets an optional boolean expression defining applicability of a calculation.

[Visual Basic]

Public Property Condition As String

[C#]

public string Condition {get;set;}

[Delphi]

public property Condition: String read get_Condition write set_Condition;

Remarks

If this expression is empty or evaluates to True, the CalculationExpression is evaluated and assigned to the field. If it evaluates to False, this calculation is skipped.


FieldCalculationInfo.Expression Property

FieldCalculationInfo.Expression Property

Gets or sets the expression producing the result of a calculation.

[Visual Basic]

Public Property Expression As String

[C#]

public string Expression {get;set;}

[Delphi]

public property Expression: String read get_Expression write set_Expression;

Remarks

///


FieldCalculationInfo.FireEvent Property

FieldCalculationInfo.FireEvent Property

Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.

[Visual Basic]

Public Property FireEvent As Boolean

[C#]

public bool FireEvent {get;set;}

[Delphi]

public property FireEvent: Boolean read get_FireEvent write set_FireEvent;

Remarks

This property is set to False by default. If it is set to True, setting the value from calculation expression triggers the same sequence of events ( C1.Data.BaseLogic.BeforeFieldChange, C1.Data.BaseLogic.AfterFieldChange, C1.Data.BaseLogic.AfterChanges) as if the end user has modified the value.


FieldChangeEventArgs Class

FieldChangeEventArgs Class

Provides data for AfterFieldChange and BeforeFieldChange events in BaseLogic ( C1TableLogic, C1DataSetLogic) and C1DataExpress components.

For a list of all members of this type, see FieldChangeEventArgs Members.

System.Object

System.EventArgs

C1.Data.FieldChangeEventArgs

[Visual Basic]

Public Class FieldChangeEventArgs

Inherits EventArgs

[C#]

public class FieldChangeEventArgs : EventArgs

[Delphi]

type FieldChangeEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FieldChangeEventArgs Members

FieldChangeEventArgs Members

FieldChangeEventArgs overview

Public Properties

DataTable | The table object where the event has occurred.
Field | The field changing value.
NewValue | The field value before change.
OldValue | The field value after change.
Row | The row where the event has occurred.


FieldChangeEventArgs Properties

FieldChangeEventArgs Properties

The properties of the FieldChangeEventArgs class are listed here. For a complete list of FieldChangeEventArgs class members, see the FieldChangeEventArgs Members topic.

Public Properties

DataTable | The table object where the event has occurred.
Field | The field changing value.
NewValue | The field value before change.
OldValue | The field value after change.
Row | The row where the event has occurred.


FieldChangeEventArgs.DataTable Property

FieldChangeEventArgs.DataTable Property

The table object where the event has occurred.

[Visual Basic]

Public ReadOnly Property DataTable As C1DataTable

[C#]

public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;


FieldChangeEventArgs.Field Property

FieldChangeEventArgs.Field Property

The field changing value.

[Visual Basic]

Public ReadOnly Property Field As DataField

[C#]

public DataField Field {get;}

[Delphi]

public property Field: DataField read get_Field;


FieldChangeEventArgs.NewValue Property

FieldChangeEventArgs.NewValue Property

The field value before change.

[Visual Basic]

Public Property NewValue As Object

[C#]

public object NewValue {get;set;}

[Delphi]

public property NewValue: Object read get_NewValue write set_NewValue;


FieldChangeEventArgs.OldValue Property

FieldChangeEventArgs.OldValue Property

The field value after change.

[Visual Basic]

Public ReadOnly Property OldValue As Object

[C#]

public object OldValue {get;}

[Delphi]

public property OldValue: Object read get_OldValue;


FieldChangeEventArgs.Row Property

FieldChangeEventArgs.Row Property

The row where the event has occurred.

[Visual Basic]

Public ReadOnly Property Row As C1DataRow

[C#]

public C1DataRow Row {get;}

[Delphi]

public property Row: C1DataRow read get_Row;


FieldChangeEventHandler Delegate

FieldChangeEventHandler Delegate

Represents the method that handles BeforeFieldChange and AfterFieldChange events.

[Visual Basic]

Public Delegate Sub FieldChangeEventHandler( _

ByVal sender As Object, _

ByVal e As FieldChangeEventArgs _

)

[C#]

public delegate void FieldChangeEventHandler(

object sender,

FieldChangeEventArgs e

);

[Delphi]

type FieldChangeEventHandler = procedure (

sender: Object;

e: FieldChangeEventArgs

) of object;

Parameters

sender

The source of the event.

e

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


FillEventArgs Class

FillEventArgs Class

Provides data for the C1.Data.C1DataSet.BeforeFill and C1.Data.C1DataSet.AfterFill events.

For a list of all members of this type, see FillEventArgs Members.

System.Object

System.EventArgs

C1.Data.FillEventArgs

[Visual Basic]

Public Class FillEventArgs

Inherits EventArgs

[C#]

public class FillEventArgs : EventArgs

[Delphi]

type FillEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FillEventArgs Members

FillEventArgs Members

FillEventArgs overview

Public Properties

DataSet | The data set where the event has occurred.
Filter | Filter conditions used to fill the data set.
TableViewNames | Used to detect which table views are being filled in the C1.Data.C1DataSet.AfterFill event.


FillEventArgs Properties

FillEventArgs Properties

The properties of the FillEventArgs class are listed here. For a complete list of FillEventArgs class members, see the FillEventArgs Members topic.

Public Properties

DataSet | The data set where the event has occurred.
Filter | Filter conditions used to fill the data set.
TableViewNames | Used to detect which table views are being filled in the C1.Data.C1DataSet.AfterFill event.


FillEventArgs.DataSet Property

FillEventArgs.DataSet Property

The data set where the event has occurred.

[Visual Basic]

Public ReadOnly Property DataSet As C1DataSet

[C#]

public C1DataSet DataSet {get;}

[Delphi]

public property DataSet: C1DataSet read get_DataSet;


FillEventArgs.Filter Property

FillEventArgs.Filter Property

Filter conditions used to fill the data set.

[Visual Basic]

Public ReadOnly Property Filter As FilterConditions

[C#]

public FilterConditions Filter {get;}

[Delphi]

public property Filter: FilterConditions read get_Filter;


FillEventArgs.TableViewNames Property

FillEventArgs.TableViewNames Property

Used to detect which table views are being filled in the C1.Data.C1DataSet.AfterFill event.

[Visual Basic]

Public ReadOnly Property TableViewNames As String()

[C#]

public string[] TableViewNames {get;}

[Delphi]

public property TableViewNames: array of String read get_TableViewNames;


FillEventHandler Delegate

FillEventHandler Delegate

Represents the method that handles the C1.Data.C1DataSet.BeforeFill and C1.Data.C1DataSet.AfterFill events.

[Visual Basic]

Public Delegate Sub FillEventHandler( _

ByVal sender As Object, _

ByVal e As FillEventArgs _

)

[C#]

public delegate void FillEventHandler(

object sender,

FillEventArgs e

);

[Delphi]

type FillEventHandler = procedure (

sender: Object;

e: FillEventArgs

) of object;

Parameters

sender

The source of the event.

e

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


FilterCondition Class

FilterCondition Class

Specifies a restriction on fetched rows when a table view is filled with data.

For a list of all members of this type, see FilterCondition Members.

System.Object

C1.Data.FilterCondition

[Visual Basic]

Public Class FilterCondition

Implements ISerializable

[C#]

public class FilterCondition : ISerializable

[Delphi]

type FilterCondition = class (TObject, ISerializable);

Remarks

A filter condition specifies a restriction on fetched rows when a table view is filled with data, see Fill. For table views based on bound and SQL-based tables, a filter condition has SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition ( IsCustom = True) which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event. For table views based on unbound tables, filter conditions are arbitrary strings that can be used by C1.Data.C1DataSet.BeforeFill event code implementing the fetch. See Bound, SQL-Based and Unbound Tables for details.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FilterCondition Members

FilterCondition Members

FilterCondition overview

Public Constructors

FilterCondition Constructor

Initializes a new instance of the FilterCondition class.

Public Properties

ConditionText | Gets or sets the text of the condition.
FillSort | Gets or sets the sort field or fields, and sort order for filling a table view with data.
IsCustom | Gets value indicating whether it is a custom condition.
TableView | Gets the table view ( TableView) to which the filter condition belongs.


FilterCondition Constructor

FilterCondition Constructor

Overload List

Initializes a new instance of the FilterCondition class.

[Visual Basic] Public Function New()

[C#] public FilterCondition();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the FilterCondition class.

[Visual Basic] Public Function New(TableView, String)

[C#] public FilterCondition(TableView, string);

[Delphi] public constructor Create(TableView; String); overload;

Initializes a new instance of the FilterCondition class.

[Visual Basic] Public Function New(C1DataSet, String, String)

[C#] public FilterCondition(C1DataSet, string, string);

[Delphi] public constructor Create(C1DataSet; String; String); overload;

Initializes a new instance of the FilterCondition class.

[Visual Basic] Public Function New(TableView, String, Boolean)

[C#] public FilterCondition(TableView, string, bool);

[Delphi] public constructor Create(TableView; String; Boolean); overload;

Initializes a new instance of the FilterCondition class.

[Visual Basic] Public Function New(C1DataSet, String, String, Boolean)

[C#] public FilterCondition(C1DataSet, string, string, bool);

[Delphi] public constructor Create(C1DataSet; String; String; Boolean); overload;


FilterCondition Constructor ()

FilterCondition Constructor ()

Initializes a new instance of the FilterCondition class.

[Visual Basic]

Public Function New()

[C#]

public FilterCondition()

[Delphi]

public constructor Create(); overload;


FilterCondition Constructor (TableView, String)

FilterCondition Constructor (TableView, String)

Initializes a new instance of the FilterCondition class.

[Visual Basic]

Public Function New( _

ByVal tableView As TableView, _

ByVal conditionText As String _

)

[C#]

public FilterCondition(

TableView tableView,

string conditionText

);

[Delphi]

public constructor Create(

tableView: TableView;

conditionText: String

); overload;

Parameters

tableView

The table view to which the conditions belongs.

conditionText

The text of the condition


FilterCondition Constructor (C1DataSet, String, String)

FilterCondition Constructor (C1DataSet, String, String)

Initializes a new instance of the FilterCondition class.

[Visual Basic]

Public Function New( _

ByVal dataSet As C1DataSet, _

ByVal tableViewName As String, _

ByVal conditionText As String _

)

[C#]

public FilterCondition(

C1DataSet dataSet,

string tableViewName,

string conditionText

);

[Delphi]

public constructor Create(

dataSet: C1DataSet;

tableViewName: String;

conditionText: String

); overload;

Parameters

dataSet

Data set to which the condition applies. This parameter can be null,

which means the data set will be determined later, when the filter condition is used in

Fill call.

tableViewName

The name of the table view to which the conditions applies.

conditionText

The text of the condition.


FilterCondition Constructor (TableView, String, Boolean)

FilterCondition Constructor (TableView, String, Boolean)

Initializes a new instance of the FilterCondition class.

[Visual Basic]

Public Function New( _

ByVal tableView As TableView, _

ByVal conditionText As String, _

ByVal isCustom As Boolean _

)

[C#]

public FilterCondition(

TableView tableView,

string conditionText,

bool isCustom

);

[Delphi]

public constructor Create(

tableView: TableView;

conditionText: String;

isCustom: Boolean

); overload;

Parameters

tableView

The table view to which the conditions belongs.

conditionText

The text of the condition

isCustom

A value indicating whether the condition is custom.

If this parameter is set to True, the condition is ignored in SQL generation,

does not generate an SQL condition, can be used in the C1.Data.C1DataSet.BeforeFill event.


FilterCondition Constructor (C1DataSet, String, String, Boolean)

FilterCondition Constructor (C1DataSet, String, String, Boolean)

Initializes a new instance of the FilterCondition class.

[Visual Basic]

Public Function New( _

ByVal dataSet As C1DataSet, _

ByVal tableViewName As String, _

ByVal conditionText As String, _

ByVal isCustom As Boolean _

)

[C#]

public FilterCondition(

C1DataSet dataSet,

string tableViewName,

string conditionText,

bool isCustom

);

[Delphi]

public constructor Create(

dataSet: C1DataSet;

tableViewName: String;

conditionText: String;

isCustom: Boolean

); overload;

Parameters

dataSet

Data set to which the condition applies. This parameter can be null,

which means the data set will be determined later, when the filter condition is used in

Fill call.

tableViewName

The name of the table view to which the conditions applies.

conditionText

The text of the condition.

isCustom

A value indicating whether the condition is custom. If this parameter

is set to True, the condition is ignored in SQL generation, does not generate an SQL condition,

can be used in the C1.Data.C1DataSet.BeforeFill event.


FilterCondition Properties

FilterCondition Properties

The properties of the FilterCondition class are listed here. For a complete list of FilterCondition class members, see the FilterCondition Members topic.

Public Properties

ConditionText | Gets or sets the text of the condition.
FillSort | Gets or sets the sort field or fields, and sort order for filling a table view with data.
IsCustom | Gets value indicating whether it is a custom condition.
TableView | Gets the table view ( TableView) to which the filter condition belongs.


FilterCondition.ConditionText Property

FilterCondition.ConditionText Property

Gets or sets the text of the condition.

[Visual Basic]

Public Property ConditionText As String

[C#]

public string ConditionText {get;set;}

[Delphi]

public property ConditionText: String read get_ConditionText write set_ConditionText;

Remarks

Filter conditions have SQL WHERE syntax with bracketed table view field names as variables (example: [CustomerID] = ‘ALFKI’), except for a custom filter condition (IsCustom = True), which can be an arbitrary string for use in C1.Data.C1DataSet.BeforeFill event.


FilterCondition.FillSort Property

FilterCondition.FillSort Property

Gets or sets the sort field or fields, and sort order for filling a table view with data.

[Visual Basic]

Public Property FillSort As String

[C#]

public string FillSort {get;set;}

[Delphi]

public property FillSort: String read get_FillSort write set_FillSort;

Remarks

By default, fetched data is sorted according to the TableView property, or by primary key if TableView is empty. This default order can be overridden at run time, when calling Fill by specifying the required sort order in one of the filter conditions passed to the Fill method as a parameter. Set this property to the sort field name(s). To specify sort order (ascending/descending), add "ASC" (ascending) or "DESC" (descending) after the field name. If no order is specified, the order is "ASC" (ascending). Multiple field names are separated with commas. Example: "CustomerID DESC, OrderID".

Fill sort can be set for any filter condition filtering the given table view, or a special filter condition can be created for this purpose (if there are no filtering conditions for this table view), with IsCustom = True and empty ConditionText.

Note that in virtual mode (TableView property set to a mode other than Static) FillSort, both in filter conditions and in TableView class, must form a unique key. If it does not represent a unique key, a run time exception will occur when two different row with equal key values are fetched in virtual mode. You can always ensure uniqueness of a sort order by adding primary key fields in the end.


FilterCondition.IsCustom Property

FilterCondition.IsCustom Property

Gets value indicating whether it is a custom condition.

[Visual Basic]

Public Property IsCustom As Boolean

[C#]

public bool IsCustom {get;set;}

[Delphi]

public property IsCustom: Boolean read get_IsCustom write set_IsCustom;

Remarks

A custom filter condition is an arbitrary string. Custom filter conditions are ignored in SQL generation, do not generate SQL conditions. They are intended for use in C1.Data.C1DataSet.BeforeFill in cases where it is needed to pass custom information to that event.


FilterCondition.TableView Property

FilterCondition.TableView Property

Gets the table view ( TableView) to which the filter condition belongs.

[Visual Basic]

Public ReadOnly Property TableView As TableView

[C#]

public TableView TableView {get;}

[Delphi]

public property TableView: TableView read get_TableView;

Remarks

Each filter condition represents a restriction on one of the data set table views.


FilterConditions Class

FilterConditions Class

Represents a collection of FilterCondition objects.

For a list of all members of this type, see FilterConditions Members.

System.Object

System.Collections.CollectionBase

C1.Data.FilterConditions

[Visual Basic]

Public Class FilterConditions

Inherits CollectionBase

[C#]

public class FilterConditions : CollectionBase

[Delphi]

type FilterConditions = class (CollectionBase);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


FilterConditions Members

FilterConditions Members

FilterConditions overview

Public Properties

Item

Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


FilterConditions Properties

FilterConditions Properties

The properties of the FilterConditions class are listed here. For a complete list of FilterConditions class members, see the FilterConditions Members topic.

Public Properties

Item

Gets the element of the collection at the specified index.


FilterConditions.Item Property

FilterConditions.Item Property

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As FilterCondition

[C#]

public FilterCondition this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: FilterCondition read get_Item;


FilterConditions Methods

FilterConditions Methods

The methods of the FilterConditions class are listed here. For a complete list of FilterConditions class members, see the FilterConditions Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


FilterConditions.Add Method

FilterConditions.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As FilterCondition _

)

[C#]

public void Add(

FilterCondition obj

);

[Delphi]

public procedure Add(

obj: FilterCondition

);

Parameters

obj

The object to be added to the end of the collection.


FilterConditions.Contains Method

FilterConditions.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal obj As FilterCondition _

) As Boolean

[C#]

public bool Contains(

FilterCondition obj

);

[Delphi]

public function Contains(

obj: FilterCondition

): Boolean;

Parameters

obj

The Object to locate in the collection.

Return Value


FilterConditions.CopyTo Method

FilterConditions.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As FilterCondition(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

FilterCondition[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of FilterCondition;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


FilterConditions.IndexOf Method

FilterConditions.IndexOf Method

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal obj As FilterCondition _

) As Integer

[C#]

public int IndexOf(

FilterCondition obj

);

[Delphi]

public function IndexOf(

obj: FilterCondition

): Int32;

Parameters

obj

The Object to locate in the collection.

Return Value


FilterConditions.Insert Method

FilterConditions.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As FilterCondition _

)

[C#]

public void Insert(

int index,

FilterCondition obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: FilterCondition

);

Parameters

index

The zero-based index at which object should be inserted.

obj

The object to insert.


FilterConditions.Remove Method

FilterConditions.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal obj As FilterCondition _

)

[C#]

public void Remove(

FilterCondition obj

);

[Delphi]

public procedure Remove(

obj: FilterCondition

);

Parameters

obj

The object to remove from the collection.


GenerateSqlEventArgs Class

GenerateSqlEventArgs Class

Provides data for the C1.Data.C1DataSetLogic.BeforeGenerateSql and C1.Data.C1DataSetLogic.AfterGenerateSql events.

For a list of all members of this type, see GenerateSqlEventArgs Members.

System.Object

System.EventArgs

C1.Data.GenerateSqlEventArgs

C1.Data.Express.ExpressGenerateSqlEventArgs

[Visual Basic]

Public Class GenerateSqlEventArgs

Inherits EventArgs

[C#]

public class GenerateSqlEventArgs : EventArgs

[Delphi]

type GenerateSqlEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


GenerateSqlEventArgs Members

GenerateSqlEventArgs Members

GenerateSqlEventArgs overview

Public Properties

ClauseFrom | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseOrderBy | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseSelect | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseWhere | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
Command | The IDbCommand object containing the generated SQL SELECT statement.
Filter | Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.
Sql | SQL statement. The programmer can set this argument in the event code to set or modify the SQL SELECT statement used for fetching data. Alternatively, the programmer can set or modify the Command argument to specify the complete command to be executed.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
TableView | The table view populated with the SQL SELECT statement.


GenerateSqlEventArgs Properties

GenerateSqlEventArgs Properties

The properties of the GenerateSqlEventArgs class are listed here. For a complete list of GenerateSqlEventArgs class members, see the GenerateSqlEventArgs Members topic.

Public Properties

ClauseFrom | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseOrderBy | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseSelect | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseWhere | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
Command | The IDbCommand object containing the generated SQL SELECT statement.
Filter | Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.
Sql | SQL statement. The programmer can set this argument in the event code to set or modify the SQL SELECT statement used for fetching data. Alternatively, the programmer can set or modify the Command argument to specify the complete command to be executed.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
TableView | The table view populated with the SQL SELECT statement.


GenerateSqlEventArgs.ClauseFrom Property

GenerateSqlEventArgs.ClauseFrom Property

ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.

[Visual Basic]

Public ReadOnly Property ClauseFrom As String

[C#]

public string ClauseFrom {get;}

[Delphi]

public property ClauseFrom: String read get_ClauseFrom;


GenerateSqlEventArgs.ClauseOrderBy Property

GenerateSqlEventArgs.ClauseOrderBy Property

ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.

[Visual Basic]

Public ReadOnly Property ClauseOrderBy As String

[C#]

public string ClauseOrderBy {get;}

[Delphi]

public property ClauseOrderBy: String read get_ClauseOrderBy;


GenerateSqlEventArgs.ClauseSelect Property

GenerateSqlEventArgs.ClauseSelect Property

ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.

[Visual Basic]

Public ReadOnly Property ClauseSelect As String

[C#]

public string ClauseSelect {get;}

[Delphi]

public property ClauseSelect: String read get_ClauseSelect;


GenerateSqlEventArgs.ClauseWhere Property

GenerateSqlEventArgs.ClauseWhere Property

ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.

[Visual Basic]

Public ReadOnly Property ClauseWhere As String

[C#]

public string ClauseWhere {get;}

[Delphi]

public property ClauseWhere: String read get_ClauseWhere;


GenerateSqlEventArgs.Command Property

GenerateSqlEventArgs.Command Property

The IDbCommand object containing the generated SQL SELECT statement.

[Visual Basic]

Public Property Command As Object

[C#]

public object Command {get;set;}

[Delphi]

public property Command: Object read get_Command write set_Command;


GenerateSqlEventArgs.Filter Property

GenerateSqlEventArgs.Filter Property

Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.

[Visual Basic]

Public ReadOnly Property Filter As FilterConditions

[C#]

public FilterConditions Filter {get;}

[Delphi]

public property Filter: FilterConditions read get_Filter;


GenerateSqlEventArgs.Sql Property

GenerateSqlEventArgs.Sql Property

SQL statement. The programmer can set this argument in the event code to set or modify the SQL SELECT statement used for fetching data. Alternatively, the programmer can set or modify the Command argument to specify the complete command to be executed.

[Visual Basic]

Public Property Sql As String

[C#]

public string Sql {get;set;}

[Delphi]

public property Sql: String read get_Sql write set_Sql;


GenerateSqlEventArgs.Status Property

GenerateSqlEventArgs.Status Property

Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.

[Visual Basic]

Public Property Status As DataSetEventStatusEnum

[C#]

public DataSetEventStatusEnum Status {get;set;}

[Delphi]

public property Status: DataSetEventStatusEnum read get_Status write set_Status;


GenerateSqlEventArgs.TableView Property

GenerateSqlEventArgs.TableView Property

The table view populated with the SQL SELECT statement.

[Visual Basic]

Overridable Public ReadOnly Property TableView As TableView

[C#]

virtual public TableView TableView {get;}

[Delphi]

public property TableView: TableView read get_TableView;


GenerateSqlEventHandler Delegate

GenerateSqlEventHandler Delegate

Represents the method that handles the C1.Data.C1DataSetLogic.AfterGenerateSql and C1.Data.C1DataSetLogic.BeforeGenerateSql events.

[Visual Basic]

Public Delegate Sub GenerateSqlEventHandler( _

ByVal sender As Object, _

ByVal e As GenerateSqlEventArgs _

)

[C#]

public delegate void GenerateSqlEventHandler(

object sender,

GenerateSqlEventArgs e

);

[Delphi]

type GenerateSqlEventHandler = procedure (

sender: Object;

e: GenerateSqlEventArgs

) of object;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


GetListEventArgs Class

GetListEventArgs Class

Provides data for the C1.Data.C1DataSetLogic.GetChildRows, C1.Data.C1DataSetLogic.GetParentRow and C1.Data.C1DataView.GetRows events.

For a list of all members of this type, see GetListEventArgs Members.

System.Object

System.EventArgs

C1.Data.GetListEventArgs

[Visual Basic]

Public Class GetListEventArgs

Inherits EventArgs

[C#]

public class GetListEventArgs : EventArgs

[Delphi]

type GetListEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


GetListEventArgs Members

GetListEventArgs Members

GetListEventArgs overview

Public Properties

List | This argument contains the list of rows. In events returning a list, create a new ArrayList object, fill it with rows and assign to the List argument. In events returning a single row (for example, GetParentRow:C1DataSetLogic event), add a single row to the list.
RelationName | The name of the relation (in GetRows:C1DataView event, empty if the view is not a child view).
Row | The row on which to base the list. In GetParentRow:C1DataSetLogic event, the parent row of the view, if it is a child view. In GetChildRows:C1DataSetLogic event, the parent row for which to return child rows.


GetListEventArgs Properties

GetListEventArgs Properties

The properties of the GetListEventArgs class are listed here. For a complete list of GetListEventArgs class members, see the GetListEventArgs Members topic.

Public Properties

List | This argument contains the list of rows. In events returning a list, create a new ArrayList object, fill it with rows and assign to the List argument. In events returning a single row (for example, GetParentRow:C1DataSetLogic event), add a single row to the list.
RelationName | The name of the relation (in GetRows:C1DataView event, empty if the view is not a child view).
Row | The row on which to base the list. In GetParentRow:C1DataSetLogic event, the parent row of the view, if it is a child view. In GetChildRows:C1DataSetLogic event, the parent row for which to return child rows.


GetListEventArgs.List Property

GetListEventArgs.List Property

This argument contains the list of rows. In events returning a list, create a new ArrayList object, fill it with rows and assign to the List argument. In events returning a single row (for example, GetParentRow:C1DataSetLogic event), add a single row to the list.

[Visual Basic]

Public Property List As ArrayList

[C#]

public ArrayList List {get;set;}

[Delphi]

public property List: ArrayList read get_List write set_List;


GetListEventArgs.RelationName Property

GetListEventArgs.RelationName Property

The name of the relation (in GetRows:C1DataView event, empty if the view is not a child view).

[Visual Basic]

Public ReadOnly Property RelationName As String

[C#]

public string RelationName {get;}

[Delphi]

public property RelationName: String read get_RelationName;


GetListEventArgs.Row Property

GetListEventArgs.Row Property

The row on which to base the list. In GetParentRow:C1DataSetLogic event, the parent row of the view, if it is a child view. In GetChildRows:C1DataSetLogic event, the parent row for which to return child rows.

[Visual Basic]

Public ReadOnly Property Row As C1DataRow

[C#]

public C1DataRow Row {get;}

[Delphi]

public property Row: C1DataRow read get_Row;


GetListEventHandler Delegate

GetListEventHandler Delegate

Represents the method that handles the C1.Data.C1DataSetLogic.GetChildRows, C1.Data.C1DataSetLogic.GetParentRow and C1.Data.C1DataView.GetRows events.

[Visual Basic]

Public Delegate Sub GetListEventHandler( _

ByVal sender As Object, _

ByVal e As GetListEventArgs _

)

[C#]

public delegate void GetListEventHandler(

object sender,

GetListEventArgs e

);

[Delphi]

type GetListEventHandler = procedure (

sender: Object;

e: GetListEventArgs

) of object;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


InvalidDataOperationException Class

InvalidDataOperationException Class

Represents an exception that is thrown on attempt to perform an operation that cannot be performed.

For a list of all members of this type, see InvalidDataOperationException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.InvalidDataOperationException

[Visual Basic]

Public Class InvalidDataOperationException

Inherits C1DataException

[C#]

public class InvalidDataOperationException : C1DataException

[Delphi]

type InvalidDataOperationException = class (C1DataException);

Remarks

Represents an exception that is thrown on attempt to perform an operation that, although not explicitly disabled by property settings, cannot be performed on the specified object in its current state with specified arguments.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


InvalidDataOperationException Members

InvalidDataOperationException Members

InvalidDataOperationException overview

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


InvalidDataOperationException Properties

InvalidDataOperationException Properties

The properties of the InvalidDataOperationException class are listed here. For a complete list of InvalidDataOperationException class members, see the InvalidDataOperationException Members topic.

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


ListChangedFlags Enumeration

ListChangedFlags Enumeration

Specifies how a command string is interpreted.

[Visual Basic]

Public Enum ListChangedFlags

[C#]

public enum ListChangedFlags

[Delphi]

type ListChangedFlags = (AdoNet, None, NotifyAddNewTwice, NotifyEndEdit, SuppressInEditMode);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Remarks

These flags, used in NotificationModeFlags property, affect the way change notifications are sent to data bound controls. If none of the flags is set (the default), C1DataObjects uses its regular notification scheme.

Members

Member name | Description
AdoNet | SuppressInEditMode | NotifyEndEdit | NotifyAddNewTwice
None | C1DataObjects uses its regular notification scheme.
NotifyAddNewTwice | For a newly added row, second ListChanged event with ListChangedType = ItemAdded is called on EndEdit (when the row leaves the "detached" state). The first ListChanged event with ItemAdded is always fired on AddNew:C1DataTable, when the row is created in the "detached" state.
NotifyEndEdit | ListChanged event with ListChangedType = ItemChanged is fired on EndEdit if some fields were changed while the row was in edit mode.
SuppressInEditMode | ListChanged event with ListChangedType = ItemChanged is not fired when a field is set in edit mode (between BeginEdit and EndEdit).

See Also

C1.Data Namespace


OperationEnum Enumeration

OperationEnum Enumeration

Specified an operation performed over data or data components.

[Visual Basic]

Public Enum OperationEnum

[C#]

public enum OperationEnum

[Delphi]

type OperationEnum = (AddNew, Delete, Fill, Initialization, Modify, None, Update);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
AddNew | Adding new row.
Delete | Deleting a row.
Fill | Filling a component with data.
Initialization | Initializing a component.
Modify | Modifying a row.
None | No operation.
Update | Updating the database.

See Also

C1.Data Namespace


OperationFailureException Class

OperationFailureException Class

Represents an exception that is thrown when an operation, such as updating the database, fails.

For a list of all members of this type, see OperationFailureException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.OperationFailureException

[Visual Basic]

Public Class OperationFailureException

Inherits C1DataException

[C#]

public class OperationFailureException : C1DataException

[Delphi]

type OperationFailureException = class (C1DataException);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


OperationFailureException Members

OperationFailureException Members

OperationFailureException overview

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
Operation | Gets the attempted operation.
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


OperationFailureException Properties

OperationFailureException Properties

The properties of the OperationFailureException class are listed here. For a complete list of OperationFailureException class members, see the OperationFailureException Members topic.

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
Operation | Gets the attempted operation.
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


OperationFailureException.Operation Property

OperationFailureException.Operation Property

Gets the attempted operation.

[Visual Basic]

Public ReadOnly Property Operation As OperationEnum

[C#]

public OperationEnum Operation {get;}

[Delphi]

public property Operation: OperationEnum read get_Operation;


PositionChangeEventArgs Class

PositionChangeEventArgs Class

Provides data for PositionChanged event in C1DataTableSource, C1DataView, C1DataSet and C1DataExpress components.

For a list of all members of this type, see PositionChangeEventArgs Members.

System.Object

System.EventArgs

C1.Data.PositionChangeEventArgs

[Visual Basic]

Public Class PositionChangeEventArgs

Inherits EventArgs

[C#]

public class PositionChangeEventArgs : EventArgs

[Delphi]

type PositionChangeEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


PositionChangeEventArgs Members

PositionChangeEventArgs Members

PositionChangeEventArgs overview

Public Properties

CurrencyManager | The CurrencyManager object managing current row position for the data member.
DataMember | DataMember string identifying the member (node in master-detail hierarchy) that has changed current row position.
NewPosition | Current row after position change.
OldPosition | Current row before position change.
Row | The row object that has become current.


PositionChangeEventArgs Properties

PositionChangeEventArgs Properties

The properties of the PositionChangeEventArgs class are listed here. For a complete list of PositionChangeEventArgs class members, see the PositionChangeEventArgs Members topic.

Public Properties

CurrencyManager | The CurrencyManager object managing current row position for the data member.
DataMember | DataMember string identifying the member (node in master-detail hierarchy) that has changed current row position.
NewPosition | Current row after position change.
OldPosition | Current row before position change.
Row | The row object that has become current.


PositionChangeEventArgs.CurrencyManager Property

PositionChangeEventArgs.CurrencyManager Property

The CurrencyManager object managing current row position for the data member.

[Visual Basic]

Public ReadOnly Property CurrencyManager As CurrencyManager

[C#]

public CurrencyManager CurrencyManager {get;}

[Delphi]

public property CurrencyManager: CurrencyManager read get_CurrencyManager;


PositionChangeEventArgs.DataMember Property

PositionChangeEventArgs.DataMember Property

DataMember string identifying the member (node in master-detail hierarchy) that has changed current row position.

[Visual Basic]

Public ReadOnly Property DataMember As String

[C#]

public string DataMember {get;}

[Delphi]

public property DataMember: String read get_DataMember;


PositionChangeEventArgs.NewPosition Property

PositionChangeEventArgs.NewPosition Property

Current row after position change.

[Visual Basic]

Public ReadOnly Property NewPosition As Integer

[C#]

public int NewPosition {get;}

[Delphi]

public property NewPosition: Int32 read get_NewPosition;


PositionChangeEventArgs.OldPosition Property

PositionChangeEventArgs.OldPosition Property

Current row before position change.

[Visual Basic]

Public ReadOnly Property OldPosition As Integer

[C#]

public int OldPosition {get;}

[Delphi]

public property OldPosition: Int32 read get_OldPosition;


PositionChangeEventArgs.Row Property

PositionChangeEventArgs.Row Property

The row object that has become current.

[Visual Basic]

Public ReadOnly Property Row As C1DataRow

[C#]

public C1DataRow Row {get;}

[Delphi]

public property Row: C1DataRow read get_Row;


PositionChangeEventHandler Delegate

PositionChangeEventHandler Delegate

Represents the method that handles the PositionChanged event in C1DataTableSource, C1DataView, C1DataSet and C1DataExpress components.

[Visual Basic]

Public Delegate Sub PositionChangeEventHandler( _

ByVal sender As Object, _

ByVal e As PositionChangeEventArgs _

)

[C#]

public delegate void PositionChangeEventHandler(

object sender,

PositionChangeEventArgs e

);

[Delphi]

type PositionChangeEventHandler = procedure (

sender: Object;

e: PositionChangeEventArgs

) of object;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


PropertyCollection Class

PropertyCollection Class

Represents a collection of properties that can be added to C1DataSet, C1DataTable, or TableField.

For a list of all members of this type, see PropertyCollection Members.

System.Object

System.Collections.Hashtable

System.Data.PropertyCollection

C1.Data.PropertyCollection

[Visual Basic]

Public Class PropertyCollection

Inherits PropertyCollection

Implements ISerializable

[C#]

public class PropertyCollection : PropertyCollection , ISerializable

[Delphi]

type PropertyCollection = class (PropertyCollection, ISerializable);

Remarks

This class does not add any new properties or methods to the System.Data.PropertyCollection class.

The only difference with the base class is that C1.Data.PropertyCollection is marked with [Serializable] attribute and implements the ISerializable interface, so it can be passed as a parameter and returned from a method executed remotely in a different process or on a different computer.

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


PropertyCollection Members

PropertyCollection Members

PropertyCollection overview

Public Constructors

PropertyCollection Constructor

Initializes a new instance of the PropertyCollection class.


PropertyCollection Constructor

PropertyCollection Constructor

Initializes a new instance of the PropertyCollection class.

[Visual Basic]

Public Function New()

[C#]

public PropertyCollection()

[Delphi]

public constructor Create(); overload;


RemoteDataService Class

RemoteDataService Class

A RemoteDataService-derived class is included in every data library. It is used to support automatic remoting in methods C1DataSet.Fill/Update. Calling C1DataSet.Fill/Update on the client automatically calls RemoteDataService.Fill/Update on the server. RemoteDataService.Fill/Update are virtual methods that can be overridden to customize Fill/Update behavior. Also, new "business" methods can be added to the RemoteDataService-derived class, see Business Methods.

For a list of all members of this type, see RemoteDataService Members.

System.Object

System.MarshalByRefObject

C1.Data.RemoteDataService

[Visual Basic]

Public Class RemoteDataService

Inherits MarshalByRefObject

[C#]

public class RemoteDataService : MarshalByRefObject

[Delphi]

type RemoteDataService = class (MarshalByRefObject);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


RemoteDataService Members

RemoteDataService Members

RemoteDataService overview

Public Methods

Fill | Called on the server when C1DataSet.Fill is called on the client.
Update | Called on the server when C1DataSet.Update is called on the client.


RemoteDataService Methods

RemoteDataService Methods

The methods of the RemoteDataService class are listed here. For a complete list of RemoteDataService class members, see the RemoteDataService Members topic.

Public Methods

Fill | Called on the server when C1DataSet.Fill is called on the client.
Update | Called on the server when C1DataSet.Update is called on the client.


RemoteDataService.Fill Method

RemoteDataService.Fill Method

Called on the server when C1DataSet.Fill is called on the client.

[Visual Basic]

Overridable Public Sub Fill( _

ByVal dataSet As C1DataSet, _

ByVal filterConditions As FilterConditions, _

ByVal tableViewNames As String(), _

ByVal dynamicConnections As ConnectionCollection, _

ByVal beginTransaction As Boolean _

)

[C#]

virtual public void Fill(

C1DataSet dataSet,

FilterConditions filterConditions,

string[] tableViewNames,

ConnectionCollection dynamicConnections,

bool beginTransaction

);

[Delphi]

public procedure Fill(

dataSet: C1DataSet;

filterConditions: FilterConditions;

tableViewNames: array of String;

dynamicConnections: ConnectionCollection;

beginTransaction: Boolean

); virtual;

Parameters

dataSet

Data set to be filled with data. This data set is initially empty.

After this data set is filled, its data is passed to the client to the data set for which

Fill was called.

filterConditions

Filter conditions used in Fill call.

tableViewNames

dynamicConnections

Connection object substitutes defined in

DynamicConnections property.

beginTransaction

This parameter is set to False by default. It means

C1DataObjects does not use transactions in fetching data. To make it perform fetch

in a transaction, override this method and set this parameter to True.


RemoteDataService.Update Method

RemoteDataService.Update Method

Called on the server when C1DataSet.Update is called on the client.

[Visual Basic]

Overridable Public Sub Update( _

ByVal dataSet As C1DataSet, _

ByVal dynamicConnections As ConnectionCollection, _

ByVal beginTransaction As Boolean _

)

[C#]

virtual public void Update(

C1DataSet dataSet,

ConnectionCollection dynamicConnections,

bool beginTransaction

);

[Delphi]

public procedure Update(

dataSet: C1DataSet;

dynamicConnections: ConnectionCollection;

beginTransaction: Boolean

); virtual;

Parameters

dataSet

Data set containing simple table rows. Only rows with C1DataRow.RowState

equal to Added, Deleted or Modified need to be updated to the database. After database update,

simple table rows in this data set are passed back to the client to refresh the data set

for which C1DataSet.Update was called.

dynamicConnections

Connection object substitutes defined in

DynamicConnections property.

beginTransaction

This parameter is set to True by default. It means

C1DataObjects performs Update inside a database transaction. To make it perform Update

without using a database transaction, override this method and set this parameter to False.

This is needed to support distributed transactions, see Supporting distributed (COM+) transactions.


RowChangedTypeEnum Enumeration

RowChangedTypeEnum Enumeration

Indicates a type of change occurring in C1.Data.C1DataSet.CurrentRowChanged Event.

[Visual Basic]

Public Enum RowChangedTypeEnum

[C#]

public enum RowChangedTypeEnum

[Delphi]

type RowChangedTypeEnum = (CurrentRowChanged, FieldsChanged);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
CurrentRowChanged | Indicates that the current row has changed.
FieldsChanged | Indicates that the end user or user code modified a field.

See Also

C1.Data Namespace


RowChangeEventArgs Class

RowChangeEventArgs Class

Provides data for events which occur when an action is performed on a C1DataRow.

For a list of all members of this type, see RowChangeEventArgs Members.

System.Object

System.EventArgs

C1.Data.RowChangeEventArgs

[Visual Basic]

Public Class RowChangeEventArgs

Inherits EventArgs

[C#]

public class RowChangeEventArgs : EventArgs

[Delphi]

type RowChangeEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


RowChangeEventArgs Members

RowChangeEventArgs Members

RowChangeEventArgs overview

Public Properties

Action | The action that has occurred.
DataTable | The table object where the event has occurred.
ItemArray | For a deleted row, in C1.Data.BaseLogic.AfterDelete event, the array of field values in the row before the row was deleted. This property is not set in events other than AfterDelete. This property must be used in C1.Data.BaseLogic.AfterDelete event to access row values because they are not accessible through regular row properties after the row has been deleted.
Modified | For events C1.Data.BaseLogic.BeforeEndEdit, C1.Data.BaseLogic.AfterEndEdit, this property indicates whether the row has been modified while it was in edit mode. This property is often needed in C1.Data.BaseLogic.BeforeEndEdit/ C1.Data.BaseLogic.AfterEndEdit because data-bound controls begin edit mode when they position on a row and end edit mode when they leave the row, even if no changes have been made to the row in the process.
ParentRow | Parent row.
Row | The row where the event has occurred.


RowChangeEventArgs Properties

RowChangeEventArgs Properties

The properties of the RowChangeEventArgs class are listed here. For a complete list of RowChangeEventArgs class members, see the RowChangeEventArgs Members topic.

Public Properties

Action | The action that has occurred.
DataTable | The table object where the event has occurred.
ItemArray | For a deleted row, in C1.Data.BaseLogic.AfterDelete event, the array of field values in the row before the row was deleted. This property is not set in events other than AfterDelete. This property must be used in C1.Data.BaseLogic.AfterDelete event to access row values because they are not accessible through regular row properties after the row has been deleted.
Modified | For events C1.Data.BaseLogic.BeforeEndEdit, C1.Data.BaseLogic.AfterEndEdit, this property indicates whether the row has been modified while it was in edit mode. This property is often needed in C1.Data.BaseLogic.BeforeEndEdit/ C1.Data.BaseLogic.AfterEndEdit because data-bound controls begin edit mode when they position on a row and end edit mode when they leave the row, even if no changes have been made to the row in the process.
ParentRow | Parent row.
Row | The row where the event has occurred.


RowChangeEventArgs.Action Property

RowChangeEventArgs.Action Property

The action that has occurred.

[Visual Basic]

Public ReadOnly Property Action As DataRowActionEnum

[C#]

public DataRowActionEnum Action {get;}

[Delphi]

public property Action: DataRowActionEnum read get_Action;


RowChangeEventArgs.DataTable Property

RowChangeEventArgs.DataTable Property

The table object where the event has occurred.

[Visual Basic]

Public ReadOnly Property DataTable As C1DataTable

[C#]

public C1DataTable DataTable {get;}

[Delphi]

public property DataTable: C1DataTable read get_DataTable;


RowChangeEventArgs.ItemArray Property

RowChangeEventArgs.ItemArray Property

For a deleted row, in C1.Data.BaseLogic.AfterDelete event, the array of field values in the row before the row was deleted. This property is not set in events other than AfterDelete. This property must be used in C1.Data.BaseLogic.AfterDelete event to access row values because they are not accessible through regular row properties after the row has been deleted.

[Visual Basic]

Public ReadOnly Property ItemArray As Object()

[C#]

public object[] ItemArray {get;}

[Delphi]

public property ItemArray: array of Object read get_ItemArray;


RowChangeEventArgs.Modified Property

RowChangeEventArgs.Modified Property

For events C1.Data.BaseLogic.BeforeEndEdit, C1.Data.BaseLogic.AfterEndEdit, this property indicates whether the row has been modified while it was in edit mode. This property is often needed in C1.Data.BaseLogic.BeforeEndEdit/ C1.Data.BaseLogic.AfterEndEdit because data-bound controls begin edit mode when they position on a row and end edit mode when they leave the row, even if no changes have been made to the row in the process.

[Visual Basic]

Public ReadOnly Property Modified As Boolean

[C#]

public bool Modified {get;}

[Delphi]

public property Modified: Boolean read get_Modified;


RowChangeEventArgs.ParentRow Property

RowChangeEventArgs.ParentRow Property

Parent row.

[Visual Basic]

Public ReadOnly Property ParentRow As C1DataRow

[C#]

public C1DataRow ParentRow {get;}

[Delphi]

public property ParentRow: C1DataRow read get_ParentRow;


RowChangeEventArgs.Row Property

RowChangeEventArgs.Row Property

The row where the event has occurred.

[Visual Basic]

Public ReadOnly Property Row As C1DataRow

[C#]

public C1DataRow Row {get;}

[Delphi]

public property Row: C1DataRow read get_Row;


RowChangeEventHandler Delegate

RowChangeEventHandler Delegate

Represents the method that handles events which occur when an action is performed on a C1DataRow.

[Visual Basic]

Public Delegate Sub RowChangeEventHandler( _

ByVal sender As Object, _

ByVal e As RowChangeEventArgs _

)

[C#]

public delegate void RowChangeEventHandler(

object sender,

RowChangeEventArgs e

);

[Delphi]

type RowChangeEventHandler = procedure (

sender: Object;

e: RowChangeEventArgs

) of object;

Parameters

sender

The source of the event.

e

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


RowEventStatusEnum Enumeration

RowEventStatusEnum Enumeration

Indicates status before and after an operation on a data row, e.g., committing (updating) the row to the database.

[Visual Basic]

Public Enum RowEventStatusEnum

[C#]

public enum RowEventStatusEnum

[Delphi]

type RowEventStatusEnum = (Continue, ErrorsOccured, SkipAllRemainingRows, SkipCurrentRow);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Continue | Successful operation.
ErrorsOccured | Operation failed due to an exception (error) condition that occurred while performing the operation.
SkipAllRemainingRows | If this status value is set in event code, operation must be considered failed and aborted.
SkipCurrentRow | If this status value is set in event code, operation must be skipped and considered successful.

See Also

C1.Data Namespace


RowUpdateEventArgs Class

RowUpdateEventArgs Class

Provides data for the C1.Data.BaseLogic.BeforeUpdateRow and C1.Data.BaseLogic.AfterUpdateRow events.

For a list of all members of this type, see RowUpdateEventArgs Members.

System.Object

System.EventArgs

C1.Data.RowUpdateEventArgs

[Visual Basic]

Public Class RowUpdateEventArgs

Inherits EventArgs

[C#]

public class RowUpdateEventArgs : EventArgs

[Delphi]

type RowUpdateEventArgs = class (EventArgs);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


RowUpdateEventArgs Members

RowUpdateEventArgs Members

RowUpdateEventArgs overview

Public Properties

DeleteCommand | For a deleted row, the object representing the SQL DELETE command used to delete the row from the database.
Error | For an unsuccessful operation, information detailing the error.
InsertCommand | For an added row, the object representing the SQL INSERT command used to add the row to the database.
Row | The row that is committed to the database.
SelectCommand | For a modified and added row, the object representing the SQL SELELCT command used to refresh the row with database values after the row has been committed to the database.
SqlStatus | Success or failure status of the database access operation. For an unsuccessful operation, specifies the cause of failure.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
Tables | Returns the table collection with all data being updated to the database.
TableViews | Returns the table view collection with all data being updated to the database.
UpdateCommand | For a modified row, the object representing the SQL UPDATE command used to add the row to the database.


RowUpdateEventArgs Properties

RowUpdateEventArgs Properties

The properties of the RowUpdateEventArgs class are listed here. For a complete list of RowUpdateEventArgs class members, see the RowUpdateEventArgs Members topic.

Public Properties

DeleteCommand | For a deleted row, the object representing the SQL DELETE command used to delete the row from the database.
Error | For an unsuccessful operation, information detailing the error.
InsertCommand | For an added row, the object representing the SQL INSERT command used to add the row to the database.
Row | The row that is committed to the database.
SelectCommand | For a modified and added row, the object representing the SQL SELELCT command used to refresh the row with database values after the row has been committed to the database.
SqlStatus | Success or failure status of the database access operation. For an unsuccessful operation, specifies the cause of failure.
Status | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
Tables | Returns the table collection with all data being updated to the database.
TableViews | Returns the table view collection with all data being updated to the database.
UpdateCommand | For a modified row, the object representing the SQL UPDATE command used to add the row to the database.


RowUpdateEventArgs.DeleteCommand Property

RowUpdateEventArgs.DeleteCommand Property

For a deleted row, the object representing the SQL DELETE command used to delete the row from the database.

[Visual Basic]

Public Property DeleteCommand As Object

[C#]

public object DeleteCommand {get;set;}

[Delphi]

public property DeleteCommand: Object read get_DeleteCommand write set_DeleteCommand;


RowUpdateEventArgs.Error Property

RowUpdateEventArgs.Error Property

For an unsuccessful operation, information detailing the error.

[Visual Basic]

Public Property Error As Exception

[C#]

public Exception Error {get;set;}

[Delphi]

public property Error: Exception read get_Error write set_Error;


RowUpdateEventArgs.InsertCommand Property

RowUpdateEventArgs.InsertCommand Property

For an added row, the object representing the SQL INSERT command used to add the row to the database.

[Visual Basic]

Public Property InsertCommand As Object

[C#]

public object InsertCommand {get;set;}

[Delphi]

public property InsertCommand: Object read get_InsertCommand write set_InsertCommand;


RowUpdateEventArgs.Row Property

RowUpdateEventArgs.Row Property

The row that is committed to the database.

[Visual Basic]

Public ReadOnly Property Row As C1DataRow

[C#]

public C1DataRow Row {get;}

[Delphi]

public property Row: C1DataRow read get_Row;


RowUpdateEventArgs.SelectCommand Property

RowUpdateEventArgs.SelectCommand Property

For a modified and added row, the object representing the SQL SELELCT command used to refresh the row with database values after the row has been committed to the database.

[Visual Basic]

Public Property SelectCommand As Object

[C#]

public object SelectCommand {get;set;}

[Delphi]

public property SelectCommand: Object read get_SelectCommand write set_SelectCommand;


RowUpdateEventArgs.SqlStatus Property

RowUpdateEventArgs.SqlStatus Property

Success or failure status of the database access operation. For an unsuccessful operation, specifies the cause of failure.

[Visual Basic]

Public Property SqlStatus As SqlResultStatusEnum

[C#]

public SqlResultStatusEnum SqlStatus {get;set;}

[Delphi]

public property SqlStatus: SqlResultStatusEnum read get_SqlStatus write set_SqlStatus;


RowUpdateEventArgs.Status Property

RowUpdateEventArgs.Status Property

Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.

[Visual Basic]

Public Property Status As RowEventStatusEnum

[C#]

public RowEventStatusEnum Status {get;set;}

[Delphi]

public property Status: RowEventStatusEnum read get_Status write set_Status;


RowUpdateEventArgs.Tables Property

RowUpdateEventArgs.Tables Property

Returns the table collection with all data being updated to the database.

[Visual Basic]

Public ReadOnly Property Tables As C1DataTableCollection

[C#]

public C1DataTableCollection Tables {get;}

[Delphi]

public property Tables: C1DataTableCollection read get_Tables;


RowUpdateEventArgs.TableViews Property

RowUpdateEventArgs.TableViews Property

Returns the table view collection with all data being updated to the database.

[Visual Basic]

Public ReadOnly Property TableViews As C1DataTableCollection

[C#]

public C1DataTableCollection TableViews {get;}

[Delphi]

public property TableViews: C1DataTableCollection read get_TableViews;


RowUpdateEventArgs.UpdateCommand Property

RowUpdateEventArgs.UpdateCommand Property

For a modified row, the object representing the SQL UPDATE command used to add the row to the database.

[Visual Basic]

Public Property UpdateCommand As Object

[C#]

public object UpdateCommand {get;set;}

[Delphi]

public property UpdateCommand: Object read get_UpdateCommand write set_UpdateCommand;


RowUpdateEventHandler Delegate

RowUpdateEventHandler Delegate

Represents the method that handles the C1.Data.BaseLogic.BeforeUpdateRow and C1.Data.BaseLogic.AfterUpdateRow events.

[Visual Basic]

Public Delegate Sub RowUpdateEventHandler( _

ByVal sender As Object, _

ByVal e As RowUpdateEventArgs _

)

[C#]

public delegate void RowUpdateEventHandler(

object sender,

RowUpdateEventArgs e

);

[Delphi]

type RowUpdateEventHandler = procedure (

sender: Object;

e: RowUpdateEventArgs

) of object;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

See Also

C1.Data Namespace


RunsAtEnum Enumeration

RunsAtEnum Enumeration

Where the instance of a data library is running.

[Visual Basic]

Public Enum RunsAtEnum

[C#]

public enum RunsAtEnum

[Delphi]

type RunsAtEnum = (DirectClient, ThreeTierClient, ThreeTierServer, TwoTierClient, WebForms);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
DirectClient | Direct client: there is no data library, no server, database access is performed in the same application, C1SchemaDef and C1DataSet components belong to the same container class or form.
ThreeTierClient | Data library runs on the client in a 3-tier configuration.
ThreeTierServer | Data library runs on the server in a 3-tier configuration.
TwoTierClient | Data library runs on the client in a 2-tier configuration.
WebForms | C1SchemaDef component is used in a WebForms (ASP.NET) application.

See Also

C1.Data Namespace


SchemaBase Class

SchemaBase Class

The SchemaBase class is a common base class from which C1SchemaDef and C1SchemaRef component classes are derived.

For a list of all members of this type, see SchemaBase Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.SchemaBase

C1.Data.C1SchemaDef

C1.Data.C1SchemaRef

[Visual Basic]

MustInherit Public Class SchemaBase

Inherits BaseComponent

[C#]

public abstract class SchemaBase : BaseComponent

[Delphi]

type SchemaBase = class abstract (BaseComponent);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


SchemaBase Members

SchemaBase Members

SchemaBase overview

Public Properties

Schema

Returns or sets the Schema object. This property is overridden in C1SchemaDef and C1SchemaRef to return the C1SchemaDef component’s schema.


SchemaBase Properties

SchemaBase Properties

The properties of the SchemaBase class are listed here. For a complete list of SchemaBase class members, see the SchemaBase Members topic.

Public Properties

Schema

Returns or sets the Schema object. This property is overridden in C1SchemaDef and C1SchemaRef to return the C1SchemaDef component’s schema.


SchemaBase.Schema Property

SchemaBase.Schema Property

Returns or sets the Schema object. This property is overridden in C1SchemaDef and C1SchemaRef to return the C1SchemaDef component’s schema.

[Visual Basic]

Overridable MustInherit Public Property Schema As Schema

[C#]

virtual abstract public Schema Schema {get;set;}

[Delphi]

public property Schema: Schema read get_Schema write set_Schema;


SchemaException Class

SchemaException Class

Represents an exception that is thrown at run time when C1DataObjects encounters errors in the schema specified in a C1SchemaDef component. Most of such errors can be detected at design time performing schema verification (select Verify schema from the Schema menu in Schema Designer).

For a list of all members of this type, see SchemaException Members.

System.Object

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.SchemaException

[Visual Basic]

Public Class SchemaException

Inherits C1DataException

[C#]

public class SchemaException : C1DataException

[Delphi]

type SchemaException = class (C1DataException);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


SchemaException Members

SchemaException Members

SchemaException overview

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ObjectName | Gets the name of the schema object where the error is found.
ObjectTypeName | Gets the type name of the schema object where the error is found.
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


SchemaException Properties

SchemaException Properties

The properties of the SchemaException class are listed here. For a complete list of SchemaException class members, see the SchemaException Members topic.

Public Properties

ErrorField (inherited from C1DataException) | Gets the name of the field where the exception occurred.
ErrorRow (inherited from C1DataException) | Gets the index of the row where the exception occurred.
ErrorTable (inherited from C1DataException) | Gets the name of the table or table view where the exception occurred.
IsTable (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table (as opposed to a table view).
IsTableView (inherited from C1DataException) | Gets a value indicating whether the object where the exception occurred is a table view (as opposed to a table).
ObjectName | Gets the name of the schema object where the error is found.
ObjectTypeName | Gets the type name of the schema object where the error is found.
ShowMessage (inherited from C1DataException) | Gets or sets a value determining whether error message must be displayed by bound controls or it should be suppressed since C1DataObjects already handled the error.


SchemaException.ObjectName Property

SchemaException.ObjectName Property

Gets the name of the schema object where the error is found.

[Visual Basic]

Public ReadOnly Property ObjectName As String

[C#]

public string ObjectName {get;}

[Delphi]

public property ObjectName: String read get_ObjectName;


SchemaException.ObjectTypeName Property

SchemaException.ObjectTypeName Property

Gets the type name of the schema object where the error is found.

[Visual Basic]

Public ReadOnly Property ObjectTypeName As String

[C#]

public string ObjectTypeName {get;}

[Delphi]

public property ObjectTypeName: String read get_ObjectTypeName;


SessionCacheProperties Class

SessionCacheProperties Class

The SessionCacheProperties class is used to specify settings for session cache.

For a list of all members of this type, see SessionCacheProperties Members.

System.Object

C1.Data.SessionCacheProperties

[Visual Basic]

Public Class SessionCacheProperties

[C#]

public class SessionCacheProperties

[Delphi]

type SessionCacheProperties = class;

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


SessionCacheProperties Members

SessionCacheProperties Members

SessionCacheProperties overview

Public Properties

Compressed | Gets or sets a value indicating whether the data in cache should be compressed.
DefaultStorage | Gets or sets the cache storage used by default in session cache methods.
StoragePath | Get or sets the path to cache temporary files.


SessionCacheProperties Properties

SessionCacheProperties Properties

The properties of the SessionCacheProperties class are listed here. For a complete list of SessionCacheProperties class members, see the SessionCacheProperties Members topic.

Public Properties

Compressed | Gets or sets a value indicating whether the data in cache should be compressed.
DefaultStorage | Gets or sets the cache storage used by default in session cache methods.
StoragePath | Get or sets the path to cache temporary files.


SessionCacheProperties.Compressed Property

SessionCacheProperties.Compressed Property

Gets or sets a value indicating whether the data in cache should be compressed.

[Visual Basic]

Public Property Compressed As Boolean

[C#]

public bool Compressed {get;set;}

[Delphi]

public property Compressed: Boolean read get_Compressed write set_Compressed;


SessionCacheProperties.DefaultStorage Property

SessionCacheProperties.DefaultStorage Property

Gets or sets the cache storage used by default in session cache methods.

[Visual Basic]

Public Property DefaultStorage As CacheStorageEnum

[C#]

public CacheStorageEnum DefaultStorage {get;set;}

[Delphi]

public property DefaultStorage: CacheStorageEnum read get_DefaultStorage write set_DefaultStorage;


SessionCacheProperties.StoragePath Property

SessionCacheProperties.StoragePath Property

Get or sets the path to cache temporary files.

[Visual Basic]

Public Property StoragePath As String

[C#]

public string StoragePath {get;set;}

[Delphi]

public property StoragePath: String read get_StoragePath write set_StoragePath;


SqlResultStatusEnum Enumeration

SqlResultStatusEnum Enumeration

This enumeration specifies success or failure of a database access operation, including specific reasons of operation failure.

[Visual Basic]

Public Enum SqlResultStatusEnum

[C#]

public enum SqlResultStatusEnum

[Delphi]

type SqlResultStatusEnum = (ConcurrencyConflict, DeleteFailed, InsertFailed, SelectFailed, Succeeded, UpdateFailed);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
ConcurrencyConflict | Operation failed due to concurrency conflict, that is, the target row could not be found in the database, presumably because another user has modified it.
DeleteFailed | Operation failed due to an error executing SQL DELETE command.
InsertFailed | Operation failed due to an error executing SQL INSERT command.
SelectFailed | Operation failed due to an error executing SQL SELECT command.
Succeeded | Successful operation.
UpdateFailed | Operation failed due to an error executing SQL UPDATE command.

See Also

C1.Data Namespace


UnboundDataReader Class

UnboundDataReader Class

UnboundDataReader is a helper class used in supporting unbound tables in the C1.Data.C1DataSetLogic.BeforeFetch event. The data is passed to its constructor in a System.Data.DataTable object. It implements the System.Data.IDataReader interface.

For a list of all members of this type, see UnboundDataReader Members.

System.Object

System.MarshalByRefObject

C1.Data.UnboundDataReader

[Visual Basic]

Public Class UnboundDataReader

Inherits MarshalByRefObject

Implements IDataReader, IDataRecord, IDisposable

[C#]

public class UnboundDataReader : MarshalByRefObject , IDataReader, IDataRecord, IDisposable

[Delphi]

type UnboundDataReader = class (MarshalByRefObject, IDataReader, IDataRecord, IDisposable);

Namespace: C1.Data

Assembly: C1.Data (in c1.data.dll)


UnboundDataReader Members

UnboundDataReader Members

UnboundDataReader overview

Public Constructors

UnboundDataReader Constructor

Initializes a new instance of the UnboundDataReader class.

Public Properties

DataTable

Gets or sets the System.Data.DataTable object that contains data rows for this data reader.


UnboundDataReader Constructor

UnboundDataReader Constructor

Initializes a new instance of the UnboundDataReader class.

[Visual Basic]

Public Function New( _

ByVal dataTable As DataTable _

)

[C#]

public UnboundDataReader(

DataTable dataTable

);

[Delphi]

public constructor Create(

dataTable: DataTable

);

Parameters

dataTable

System.Data.DataTable object with data rows.


UnboundDataReader Properties

UnboundDataReader Properties

The properties of the UnboundDataReader class are listed here. For a complete list of UnboundDataReader class members, see the UnboundDataReader Members topic.

Public Properties

DataTable

Gets or sets the System.Data.DataTable object that contains data rows for this data reader.


UnboundDataReader.DataTable Property

UnboundDataReader.DataTable Property

Gets or sets the System.Data.DataTable object that contains data rows for this data reader.

[Visual Basic]

Public Property DataTable As DataTable

[C#]

public DataTable DataTable {get;set;}

[Delphi]

public property DataTable: DataTable read get_DataTable write set_DataTable;


C1.Data.Express Namespace

C1.Data.Express Namespace

C1.Data.Express Hierarchy

Classes

Class | Description
C1ExpressConnection |
C1ExpressField |
C1ExpressFieldCollection |
C1ExpressJoin |
C1ExpressJoinCollection |
C1ExpressRelation |
C1ExpressRelationCollection |
C1ExpressTable |
C1ExpressView |
ExpressGenerateSqlEventArgs |

Delegates

Delegate | Description
ExpressGenerateSqlEventHandler |

See Also

C1.Data.Express Assembly


C1ExpressConnection Class

C1ExpressConnection Class

For a list of all members of this type, see C1ExpressConnection Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.Express.C1ExpressConnection

[Visual Basic]

Public Class C1ExpressConnection

Inherits BaseFormAwareComponent

Implements IComponent, IListSource, ISupportInitialize

[C#]

public class C1ExpressConnection : BaseFormAwareComponent , IComponent, IListSource, ISupportInitialize

[Delphi]

type C1ExpressConnection = class (BaseFormAwareComponent, IComponent, IListSource, ISupportInitialize);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressConnection Members

C1ExpressConnection Members

C1ExpressConnection overview

Public Properties

AlwaysEscapeNames | Gets or sets a value indicating whether every name in generated SQL statements must be quoted to avoid collision with database reserved keywords.
CaseSensitive | Determines whether string comparisons are case-sensitive.
ChangeInProgress | Gets or sets a value indicating whether firing AfterChanges event is deferred.
Connection | Returns database connection object at run time.
ConnectionString | Gets or sets the connection string used to connect to the database.
ConnectionTimeout | Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
ConnectionType | Gets or sets a value determining the software (middleware or native) used to connect to the database.
Database | Gets the name of the current database or the database to be used once a connection is open.
DataSet | Gets the internal data set object.
DataSource | Gets the location and file name of the data source.
DbTables | Gets the collection of C1DataTable objects representing data in C1ExpressTable components attached to this C1ExpressConnection.
ExecutionMode | Gets or sets a value indicating whether actions in handling a business logic event are deferred or performed immediately.
ExpressTables | Gets the collection of C1DataTable objects attached to this C1ExpressConnection.
FieldDefaults | Gets the FieldDefaults object containing default field settings.
FillOnRequest | Gets or sets a value indicating whether all tables attached to the connection will be automatically filled with data when a data bound control requests data from it.
Locale | Determines the locale information used in string comparisons.
Provider | For an OLE DB connection, gets the name of the OLE DB provider.
Relations | Gets the collection of C1ExpressConnection relations.

Public Methods

AcceptChanges | Commits all the changes made within the connection since it was filled with data or the last time AcceptChanges or RejectChanges was called.
Fill | Fills the tables attached to the connection with data fetching it from the database.
GetExportDataSet | Overloaded. Creates and fills with data an ADO.NET data set containing data for all tables in this C1ExpressConnection.
HasChanges | Overloaded. Gets a value indicating whether the connection data tables have changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.
PopExecutionMode | Restore the execution mode affecting actions invoked while handling another action.
PushExecutionMode | Sets the execution mode affecting actions invoked while handling another action.
ReadXml | Overloaded. Reads XML data into the C1ExpressConnection.
RejectChanges | Rolls back all changes made withing the connection since it was filled with data or the last time AcceptChanges or RejectChanges was called.
Update | Updates (commits) all changed data rows to the database.
WriteXml | Overloaded. Writes XML data from the C1ExpressConnection.

Public Events

AfterFill | Fired after the table attached to the connection have been filled with data.
AfterUpdate | Fired after all changes are updated to the database.
AfterUpdateRow | Fired after modifications made to a row are commited to the database.
BeforeFill | Fired before the table attached to the connection are filled with data.
BeforeUpdate | Fired before all changes are updated to the database.
BeforeUpdateRow | Fired before modifications made to a row are commited to the database.
Error | Fired when an error occurs.
GetChildRows | Used to programmatically specify the list of child rows for a relation.
UpdateError | Fired when an error occurs commiting changes to the database.


C1ExpressConnection Properties

C1ExpressConnection Properties

The properties of the C1ExpressConnection class are listed here. For a complete list of C1ExpressConnection class members, see the C1ExpressConnection Members topic.

Public Properties

AlwaysEscapeNames | Gets or sets a value indicating whether every name in generated SQL statements must be quoted to avoid collision with database reserved keywords.
CaseSensitive | Determines whether string comparisons are case-sensitive.
ChangeInProgress | Gets or sets a value indicating whether firing AfterChanges event is deferred.
Connection | Returns database connection object at run time.
ConnectionString | Gets or sets the connection string used to connect to the database.
ConnectionTimeout | Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
ConnectionType | Gets or sets a value determining the software (middleware or native) used to connect to the database.
Database | Gets the name of the current database or the database to be used once a connection is open.
DataSet | Gets the internal data set object.
DataSource | Gets the location and file name of the data source.
DbTables | Gets the collection of C1DataTable objects representing data in C1ExpressTable components attached to this C1ExpressConnection.
ExecutionMode | Gets or sets a value indicating whether actions in handling a business logic event are deferred or performed immediately.
ExpressTables | Gets the collection of C1DataTable objects attached to this C1ExpressConnection.
FieldDefaults | Gets the FieldDefaults object containing default field settings.
FillOnRequest | Gets or sets a value indicating whether all tables attached to the connection will be automatically filled with data when a data bound control requests data from it.
Locale | Determines the locale information used in string comparisons.
Provider | For an OLE DB connection, gets the name of the OLE DB provider.
Relations | Gets the collection of C1ExpressConnection relations.


C1ExpressConnection.AlwaysEscapeNames Property

C1ExpressConnection.AlwaysEscapeNames Property

Gets or sets a value indicating whether every name in generated SQL statements must be quoted to avoid collision with database reserved keywords.

[Visual Basic]

Public Property AlwaysEscapeNames As Boolean

[C#]

public bool AlwaysEscapeNames {get;set;}

[Delphi]

public property AlwaysEscapeNames: Boolean read get_AlwaysEscapeNames write set_AlwaysEscapeNames;


C1ExpressConnection.CaseSensitive Property

C1ExpressConnection.CaseSensitive Property

Determines whether string comparisons are case-sensitive.

[Visual Basic]

Public Property CaseSensitive As Boolean

[C#]

public bool CaseSensitive {get;set;}

[Delphi]

public property CaseSensitive: Boolean read get_CaseSensitive write set_CaseSensitive;


C1ExpressConnection.ChangeInProgress Property

C1ExpressConnection.ChangeInProgress Property

Gets or sets a value indicating whether firing AfterChanges event is deferred.

[Visual Basic]

Public Property ChangeInProgress As Boolean

[C#]

public bool ChangeInProgress {get;set;}

[Delphi]

public property ChangeInProgress: Boolean read get_ChangeInProgress write set_ChangeInProgress;


C1ExpressConnection.Connection Property

C1ExpressConnection.Connection Property

Returns database connection object at run time.

[Visual Basic]

Public ReadOnly Property Connection As Connection

[C#]

public Connection Connection {get;}

[Delphi]

public property Connection: Connection read get_Connection;


C1ExpressConnection.ConnectionString Property

C1ExpressConnection.ConnectionString Property

Gets or sets the connection string used to connect to the database.

[Visual Basic]

Public Property ConnectionString As String

[C#]

public string ConnectionString {get;set;}

[Delphi]

public property ConnectionString: String read get_ConnectionString write set_ConnectionString;


C1ExpressConnection.ConnectionTimeout Property

C1ExpressConnection.ConnectionTimeout Property

Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.

[Visual Basic]

Public ReadOnly Property ConnectionTimeout As Integer

[C#]

public int ConnectionTimeout {get;}

[Delphi]

public property ConnectionTimeout: Int32 read get_ConnectionTimeout;


C1ExpressConnection.ConnectionType Property

C1ExpressConnection.ConnectionType Property

Gets or sets a value determining the software (middleware or native) used to connect to the database.

[Visual Basic]

Public Property ConnectionType As ConnectionTypeEnum

[C#]

public ConnectionTypeEnum ConnectionType {get;set;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType write set_ConnectionType;


C1ExpressConnection.Database Property

C1ExpressConnection.Database Property

Gets the name of the current database or the database to be used once a connection is open.

[Visual Basic]

Public ReadOnly Property Database As String

[C#]

public string Database {get;}

[Delphi]

public property Database: String read get_Database;


C1ExpressConnection.DataSet Property

C1ExpressConnection.DataSet Property

Gets the internal data set object.

[Visual Basic]

Public ReadOnly Property DataSet As C1DataSet

[C#]

public C1DataSet DataSet {get;}

[Delphi]

public property DataSet: C1DataSet read get_DataSet;


C1ExpressConnection.DataSource Property

C1ExpressConnection.DataSource Property

Gets the location and file name of the data source.

[Visual Basic]

Public ReadOnly Property DataSource As String

[C#]

public string DataSource {get;}

[Delphi]

public property DataSource: String read get_DataSource;


C1ExpressConnection.DbTables Property

C1ExpressConnection.DbTables Property

Gets the collection of C1DataTable objects representing data in C1ExpressTable components attached to this C1ExpressConnection.

[Visual Basic]

Public ReadOnly Property DbTables As C1DataTableCollection

[C#]

public C1DataTableCollection DbTables {get;}

[Delphi]

public property DbTables: C1DataTableCollection read get_DbTables;


C1ExpressConnection.ExecutionMode Property

C1ExpressConnection.ExecutionMode Property

Gets or sets a value indicating whether actions in handling a business logic event are deferred or performed immediately.

[Visual Basic]

Public ReadOnly Property ExecutionMode As ExecutionModeEnum

[C#]

public ExecutionModeEnum ExecutionMode {get;}

[Delphi]

public property ExecutionMode: ExecutionModeEnum read get_ExecutionMode;


C1ExpressConnection.ExpressTables Property

C1ExpressConnection.ExpressTables Property

Gets the collection of C1DataTable objects attached to this C1ExpressConnection.

[Visual Basic]

Public ReadOnly Property ExpressTables As ComponentCollection

[C#]

public ComponentCollection ExpressTables {get;}

[Delphi]

public property ExpressTables: ComponentCollection read get_ExpressTables;


C1ExpressConnection.FieldDefaults Property

C1ExpressConnection.FieldDefaults Property

Gets the FieldDefaults object containing default field settings.

[Visual Basic]

Public Property FieldDefaults As FieldDefaults

[C#]

public FieldDefaults FieldDefaults {get;set;}

[Delphi]

public property FieldDefaults: FieldDefaults read get_FieldDefaults write set_FieldDefaults;


C1ExpressConnection.FillOnRequest Property

C1ExpressConnection.FillOnRequest Property

Gets or sets a value indicating whether all tables attached to the connection will be automatically filled with data when a data bound control requests data from it.

[Visual Basic]

Public Property FillOnRequest As Boolean

[C#]

public bool FillOnRequest {get;set;}

[Delphi]

public property FillOnRequest: Boolean read get_FillOnRequest write set_FillOnRequest;


C1ExpressConnection.Locale Property

C1ExpressConnection.Locale Property

Determines the locale information used in string comparisons.

[Visual Basic]

Public Property Locale As CultureInfo

[C#]

public CultureInfo Locale {get;set;}

[Delphi]

public property Locale: CultureInfo read get_Locale write set_Locale;


C1ExpressConnection.Provider Property

C1ExpressConnection.Provider Property

For an OLE DB connection, gets the name of the OLE DB provider.

[Visual Basic]

Public ReadOnly Property Provider As String

[C#]

public string Provider {get;}

[Delphi]

public property Provider: String read get_Provider;


C1ExpressConnection.Relations Property

C1ExpressConnection.Relations Property

Gets the collection of C1ExpressConnection relations.

[Visual Basic]

Public ReadOnly Property Relations As C1ExpressRelationCollection

[C#]

public C1ExpressRelationCollection Relations {get;}

[Delphi]

public property Relations: C1ExpressRelationCollection read get_Relations;


C1ExpressConnection Methods

C1ExpressConnection Methods

The methods of the C1ExpressConnection class are listed here. For a complete list of C1ExpressConnection class members, see the C1ExpressConnection Members topic.

Public Methods

AcceptChanges | Commits all the changes made within the connection since it was filled with data or the last time AcceptChanges or RejectChanges was called.
Fill | Fills the tables attached to the connection with data fetching it from the database.
GetExportDataSet | Overloaded. Creates and fills with data an ADO.NET data set containing data for all tables in this C1ExpressConnection.
HasChanges | Overloaded. Gets a value indicating whether the connection data tables have changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.
PopExecutionMode | Restore the execution mode affecting actions invoked while handling another action.
PushExecutionMode | Sets the execution mode affecting actions invoked while handling another action.
ReadXml | Overloaded. Reads XML data into the C1ExpressConnection.
RejectChanges | Rolls back all changes made withing the connection since it was filled with data or the last time AcceptChanges or RejectChanges was called.
Update | Updates (commits) all changed data rows to the database.
WriteXml | Overloaded. Writes XML data from the C1ExpressConnection.


C1ExpressConnection.AcceptChanges Method

C1ExpressConnection.AcceptChanges Method

Commits all the changes made within the connection since it was filled with data or the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub AcceptChanges()

[C#]

public void AcceptChanges()

[Delphi]

public procedure AcceptChanges();


C1ExpressConnection.Fill Method

C1ExpressConnection.Fill Method

Fills the tables attached to the connection with data fetching it from the database.

[Visual Basic]

Public Sub Fill()

[C#]

public void Fill()

[Delphi]

public procedure Fill();


C1ExpressConnection.GetExportDataSet Method

C1ExpressConnection.GetExportDataSet Method

Overload List

Creates and fills with data an ADO.NET data set containing data for all tables in this C1ExpressConnection.

[Visual Basic] Overloads Public Function GetExportDataSet() As DataSet

[C#] public DataSet GetExportDataSet();

[Delphi] public function GetExportDataSet() : DataSet; overload;

Creates and fills with data an ADO.NET data set containing data for all tables in this C1ExpressConnection.

[Visual Basic] Overloads Public Function GetExportDataSet(Boolean) As DataSet

[C#] public DataSet GetExportDataSet(bool);

[Delphi] public function GetExportDataSet(Boolean) : DataSet; overload;


C1ExpressConnection.GetExportDataSet Method ()

C1ExpressConnection.GetExportDataSet Method ()

Creates and fills with data an ADO.NET data set containing data for all tables in this C1ExpressConnection.

[Visual Basic]

Overloads Public Function GetExportDataSet() As DataSet

[C#]

public DataSet GetExportDataSet()

[Delphi]

public function GetExportDataSet(): DataSet; overload;


C1ExpressConnection.GetExportDataSet Method (Boolean)

C1ExpressConnection.GetExportDataSet Method (Boolean)

Creates and fills with data an ADO.NET data set containing data for all tables in this C1ExpressConnection.

[Visual Basic]

Overloads Public Function GetExportDataSet( _

ByVal schemaOnly As Boolean _

) As DataSet

[C#]

public DataSet GetExportDataSet(

bool schemaOnly

);

[Delphi]

public function GetExportDataSet(

schemaOnly: Boolean

): DataSet; overload;


C1ExpressConnection.HasChanges Method

C1ExpressConnection.HasChanges Method

Overload List

Gets a value indicating whether the connection data tables have changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic] Overloads Public Function HasChanges() As Boolean

[C#] public bool HasChanges();

[Delphi] public function HasChanges() : Boolean; overload;

Gets a value indicating whether the connection data tables have changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic] Overloads Public Function HasChanges(DataRowStateEnum) As Boolean

[C#] public bool HasChanges(DataRowStateEnum);

[Delphi] public function HasChanges(DataRowStateEnum) : Boolean; overload;


C1ExpressConnection.HasChanges Method ()

C1ExpressConnection.HasChanges Method ()

Gets a value indicating whether the connection data tables have changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic]

Overloads Public Function HasChanges() As Boolean

[C#]

public bool HasChanges()

[Delphi]

public function HasChanges(): Boolean; overload;


C1ExpressConnection.HasChanges Method (DataRowStateEnum)

C1ExpressConnection.HasChanges Method (DataRowStateEnum)

Gets a value indicating whether the connection data tables have changes, including new, deleted, or modified rows, optionally filtered by DataRowStateEnum.

[Visual Basic]

Overloads Public Function HasChanges( _

ByVal rowState As DataRowStateEnum _

) As Boolean

[C#]

public bool HasChanges(

DataRowStateEnum rowState

);

[Delphi]

public function HasChanges(

rowState: DataRowStateEnum

): Boolean; overload;


C1ExpressConnection.PopExecutionMode Method

C1ExpressConnection.PopExecutionMode Method

Restore the execution mode affecting actions invoked while handling another action.

[Visual Basic]

Public Sub PopExecutionMode()

[C#]

public void PopExecutionMode()

[Delphi]

public procedure PopExecutionMode();


C1ExpressConnection.PushExecutionMode Method

C1ExpressConnection.PushExecutionMode Method

Sets the execution mode affecting actions invoked while handling another action.

[Visual Basic]

Public Sub PushExecutionMode( _

ByVal mode As ExecutionModeEnum _

)

[C#]

public void PushExecutionMode(

ExecutionModeEnum mode

);

[Delphi]

public procedure PushExecutionMode(

mode: ExecutionModeEnum

);


C1ExpressConnection.ReadXml Method

C1ExpressConnection.ReadXml Method

Overload List

Reads XML data into the C1ExpressConnection.

[Visual Basic] Overloads Public Sub ReadXml(Stream)

[C#] public ReadXml(Stream);

[Delphi] public procedure ReadXml(Stream); overload;

Reads XML data into the C1ExpressConnection.

[Visual Basic] Overloads Public Sub ReadXml(String)

[C#] public ReadXml(string);

[Delphi] public procedure ReadXml(String); overload;

Reads XML data into the C1ExpressConnection.

[Visual Basic] Overloads Public Sub ReadXml(XmlReader)

[C#] public ReadXml(XmlReader);

[Delphi] public procedure ReadXml(XmlReader); overload;


C1ExpressConnection.ReadXml Method (Stream)

C1ExpressConnection.ReadXml Method (Stream)

Reads XML data into the C1ExpressConnection.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal stream As Stream _

)

[C#]

public void ReadXml(

Stream stream

);

[Delphi]

public procedure ReadXml(

stream: Stream

); overload;


C1ExpressConnection.ReadXml Method (String)

C1ExpressConnection.ReadXml Method (String)

Reads XML data into the C1ExpressConnection.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal fileName As String _

)

[C#]

public void ReadXml(

string fileName

);

[Delphi]

public procedure ReadXml(

fileName: String

); overload;


C1ExpressConnection.ReadXml Method (XmlReader)

C1ExpressConnection.ReadXml Method (XmlReader)

Reads XML data into the C1ExpressConnection.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal reader As XmlReader _

)

[C#]

public void ReadXml(

XmlReader reader

);

[Delphi]

public procedure ReadXml(

reader: XmlReader

); overload;


C1ExpressConnection.RejectChanges Method

C1ExpressConnection.RejectChanges Method

Rolls back all changes made withing the connection since it was filled with data or the last time AcceptChanges or RejectChanges was called.

[Visual Basic]

Public Sub RejectChanges()

[C#]

public void RejectChanges()

[Delphi]

public procedure RejectChanges();


C1ExpressConnection.Update Method

C1ExpressConnection.Update Method

Updates (commits) all changed data rows to the database.

[Visual Basic]

Public Sub Update()

[C#]

public void Update()

[Delphi]

public procedure Update();


C1ExpressConnection.WriteXml Method

C1ExpressConnection.WriteXml Method

Overload List

Writes XML data from the C1ExpressConnection.

[Visual Basic] Overloads Public Sub WriteXml(Stream)

[C#] public WriteXml(Stream);

[Delphi] public procedure WriteXml(Stream); overload;

Writes XML data from the C1ExpressConnection.

[Visual Basic] Overloads Public Sub WriteXml(String)

[C#] public WriteXml(string);

[Delphi] public procedure WriteXml(String); overload;

Writes XML data from the C1ExpressConnection.

[Visual Basic] Overloads Public Sub WriteXml(XmlTextWriter)

[C#] public WriteXml(XmlTextWriter);

[Delphi] public procedure WriteXml(XmlTextWriter); overload;


C1ExpressConnection.WriteXml Method (Stream)

C1ExpressConnection.WriteXml Method (Stream)

Writes XML data from the C1ExpressConnection.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal stream As Stream _

)

[C#]

public void WriteXml(

Stream stream

);

[Delphi]

public procedure WriteXml(

stream: Stream

); overload;


C1ExpressConnection.WriteXml Method (String)

C1ExpressConnection.WriteXml Method (String)

Writes XML data from the C1ExpressConnection.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal fileName As String _

)

[C#]

public void WriteXml(

string fileName

);

[Delphi]

public procedure WriteXml(

fileName: String

); overload;


C1ExpressConnection.WriteXml Method (XmlTextWriter)

C1ExpressConnection.WriteXml Method (XmlTextWriter)

Writes XML data from the C1ExpressConnection.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal writer As XmlTextWriter _

)

[C#]

public void WriteXml(

XmlTextWriter writer

);

[Delphi]

public procedure WriteXml(

writer: XmlTextWriter

); overload;


C1ExpressConnection Events

C1ExpressConnection Events

The events of the C1ExpressConnection class are listed here. For a complete list of C1ExpressConnection class members, see the C1ExpressConnection Members topic.

Public Events

AfterFill | Fired after the table attached to the connection have been filled with data.
AfterUpdate | Fired after all changes are updated to the database.
AfterUpdateRow | Fired after modifications made to a row are commited to the database.
BeforeFill | Fired before the table attached to the connection are filled with data.
BeforeUpdate | Fired before all changes are updated to the database.
BeforeUpdateRow | Fired before modifications made to a row are commited to the database.
Error | Fired when an error occurs.
GetChildRows | Used to programmatically specify the list of child rows for a relation.
UpdateError | Fired when an error occurs commiting changes to the database.


C1ExpressConnection.AfterFill Event

C1ExpressConnection.AfterFill Event

Fired after the table attached to the connection have been filled with data.

[Visual Basic]

Public Event AfterFill As FillEventHandler

[C#]

public event FillEventHandler AfterFill

[Delphi]

public property AfterFill: FillEventHandler read remove_AfterFill write add_AfterFill;


C1ExpressConnection.AfterUpdate Event

C1ExpressConnection.AfterUpdate Event

Fired after all changes are updated to the database.

[Visual Basic]

Public Event AfterUpdate As DataSetEventHandler

[C#]

public event DataSetEventHandler AfterUpdate

[Delphi]

public property AfterUpdate: DataSetEventHandler read remove_AfterUpdate write add_AfterUpdate;


C1ExpressConnection.AfterUpdateRow Event

C1ExpressConnection.AfterUpdateRow Event

Fired after modifications made to a row are commited to the database.

[Visual Basic]

Public Event AfterUpdateRow As RowUpdateEventHandler

[C#]

public event RowUpdateEventHandler AfterUpdateRow

[Delphi]

public property AfterUpdateRow: RowUpdateEventHandler read remove_AfterUpdateRow write add_AfterUpdateRow;


C1ExpressConnection.BeforeFill Event

C1ExpressConnection.BeforeFill Event

Fired before the table attached to the connection are filled with data.

[Visual Basic]

Public Event BeforeFill As FillEventHandler

[C#]

public event FillEventHandler BeforeFill

[Delphi]

public property BeforeFill: FillEventHandler read remove_BeforeFill write add_BeforeFill;


C1ExpressConnection.BeforeUpdate Event

C1ExpressConnection.BeforeUpdate Event

Fired before all changes are updated to the database.

[Visual Basic]

Public Event BeforeUpdate As DataSetEventHandler

[C#]

public event DataSetEventHandler BeforeUpdate

[Delphi]

public property BeforeUpdate: DataSetEventHandler read remove_BeforeUpdate write add_BeforeUpdate;


C1ExpressConnection.BeforeUpdateRow Event

C1ExpressConnection.BeforeUpdateRow Event

Fired before modifications made to a row are commited to the database.

[Visual Basic]

Public Event BeforeUpdateRow As RowUpdateEventHandler

[C#]

public event RowUpdateEventHandler BeforeUpdateRow

[Delphi]

public property BeforeUpdateRow: RowUpdateEventHandler read remove_BeforeUpdateRow write add_BeforeUpdateRow;


C1ExpressConnection.Error Event

C1ExpressConnection.Error Event

Fired when an error occurs.

[Visual Basic]

Public Event Error As DataSetEventHandler

[C#]

public event DataSetEventHandler Error

[Delphi]

public property Error: DataSetEventHandler read remove_Error write add_Error;


C1ExpressConnection.GetChildRows Event

C1ExpressConnection.GetChildRows Event

Used to programmatically specify the list of child rows for a relation.

[Visual Basic]

Public Event GetChildRows As GetListEventHandler

[C#]

public event GetListEventHandler GetChildRows

[Delphi]

public property GetChildRows: GetListEventHandler read remove_GetChildRows write add_GetChildRows;


C1ExpressConnection.UpdateError Event

C1ExpressConnection.UpdateError Event

Fired when an error occurs commiting changes to the database.

[Visual Basic]

Public Event UpdateError As DataSetEventHandler

[C#]

public event DataSetEventHandler UpdateError

[Delphi]

public property UpdateError: DataSetEventHandler read remove_UpdateError write add_UpdateError;


C1ExpressField Class

C1ExpressField Class

For a list of all members of this type, see C1ExpressField Members.

System.Object

C1.Data.SchemaObjects.Field

C1.Data.Express.C1ExpressField

[Visual Basic]

Public Class C1ExpressField

Inherits Field

[C#]

public class C1ExpressField : Field

[Delphi]

type C1ExpressField = class (Field);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressField Members

C1ExpressField Members

C1ExpressField overview

Public Constructors

C1ExpressField Constructor

Public Properties

CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DbFieldName |
DbTableName |
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly (inherited from Field) | Gets the effective value of the ReadOnly property at run time.
EffectiveReadOnlyUnlessNew (inherited from Field) | Gets the effective value of the ReadOnlyUnlessNew property at run time.
EffectiveUserReadOnly (inherited from Field) | Gets the effective value of the UserReadOnly property at run time.
Name |
Table |
Type (inherited from Field) | Gets or sets the type of field data.
UpdateIgnore |
UpdateLocate |
UpdateRefresh |
UpdateSet |


C1ExpressField Constructor

C1ExpressField Constructor

Overload List

[Visual Basic] Public Function New()

[C#] public C1ExpressField();

[Delphi] public constructor Create(); overload;

[Visual Basic] Public Function New(C1ExpressTable)

[C#] public C1ExpressField(C1ExpressTable);

[Delphi] public constructor Create(C1ExpressTable); overload;


C1ExpressField Constructor ()

C1ExpressField Constructor ()

[Visual Basic]

Public Function New()

[C#]

public C1ExpressField()

[Delphi]

public constructor Create(); overload;


C1ExpressField Constructor (C1ExpressTable)

C1ExpressField Constructor (C1ExpressTable)

[Visual Basic]

Public Function New( _

ByVal table As C1ExpressTable _

)

[C#]

public C1ExpressField(

C1ExpressTable table

);

[Delphi]

public constructor Create(

table: C1ExpressTable

); overload;


C1ExpressField Properties

C1ExpressField Properties

The properties of the C1ExpressField class are listed here. For a complete list of C1ExpressField class members, see the C1ExpressField Members topic.

Public Properties

CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DbFieldName |
DbTableName |
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly (inherited from Field) | Gets the effective value of the ReadOnly property at run time.
EffectiveReadOnlyUnlessNew (inherited from Field) | Gets the effective value of the ReadOnlyUnlessNew property at run time.
EffectiveUserReadOnly (inherited from Field) | Gets the effective value of the UserReadOnly property at run time.
Name |
Table |
Type (inherited from Field) | Gets or sets the type of field data.
UpdateIgnore |
UpdateLocate |
UpdateRefresh |
UpdateSet |


C1ExpressField.DbFieldName Property

C1ExpressField.DbFieldName Property

[Visual Basic]

Public Property DbFieldName As String

[C#]

public string DbFieldName {get;set;}

[Delphi]

public property DbFieldName: String read get_DbFieldName write set_DbFieldName;


C1ExpressField.DbTableName Property

C1ExpressField.DbTableName Property

[Visual Basic]

Public Property DbTableName As String

[C#]

public string DbTableName {get;set;}

[Delphi]

public property DbTableName: String read get_DbTableName write set_DbTableName;


C1ExpressField.Name Property

C1ExpressField.Name Property

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


C1ExpressField.Table Property

C1ExpressField.Table Property

[Visual Basic]

Public ReadOnly Property Table As C1ExpressTable

[C#]

public C1ExpressTable Table {get;}

[Delphi]

public property Table: C1ExpressTable read get_Table;


C1ExpressField.UpdateIgnore Property

C1ExpressField.UpdateIgnore Property

[Visual Basic]

Public Property UpdateIgnore As Boolean

[C#]

public bool UpdateIgnore {get;set;}

[Delphi]

public property UpdateIgnore: Boolean read get_UpdateIgnore write set_UpdateIgnore;


C1ExpressField.UpdateLocate Property

C1ExpressField.UpdateLocate Property

[Visual Basic]

Public Property UpdateLocate As Boolean

[C#]

public bool UpdateLocate {get;set;}

[Delphi]

public property UpdateLocate: Boolean read get_UpdateLocate write set_UpdateLocate;


C1ExpressField.UpdateRefresh Property

C1ExpressField.UpdateRefresh Property

[Visual Basic]

Public Property UpdateRefresh As Boolean

[C#]

public bool UpdateRefresh {get;set;}

[Delphi]

public property UpdateRefresh: Boolean read get_UpdateRefresh write set_UpdateRefresh;


C1ExpressField.UpdateSet Property

C1ExpressField.UpdateSet Property

[Visual Basic]

Public Property UpdateSet As FieldUpdateSetModeEnum

[C#]

public FieldUpdateSetModeEnum UpdateSet {get;set;}

[Delphi]

public property UpdateSet: FieldUpdateSetModeEnum read get_UpdateSet write set_UpdateSet;


C1ExpressFieldCollection Class

C1ExpressFieldCollection Class

For a list of all members of this type, see C1ExpressFieldCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.Express.C1ExpressFieldCollection

[Visual Basic]

Public Class C1ExpressFieldCollection

Inherits CollectionBase

[C#]

public class C1ExpressFieldCollection : CollectionBase

[Delphi]

type C1ExpressFieldCollection = class (CollectionBase);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressFieldCollection Members

C1ExpressFieldCollection Members

C1ExpressFieldCollection overview

Public Properties

Item | Overloaded.
Table |

Public Methods

Add |
Contains |
CopyTo |
IndexOf | Overloaded.
Insert |
Remove |
RemoveAt |


C1ExpressFieldCollection Properties

C1ExpressFieldCollection Properties

The properties of the C1ExpressFieldCollection class are listed here. For a complete list of C1ExpressFieldCollection class members, see the C1ExpressFieldCollection Members topic.

Public Properties

Item | Overloaded.
Table |


C1ExpressFieldCollection.Item Property

C1ExpressFieldCollection.Item Property

Overload List

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As C1ExpressField

[C#] public C1ExpressField this[int]{get;}

[Delphi] public property Item[index: Int32]: C1ExpressField read get_Item;

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As C1ExpressField

[C#] public C1ExpressField this[string]{get;}

[Delphi] public property Item[name: String]: C1ExpressField read get_Item;


C1ExpressFieldCollection.Item Property (Int32)

C1ExpressFieldCollection.Item Property (Int32)

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As C1ExpressField

[C#]

public C1ExpressField this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: C1ExpressField read get_Item;


C1ExpressFieldCollection.Item Property (String)

C1ExpressFieldCollection.Item Property (String)

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As C1ExpressField

[C#]

public C1ExpressField this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: C1ExpressField read get_Item;


C1ExpressFieldCollection.Table Property

C1ExpressFieldCollection.Table Property

[Visual Basic]

Public ReadOnly Property Table As C1ExpressTable

[C#]

public C1ExpressTable Table {get;}

[Delphi]

public property Table: C1ExpressTable read get_Table;


C1ExpressFieldCollection Methods

C1ExpressFieldCollection Methods

The methods of the C1ExpressFieldCollection class are listed here. For a complete list of C1ExpressFieldCollection class members, see the C1ExpressFieldCollection Members topic.

Public Methods

Add |
Contains |
CopyTo |
IndexOf | Overloaded.
Insert |
Remove |
RemoveAt |


C1ExpressFieldCollection.Add Method

C1ExpressFieldCollection.Add Method

[Visual Basic]

Public Sub Add( _

ByVal field As C1ExpressField _

)

[C#]

public void Add(

C1ExpressField field

);

[Delphi]

public procedure Add(

field: C1ExpressField

);


C1ExpressFieldCollection.Contains Method

C1ExpressFieldCollection.Contains Method

[Visual Basic]

Public Function Contains( _

ByVal field As C1ExpressField _

) As Boolean

[C#]

public bool Contains(

C1ExpressField field

);

[Delphi]

public function Contains(

field: C1ExpressField

): Boolean;


C1ExpressFieldCollection.CopyTo Method

C1ExpressFieldCollection.CopyTo Method

[Visual Basic]

Public Sub CopyTo( _

ByVal array As C1ExpressField(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

C1ExpressField[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of C1ExpressField;

index: Int32

);


C1ExpressFieldCollection.IndexOf Method

C1ExpressFieldCollection.IndexOf Method

Overload List

[Visual Basic] Overloads Public Function IndexOf(C1ExpressField) As Integer

[C#] public int IndexOf(C1ExpressField);

[Delphi] public function IndexOf(C1ExpressField) : Int32; overload;

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;


C1ExpressFieldCollection.IndexOf Method (C1ExpressField)

C1ExpressFieldCollection.IndexOf Method (C1ExpressField)

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal field As C1ExpressField _

) As Integer

[C#]

public int IndexOf(

C1ExpressField field

);

[Delphi]

public function IndexOf(

field: C1ExpressField

): Int32; overload;


C1ExpressFieldCollection.IndexOf Method (String)

C1ExpressFieldCollection.IndexOf Method (String)

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;


C1ExpressFieldCollection.Insert Method

C1ExpressFieldCollection.Insert Method

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal field As C1ExpressField _

)

[C#]

public void Insert(

int index,

C1ExpressField field

);

[Delphi]

public procedure Insert(

index: Int32;

field: C1ExpressField

);


C1ExpressFieldCollection.Remove Method

C1ExpressFieldCollection.Remove Method

[Visual Basic]

Public Sub Remove( _

ByVal field As C1ExpressField _

)

[C#]

public void Remove(

C1ExpressField field

);

[Delphi]

public procedure Remove(

field: C1ExpressField

);


C1ExpressFieldCollection.RemoveAt Method

C1ExpressFieldCollection.RemoveAt Method

[Visual Basic]

Public Sub RemoveAt( _

ByVal index As Integer _

)

[C#]

public void RemoveAt(

int index

);

[Delphi]

public procedure RemoveAt(

index: Int32

);


C1ExpressJoin Class

C1ExpressJoin Class

For a list of all members of this type, see C1ExpressJoin Members.

System.Object

C1.Data.Express.C1ExpressJoin

[Visual Basic]

Public Class C1ExpressJoin

[C#]

public class C1ExpressJoin

[Delphi]

type C1ExpressJoin = class;

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressJoin Members

C1ExpressJoin Members

C1ExpressJoin overview

Public Constructors

C1ExpressJoin Constructor

Public Properties

ChildFieldName

Owner

ParentFieldName


C1ExpressJoin Constructor

C1ExpressJoin Constructor

Overload List

[Visual Basic] Public Function New()

[C#] public C1ExpressJoin();

[Delphi] public constructor Create(); overload;

[Visual Basic] Public Function New(C1ExpressJoinCollection)

[C#] public C1ExpressJoin(C1ExpressJoinCollection);

[Delphi] public constructor Create(C1ExpressJoinCollection); overload;


C1ExpressJoin Constructor ()

C1ExpressJoin Constructor ()

[Visual Basic]

Public Function New()

[C#]

public C1ExpressJoin()

[Delphi]

public constructor Create(); overload;


C1ExpressJoin Constructor (C1ExpressJoinCollection)

C1ExpressJoin Constructor (C1ExpressJoinCollection)

[Visual Basic]

Public Function New( _

ByVal owner As C1ExpressJoinCollection _

)

[C#]

public C1ExpressJoin(

C1ExpressJoinCollection owner

);

[Delphi]

public constructor Create(

owner: C1ExpressJoinCollection

); overload;


C1ExpressJoin Properties

C1ExpressJoin Properties

The properties of the C1ExpressJoin class are listed here. For a complete list of C1ExpressJoin class members, see the C1ExpressJoin Members topic.

Public Properties

ChildFieldName

Owner

ParentFieldName


C1ExpressJoin.ChildFieldName Property

C1ExpressJoin.ChildFieldName Property

[Visual Basic]

Public Property ChildFieldName As String

[C#]

public string ChildFieldName {get;set;}

[Delphi]

public property ChildFieldName: String read get_ChildFieldName write set_ChildFieldName;


C1ExpressJoin.Owner Property

C1ExpressJoin.Owner Property

[Visual Basic]

Public Property Owner As C1ExpressJoinCollection

[C#]

public C1ExpressJoinCollection Owner {get;set;}

[Delphi]

public property Owner: C1ExpressJoinCollection read get_Owner write set_Owner;


C1ExpressJoin.ParentFieldName Property

C1ExpressJoin.ParentFieldName Property

[Visual Basic]

Public Property ParentFieldName As String

[C#]

public string ParentFieldName {get;set;}

[Delphi]

public property ParentFieldName: String read get_ParentFieldName write set_ParentFieldName;


C1ExpressJoinCollection Class

C1ExpressJoinCollection Class

For a list of all members of this type, see C1ExpressJoinCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.Express.C1ExpressJoinCollection

[Visual Basic]

Public Class C1ExpressJoinCollection

Inherits CollectionBase

[C#]

public class C1ExpressJoinCollection : CollectionBase

[Delphi]

type C1ExpressJoinCollection = class (CollectionBase);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressJoinCollection Members

C1ExpressJoinCollection Members

C1ExpressJoinCollection overview

Public Properties

Item

Relation

Public Methods

Add | Overloaded.
Contains |
CopyTo |
IndexOf |
Insert |
Remove |
RemoveAt |


C1ExpressJoinCollection Properties

C1ExpressJoinCollection Properties

The properties of the C1ExpressJoinCollection class are listed here. For a complete list of C1ExpressJoinCollection class members, see the C1ExpressJoinCollection Members topic.

Public Properties

Item

Relation


C1ExpressJoinCollection.Item Property

C1ExpressJoinCollection.Item Property

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As C1ExpressJoin

[C#]

public C1ExpressJoin this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: C1ExpressJoin read get_Item;


C1ExpressJoinCollection.Relation Property

C1ExpressJoinCollection.Relation Property

[Visual Basic]

Public ReadOnly Property Relation As C1ExpressRelation

[C#]

public C1ExpressRelation Relation {get;}

[Delphi]

public property Relation: C1ExpressRelation read get_Relation;


C1ExpressJoinCollection Methods

C1ExpressJoinCollection Methods

The methods of the C1ExpressJoinCollection class are listed here. For a complete list of C1ExpressJoinCollection class members, see the C1ExpressJoinCollection Members topic.

Public Methods

Add | Overloaded.
Contains |
CopyTo |
IndexOf |
Insert |
Remove |
RemoveAt |


C1ExpressJoinCollection.Add Method

C1ExpressJoinCollection.Add Method

Overload List

[Visual Basic] Overloads Public Sub Add(JoinCondition)

[C#] public Add(JoinCondition);

[Delphi] public procedure Add(JoinCondition); overload;

[Visual Basic] Overloads Public Sub Add(String, String)

[C#] public Add(string, string);

[Delphi] public procedure Add(String; String); overload;


C1ExpressJoinCollection.Add Method (JoinCondition)

C1ExpressJoinCollection.Add Method (JoinCondition)

[Visual Basic]

Overloads Public Sub Add( _

ByVal join As JoinCondition _

)

[C#]

public void Add(

JoinCondition join

);

[Delphi]

public procedure Add(

join: JoinCondition

); overload;


C1ExpressJoinCollection.Add Method (String, String)

C1ExpressJoinCollection.Add Method (String, String)

[Visual Basic]

Overloads Public Sub Add( _

ByVal parentFieldName As String, _

ByVal childFieldName As String _

)

[C#]

public void Add(

string parentFieldName,

string childFieldName

);

[Delphi]

public procedure Add(

parentFieldName: String;

childFieldName: String

); overload;


C1ExpressJoinCollection.Contains Method

C1ExpressJoinCollection.Contains Method

[Visual Basic]

Public Function Contains( _

ByVal join As C1ExpressJoin _

) As Boolean

[C#]

public bool Contains(

C1ExpressJoin join

);

[Delphi]

public function Contains(

join: C1ExpressJoin

): Boolean;


C1ExpressJoinCollection.CopyTo Method

C1ExpressJoinCollection.CopyTo Method

[Visual Basic]

Public Sub CopyTo( _

ByVal array As C1ExpressJoin(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

C1ExpressJoin[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of C1ExpressJoin;

index: Int32

);


C1ExpressJoinCollection.IndexOf Method

C1ExpressJoinCollection.IndexOf Method

[Visual Basic]

Public Function IndexOf( _

ByVal join As C1ExpressJoin _

) As Integer

[C#]

public int IndexOf(

C1ExpressJoin join

);

[Delphi]

public function IndexOf(

join: C1ExpressJoin

): Int32;


C1ExpressJoinCollection.Insert Method

C1ExpressJoinCollection.Insert Method

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal join As C1ExpressJoin _

)

[C#]

public void Insert(

int index,

C1ExpressJoin join

);

[Delphi]

public procedure Insert(

index: Int32;

join: C1ExpressJoin

);


C1ExpressJoinCollection.Remove Method

C1ExpressJoinCollection.Remove Method

[Visual Basic]

Public Sub Remove( _

ByVal join As C1ExpressJoin _

)

[C#]

public void Remove(

C1ExpressJoin join

);

[Delphi]

public procedure Remove(

join: C1ExpressJoin

);


C1ExpressJoinCollection.RemoveAt Method

C1ExpressJoinCollection.RemoveAt Method

[Visual Basic]

Public Sub RemoveAt( _

ByVal index As Integer _

)

[C#]

public void RemoveAt(

int index

);

[Delphi]

public procedure RemoveAt(

index: Int32

);


C1ExpressRelation Class

C1ExpressRelation Class

For a list of all members of this type, see C1ExpressRelation Members.

System.Object

C1.Data.Express.C1ExpressRelation

[Visual Basic]

Public Class C1ExpressRelation

[C#]

public class C1ExpressRelation

[Delphi]

type C1ExpressRelation = class;

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressRelation Members

C1ExpressRelation Members

C1ExpressRelation overview

Public Constructors

C1ExpressRelation Constructor

Public Properties

ChildTable

DeleteRule

EnforceConstraints

GetRowsEvent

Joins

MainChildTableName

MainParentTableName

MasterDetail

ParentTable

SchemaRelationName

UpdateRule


C1ExpressRelation Constructor

C1ExpressRelation Constructor

Overload List

[Visual Basic] Public Function New()

[C#] public C1ExpressRelation();

[Delphi] public constructor Create(); overload;

[Visual Basic] Public Function New(C1ExpressConnection)

[C#] public C1ExpressRelation(C1ExpressConnection);

[Delphi] public constructor Create(C1ExpressConnection); overload;


C1ExpressRelation Constructor ()

C1ExpressRelation Constructor ()

[Visual Basic]

Public Function New()

[C#]

public C1ExpressRelation()

[Delphi]

public constructor Create(); overload;


C1ExpressRelation Constructor (C1ExpressConnection)

C1ExpressRelation Constructor (C1ExpressConnection)

[Visual Basic]

Public Function New( _

ByVal conn As C1ExpressConnection _

)

[C#]

public C1ExpressRelation(

C1ExpressConnection conn

);

[Delphi]

public constructor Create(

conn: C1ExpressConnection

); overload;


C1ExpressRelation Properties

C1ExpressRelation Properties

The properties of the C1ExpressRelation class are listed here. For a complete list of C1ExpressRelation class members, see the C1ExpressRelation Members topic.

Public Properties

ChildTable

DeleteRule

EnforceConstraints

GetRowsEvent

Joins

MainChildTableName

MainParentTableName

MasterDetail

ParentTable

SchemaRelationName

UpdateRule


C1ExpressRelation.ChildTable Property

C1ExpressRelation.ChildTable Property

[Visual Basic]

Public Property ChildTable As C1ExpressTable

[C#]

public C1ExpressTable ChildTable {get;set;}

[Delphi]

public property ChildTable: C1ExpressTable read get_ChildTable write set_ChildTable;


C1ExpressRelation.DeleteRule Property

C1ExpressRelation.DeleteRule Property

[Visual Basic]

Public Property DeleteRule As ReferentialIntegrityRuleEnum

[C#]

public ReferentialIntegrityRuleEnum DeleteRule {get;set;}

[Delphi]

public property DeleteRule: ReferentialIntegrityRuleEnum read get_DeleteRule write set_DeleteRule;


C1ExpressRelation.EnforceConstraints Property

C1ExpressRelation.EnforceConstraints Property

[Visual Basic]

Public Property EnforceConstraints As Boolean

[C#]

public bool EnforceConstraints {get;set;}

[Delphi]

public property EnforceConstraints: Boolean read get_EnforceConstraints write set_EnforceConstraints;


C1ExpressRelation.GetRowsEvent Property

C1ExpressRelation.GetRowsEvent Property

[Visual Basic]

Public Property GetRowsEvent As Boolean

[C#]

public bool GetRowsEvent {get;set;}

[Delphi]

public property GetRowsEvent: Boolean read get_GetRowsEvent write set_GetRowsEvent;


C1ExpressRelation.Joins Property

C1ExpressRelation.Joins Property

[Visual Basic]

Public ReadOnly Property Joins As C1ExpressJoinCollection

[C#]

public C1ExpressJoinCollection Joins {get;}

[Delphi]

public property Joins: C1ExpressJoinCollection read get_Joins;


C1ExpressRelation.MainChildTableName Property

C1ExpressRelation.MainChildTableName Property

[Visual Basic]

Public Property MainChildTableName As String

[C#]

public string MainChildTableName {get;set;}

[Delphi]

public property MainChildTableName: String read get_MainChildTableName write set_MainChildTableName;


C1ExpressRelation.MainParentTableName Property

C1ExpressRelation.MainParentTableName Property

[Visual Basic]

Public Property MainParentTableName As String

[C#]

public string MainParentTableName {get;set;}

[Delphi]

public property MainParentTableName: String read get_MainParentTableName write set_MainParentTableName;


C1ExpressRelation.MasterDetail Property

C1ExpressRelation.MasterDetail Property

[Visual Basic]

Public Property MasterDetail As Boolean

[C#]

public bool MasterDetail {get;set;}

[Delphi]

public property MasterDetail: Boolean read get_MasterDetail write set_MasterDetail;


C1ExpressRelation.ParentTable Property

C1ExpressRelation.ParentTable Property

[Visual Basic]

Public Property ParentTable As C1ExpressTable

[C#]

public C1ExpressTable ParentTable {get;set;}

[Delphi]

public property ParentTable: C1ExpressTable read get_ParentTable write set_ParentTable;


C1ExpressRelation.SchemaRelationName Property

C1ExpressRelation.SchemaRelationName Property

[Visual Basic]

Public Property SchemaRelationName As String

[C#]

public string SchemaRelationName {get;set;}

[Delphi]

public property SchemaRelationName: String read get_SchemaRelationName write set_SchemaRelationName;


C1ExpressRelation.UpdateRule Property

C1ExpressRelation.UpdateRule Property

[Visual Basic]

Public Property UpdateRule As ReferentialIntegrityRuleEnum

[C#]

public ReferentialIntegrityRuleEnum UpdateRule {get;set;}

[Delphi]

public property UpdateRule: ReferentialIntegrityRuleEnum read get_UpdateRule write set_UpdateRule;


C1ExpressRelationCollection Class

C1ExpressRelationCollection Class

For a list of all members of this type, see C1ExpressRelationCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.Express.C1ExpressRelationCollection

[Visual Basic]

Public Class C1ExpressRelationCollection

Inherits CollectionBase

[C#]

public class C1ExpressRelationCollection : CollectionBase

[Delphi]

type C1ExpressRelationCollection = class (CollectionBase);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressRelationCollection Members

C1ExpressRelationCollection Members

C1ExpressRelationCollection overview

Public Properties

Item

Public Methods

Add | Overloaded.
Clear |
Contains |
CopyTo |
IndexOf |
Insert |
Remove |


C1ExpressRelationCollection Properties

C1ExpressRelationCollection Properties

The properties of the C1ExpressRelationCollection class are listed here. For a complete list of C1ExpressRelationCollection class members, see the C1ExpressRelationCollection Members topic.

Public Properties

Item


C1ExpressRelationCollection.Item Property

C1ExpressRelationCollection.Item Property

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As C1ExpressRelation

[C#]

public C1ExpressRelation this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: C1ExpressRelation read get_Item;


C1ExpressRelationCollection Methods

C1ExpressRelationCollection Methods

The methods of the C1ExpressRelationCollection class are listed here. For a complete list of C1ExpressRelationCollection class members, see the C1ExpressRelationCollection Members topic.

Public Methods

Add | Overloaded.
Clear |
Contains |
CopyTo |
IndexOf |
Insert |
Remove |


C1ExpressRelationCollection.Add Method

C1ExpressRelationCollection.Add Method

Overload List

[Visual Basic] Overloads Public Function Add() As C1ExpressRelation

[C#] public C1ExpressRelation Add();

[Delphi] public function Add() : C1ExpressRelation; overload;

[Visual Basic] Overloads Public Sub Add(C1ExpressRelation)

[C#] public Add(C1ExpressRelation);

[Delphi] public procedure Add(C1ExpressRelation); overload;


C1ExpressRelationCollection.Add Method ()

C1ExpressRelationCollection.Add Method ()

[Visual Basic]

Overloads Public Function Add() As C1ExpressRelation

[C#]

public C1ExpressRelation Add()

[Delphi]

public function Add(): C1ExpressRelation; overload;


C1ExpressRelationCollection.Add Method (C1ExpressRelation)

C1ExpressRelationCollection.Add Method (C1ExpressRelation)

[Visual Basic]

Overloads Public Sub Add( _

ByVal rel As C1ExpressRelation _

)

[C#]

public void Add(

C1ExpressRelation rel

);

[Delphi]

public procedure Add(

rel: C1ExpressRelation

); overload;


C1ExpressRelationCollection.Clear Method

C1ExpressRelationCollection.Clear Method

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();


C1ExpressRelationCollection.Contains Method

C1ExpressRelationCollection.Contains Method

[Visual Basic]

Public Function Contains( _

ByVal relation As C1ExpressRelation _

) As Boolean

[C#]

public bool Contains(

C1ExpressRelation relation

);

[Delphi]

public function Contains(

relation: C1ExpressRelation

): Boolean;


C1ExpressRelationCollection.CopyTo Method

C1ExpressRelationCollection.CopyTo Method

[Visual Basic]

Public Sub CopyTo( _

ByVal array As C1ExpressRelation(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

C1ExpressRelation[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of C1ExpressRelation;

index: Int32

);


C1ExpressRelationCollection.IndexOf Method

C1ExpressRelationCollection.IndexOf Method

[Visual Basic]

Public Function IndexOf( _

ByVal relation As C1ExpressRelation _

) As Integer

[C#]

public int IndexOf(

C1ExpressRelation relation

);

[Delphi]

public function IndexOf(

relation: C1ExpressRelation

): Int32;


C1ExpressRelationCollection.Insert Method

C1ExpressRelationCollection.Insert Method

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal rel As C1ExpressRelation _

)

[C#]

public void Insert(

int index,

C1ExpressRelation rel

);

[Delphi]

public procedure Insert(

index: Int32;

rel: C1ExpressRelation

);


C1ExpressRelationCollection.Remove Method

C1ExpressRelationCollection.Remove Method

[Visual Basic]

Public Sub Remove( _

ByVal relation As C1ExpressRelation _

)

[C#]

public void Remove(

C1ExpressRelation relation

);

[Delphi]

public procedure Remove(

relation: C1ExpressRelation

);


C1ExpressTable Class

C1ExpressTable Class

For a list of all members of this type, see C1ExpressTable Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.BaseDataTableSource

C1.Data.Express.C1ExpressTable

[Visual Basic]

Public Class C1ExpressTable

Inherits BaseDataTableSource

Implements ISupportInitialize

[C#]

public class C1ExpressTable : BaseDataTableSource , ISupportInitialize

[Delphi]

type C1ExpressTable = class (BaseDataTableSource, ISupportInitialize);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressTable Members

C1ExpressTable Members

C1ExpressTable overview

Public Constructors

C1ExpressTable Constructor

Public Properties

AllowAddNew | Gets or sets a value indicating whether adding new rows to this table is allowed.
AllowDelete | Gets or sets a value indicating whether deleting rows from this table is allowed.
ConnectionComponent | Gets or sets the C1ExpressionConnection component this table is attached to.
ConnectionString | Gets or sets the connection string used to connect to the database.
ConnectionTimeout | Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
ConnectionType | Gets or sets a value determining the software (middleware or native) used to connect to the database.
CurrentRow (inherited from BaseDataTableSource) | Gets the C1DataRow object representing the current row.
DataAccessMode | Gets or sets a DataAccessModeEnum value specifying static (everything fetch into memory) or virtual (fetch by segments, for a large data set) mode of operation.
DataAdapter | Returns or sets the IDBDataAdapter component used to fill and update the table with non-empty SelectCommandText.
Database | Gets the name of the current database or the database to be used once a connection is open.
DataSource | Gets the location and file name of the data source.
DataTable (inherited from BaseDataTableSource) | Gets the source C1DataTable containing the data.
DbTableName | Gets or sets the name of the database table.
ExpressConnection | Gets the C1ExpressionConnection component for this table.
Fields | The collection of C1ExpressTable fields.
FillFilter | Gets or sets the filter criteria for filling the table with data.
FillOnRequest | Gets or sets a value indicating the table will be automatically filled with data when a data bound control requests data from it.
FillSort | Gets or sets the sort field or fields, and sort order for filling the table with data.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
Provider | For an OLE DB connection, gets the name of the OLE DB provider.
ReadOnly | Gets or sets a value indicating whether changes to the rows of this table are allowed.
SelectCommandText | Gets or sets the command text (SQL statement or stored procedure) for fetching data from the database.
SelectCommandType | How to interpret SelectCommandText.
TableName | Gets or sets the name of the table as it appears to data bound controls.
UpdateLeavingRow (inherited from BaseDataTableSource) | Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.
UserReadOnly | Gets or sets a value indicating whether changes to the rows of this table using bound controls are allowed.

Public Methods

MoveFirst (inherited from BaseDataTableSource) | Moves to the first row.
MoveLast (inherited from BaseDataTableSource) | Moves to the last row.
MoveNext (inherited from BaseDataTableSource) | Moves to the next row.
MovePrevious (inherited from BaseDataTableSource) | Moves to the previous row.
Seek (inherited from BaseDataTableSource) | Seeks a row by its primary key values.

Public Events

AfterAddNew (inherited from BaseDataTableSource) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseDataTableSource) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseDataTableSource) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseDataTableSource) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange (inherited from BaseDataTableSource) | Fired after a field value is set.
AfterFill | Fired after the table has been filled with data.
AfterFirstChange (inherited from BaseDataTableSource) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterGenerateSql | Fired after generating the SQL SELECT statement for fetching table data from the database.
AfterUpdateRow | Fired after modifications made to a row are commited to the database.
AsyncFetchComplete (inherited from BaseDataTableSource) | Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.
BeforeAddNew (inherited from BaseDataTableSource) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseDataTableSource) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseDataTableSource) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange (inherited from BaseDataTableSource) | Fired before a field value is set.
BeforeFill | Fired before the table is filled with data.
BeforeFirstChange (inherited from BaseDataTableSource) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeGenerateSql | Fired before generating the SQL SELECT statement for fetching table data from the database.
BeforeUpdateRow | Fired before modifications made to a row are commited to the database.
CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.
UpdateError | Fired when errors occur in an attempt to update the database when the end user leaves a modifies row.

Private Methods

9L (inherited from BaseDataTableSource)

9M (inherited from BaseDataTableSource)

BS (inherited from BaseDataTableSource)

BT (inherited from BaseDataTableSource)

BU (inherited from BaseDataTableSource)

BV (inherited from BaseDataTableSource)

BW (inherited from BaseDataTableSource)

BX (inherited from BaseDataTableSource)


C1ExpressTable Constructor

C1ExpressTable Constructor

Initializes a new instance of the C1ExpressTable class.

[Visual Basic]

Public Function New()

[C#]

public C1ExpressTable()

[Delphi]

public constructor Create();


C1ExpressTable Properties

C1ExpressTable Properties

The properties of the C1ExpressTable class are listed here. For a complete list of C1ExpressTable class members, see the C1ExpressTable Members topic.

Public Properties

AllowAddNew | Gets or sets a value indicating whether adding new rows to this table is allowed.
AllowDelete | Gets or sets a value indicating whether deleting rows from this table is allowed.
ConnectionComponent | Gets or sets the C1ExpressionConnection component this table is attached to.
ConnectionString | Gets or sets the connection string used to connect to the database.
ConnectionTimeout | Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
ConnectionType | Gets or sets a value determining the software (middleware or native) used to connect to the database.
CurrentRow (inherited from BaseDataTableSource) | Gets the C1DataRow object representing the current row.
DataAccessMode | Gets or sets a DataAccessModeEnum value specifying static (everything fetch into memory) or virtual (fetch by segments, for a large data set) mode of operation.
DataAdapter | Returns or sets the IDBDataAdapter component used to fill and update the table with non-empty SelectCommandText.
Database | Gets the name of the current database or the database to be used once a connection is open.
DataSource | Gets the location and file name of the data source.
DataTable (inherited from BaseDataTableSource) | Gets the source C1DataTable containing the data.
DbTableName | Gets or sets the name of the database table.
ExpressConnection | Gets the C1ExpressionConnection component for this table.
Fields | The collection of C1ExpressTable fields.
FillFilter | Gets or sets the filter criteria for filling the table with data.
FillOnRequest | Gets or sets a value indicating the table will be automatically filled with data when a data bound control requests data from it.
FillSort | Gets or sets the sort field or fields, and sort order for filling the table with data.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
Provider | For an OLE DB connection, gets the name of the OLE DB provider.
ReadOnly | Gets or sets a value indicating whether changes to the rows of this table are allowed.
SelectCommandText | Gets or sets the command text (SQL statement or stored procedure) for fetching data from the database.
SelectCommandType | How to interpret SelectCommandText.
TableName | Gets or sets the name of the table as it appears to data bound controls.
UpdateLeavingRow (inherited from BaseDataTableSource) | Gets or sets a value indicating whether modified rows are immediately updated to the database when the end user leaves the row.
UserReadOnly | Gets or sets a value indicating whether changes to the rows of this table using bound controls are allowed.


C1ExpressTable.AllowAddNew Property

C1ExpressTable.AllowAddNew Property

Gets or sets a value indicating whether adding new rows to this table is allowed.

[Visual Basic]

Public Property AllowAddNew As Boolean

[C#]

public bool AllowAddNew {get;set;}

[Delphi]

public property AllowAddNew: Boolean read get_AllowAddNew write set_AllowAddNew;


C1ExpressTable.AllowDelete Property

C1ExpressTable.AllowDelete Property

Gets or sets a value indicating whether deleting rows from this table is allowed.

[Visual Basic]

Public Property AllowDelete As Boolean

[C#]

public bool AllowDelete {get;set;}

[Delphi]

public property AllowDelete: Boolean read get_AllowDelete write set_AllowDelete;


C1ExpressTable.ConnectionComponent Property

C1ExpressTable.ConnectionComponent Property

Gets or sets the C1ExpressionConnection component this table is attached to.

[Visual Basic]

Public Property ConnectionComponent As C1ExpressConnection

[C#]

public C1ExpressConnection ConnectionComponent {get;set;}

[Delphi]

public property ConnectionComponent: C1ExpressConnection read get_ConnectionComponent write set_ConnectionComponent;


C1ExpressTable.ConnectionString Property

C1ExpressTable.ConnectionString Property

Gets or sets the connection string used to connect to the database.

[Visual Basic]

Public Property ConnectionString As String

[C#]

public string ConnectionString {get;set;}

[Delphi]

public property ConnectionString: String read get_ConnectionString write set_ConnectionString;


C1ExpressTable.ConnectionTimeout Property

C1ExpressTable.ConnectionTimeout Property

Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.

[Visual Basic]

Public ReadOnly Property ConnectionTimeout As Integer

[C#]

public int ConnectionTimeout {get;}

[Delphi]

public property ConnectionTimeout: Int32 read get_ConnectionTimeout;


C1ExpressTable.ConnectionType Property

C1ExpressTable.ConnectionType Property

Gets or sets a value determining the software (middleware or native) used to connect to the database.

[Visual Basic]

Public Property ConnectionType As ConnectionTypeEnum

[C#]

public ConnectionTypeEnum ConnectionType {get;set;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType write set_ConnectionType;


C1ExpressTable.DataAccessMode Property

C1ExpressTable.DataAccessMode Property

Gets or sets a DataAccessModeEnum value specifying static (everything fetch into memory) or virtual (fetch by segments, for a large data set) mode of operation.

[Visual Basic]

Public Property DataAccessMode As DataAccessModeEnum

[C#]

public DataAccessModeEnum DataAccessMode {get;set;}

[Delphi]

public property DataAccessMode: DataAccessModeEnum read get_DataAccessMode write set_DataAccessMode;


C1ExpressTable.DataAdapter Property

C1ExpressTable.DataAdapter Property

Returns or sets the IDBDataAdapter component used to fill and update the table with non-empty SelectCommandText.

[Visual Basic]

Public Property DataAdapter As IDbDataAdapter

[C#]

public IDbDataAdapter DataAdapter {get;set;}

[Delphi]

public property DataAdapter: IDbDataAdapter read get_DataAdapter write set_DataAdapter;


C1ExpressTable.Database Property

C1ExpressTable.Database Property

Gets the name of the current database or the database to be used once a connection is open.

[Visual Basic]

Public ReadOnly Property Database As String

[C#]

public string Database {get;}

[Delphi]

public property Database: String read get_Database;


C1ExpressTable.DataSource Property

C1ExpressTable.DataSource Property

Gets the location and file name of the data source.

[Visual Basic]

Public ReadOnly Property DataSource As String

[C#]

public string DataSource {get;}

[Delphi]

public property DataSource: String read get_DataSource;


C1ExpressTable.DbTableName Property

C1ExpressTable.DbTableName Property

Gets or sets the name of the database table.

[Visual Basic]

Public Property DbTableName As String

[C#]

public string DbTableName {get;set;}

[Delphi]

public property DbTableName: String read get_DbTableName write set_DbTableName;


C1ExpressTable.ExpressConnection Property

C1ExpressTable.ExpressConnection Property

Gets the C1ExpressionConnection component for this table.

[Visual Basic]

Public ReadOnly Property ExpressConnection As C1ExpressConnection

[C#]

public C1ExpressConnection ExpressConnection {get;}

[Delphi]

public property ExpressConnection: C1ExpressConnection read get_ExpressConnection;


C1ExpressTable.Fields Property

C1ExpressTable.Fields Property

The collection of C1ExpressTable fields.

[Visual Basic]

Public ReadOnly Property Fields As C1ExpressFieldCollection

[C#]

public C1ExpressFieldCollection Fields {get;}

[Delphi]

public property Fields: C1ExpressFieldCollection read get_Fields;


C1ExpressTable.FillFilter Property

C1ExpressTable.FillFilter Property

Gets or sets the filter criteria for filling the table with data.

[Visual Basic]

Public Property FillFilter As String

[C#]

public string FillFilter {get;set;}

[Delphi]

public property FillFilter: String read get_FillFilter write set_FillFilter;


C1ExpressTable.FillOnRequest Property

C1ExpressTable.FillOnRequest Property

Gets or sets a value indicating the table will be automatically filled with data when a data bound control requests data from it.

[Visual Basic]

Public Property FillOnRequest As Boolean

[C#]

public bool FillOnRequest {get;set;}

[Delphi]

public property FillOnRequest: Boolean read get_FillOnRequest write set_FillOnRequest;


C1ExpressTable.FillSort Property

C1ExpressTable.FillSort Property

Gets or sets the sort field or fields, and sort order for filling the table with data.

[Visual Basic]

Public Property FillSort As String

[C#]

public string FillSort {get;set;}

[Delphi]

public property FillSort: String read get_FillSort write set_FillSort;


C1ExpressTable.Provider Property

C1ExpressTable.Provider Property

For an OLE DB connection, gets the name of the OLE DB provider.

[Visual Basic]

Public ReadOnly Property Provider As String

[C#]

public string Provider {get;}

[Delphi]

public property Provider: String read get_Provider;


C1ExpressTable.ReadOnly Property

C1ExpressTable.ReadOnly Property

Gets or sets a value indicating whether changes to the rows of this table are allowed.

[Visual Basic]

Public Property ReadOnly As Boolean

[C#]

public bool ReadOnly {get;set;}

[Delphi]

public property ReadOnly: Boolean read get_ReadOnly write set_ReadOnly;


C1ExpressTable.SelectCommandText Property

C1ExpressTable.SelectCommandText Property

Gets or sets the command text (SQL statement or stored procedure) for fetching data from the database.

[Visual Basic]

Public Property SelectCommandText As String

[C#]

public string SelectCommandText {get;set;}

[Delphi]

public property SelectCommandText: String read get_SelectCommandText write set_SelectCommandText;


C1ExpressTable.SelectCommandType Property

C1ExpressTable.SelectCommandType Property

How to interpret SelectCommandText.

[Visual Basic]

Public Property SelectCommandType As CommandTypeEnum

[C#]

public CommandTypeEnum SelectCommandType {get;set;}

[Delphi]

public property SelectCommandType: CommandTypeEnum read get_SelectCommandType write set_SelectCommandType;


C1ExpressTable.TableName Property

C1ExpressTable.TableName Property

Gets or sets the name of the table as it appears to data bound controls.

[Visual Basic]

Public Property TableName As String

[C#]

public string TableName {get;set;}

[Delphi]

public property TableName: String read get_TableName write set_TableName;


C1ExpressTable.UserReadOnly Property

C1ExpressTable.UserReadOnly Property

Gets or sets a value indicating whether changes to the rows of this table using bound controls are allowed.

[Visual Basic]

Public Property UserReadOnly As Boolean

[C#]

public bool UserReadOnly {get;set;}

[Delphi]

public property UserReadOnly: Boolean read get_UserReadOnly write set_UserReadOnly;


C1ExpressTable Methods

C1ExpressTable Methods

The methods of the C1ExpressTable class are listed here. For a complete list of C1ExpressTable class members, see the C1ExpressTable Members topic.

Public Methods

MoveFirst (inherited from BaseDataTableSource) | Moves to the first row.
MoveLast (inherited from BaseDataTableSource) | Moves to the last row.
MoveNext (inherited from BaseDataTableSource) | Moves to the next row.
MovePrevious (inherited from BaseDataTableSource) | Moves to the previous row.
Seek (inherited from BaseDataTableSource) | Seeks a row by its primary key values.

Private Methods

9L (inherited from BaseDataTableSource)

9M (inherited from BaseDataTableSource)

BS (inherited from BaseDataTableSource)

BT (inherited from BaseDataTableSource)

BU (inherited from BaseDataTableSource)

BV (inherited from BaseDataTableSource)

BW (inherited from BaseDataTableSource)

BX (inherited from BaseDataTableSource)


C1ExpressTable Events

C1ExpressTable Events

The events of the C1ExpressTable class are listed here. For a complete list of C1ExpressTable class members, see the C1ExpressTable Members topic.

Public Events

AfterAddNew (inherited from BaseDataTableSource) | Fired after a new (empty) row is added.
AfterBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, after the row enters edit mode.
AfterCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, after reverting the changes made to the row.
AfterChanges (inherited from BaseDataTableSource) | Fired when all changes initiated by a field change are done and handled by the business logic code.
AfterDelete (inherited from BaseDataTableSource) | Fired after a row has been deleted.
AfterEndAddNew (inherited from BaseDataTableSource) | Fired after a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
AfterEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, after the row leaves edit mode.
AfterFieldChange (inherited from BaseDataTableSource) | Fired after a field value is set.
AfterFill | Fired after the table has been filled with data.
AfterFirstChange (inherited from BaseDataTableSource) | Fired after first change is made to a row (a field value changes) after the row last entered edit mode.
AfterGenerateSql | Fired after generating the SQL SELECT statement for fetching table data from the database.
AfterUpdateRow | Fired after modifications made to a row are commited to the database.
AsyncFetchComplete (inherited from BaseDataTableSource) | Fired in C1.Data.BaseDataTableSource.TableView = VirtualAutomatic, when all rows are fetched.
BeforeAddNew (inherited from BaseDataTableSource) | Fired before a new (empty) row is added.
BeforeBeginEdit (inherited from BaseDataTableSource) | Fired when the user starts editing a row, before the row enters edit mode.
BeforeCancelEdit (inherited from BaseDataTableSource) | Fired when the user cancels editing a row, before reverting the changes made to the row.
BeforeDelete (inherited from BaseDataTableSource) | Fired before a row is deleted.
BeforeEndAddNew (inherited from BaseDataTableSource) | Fired before a newly added row becomes a regular row in the rowset, that is, when its primary key and other required ( AllowDbNull=false) fields are specified.
BeforeEndEdit (inherited from BaseDataTableSource) | Fired when the user finishes editing a row, before the row leaves edit mode.
BeforeFieldChange (inherited from BaseDataTableSource) | Fired before a field value is set.
BeforeFill | Fired before the table is filled with data.
BeforeFirstChange (inherited from BaseDataTableSource) | Fired before first change is made to a row (a field value changes) after the row last entered edit mode.
BeforeGenerateSql | Fired before generating the SQL SELECT statement for fetching table data from the database.
BeforeUpdateRow | Fired before modifications made to a row are commited to the database.
CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.
UpdateError | Fired when errors occur in an attempt to update the database when the end user leaves a modifies row.


C1ExpressTable.AfterFill Event

C1ExpressTable.AfterFill Event

Fired after the table has been filled with data.

[Visual Basic]

Public Event AfterFill As FillEventHandler

[C#]

public event FillEventHandler AfterFill

[Delphi]

public property AfterFill: FillEventHandler read remove_AfterFill write add_AfterFill;


C1ExpressTable.AfterGenerateSql Event

C1ExpressTable.AfterGenerateSql Event

Fired after generating the SQL SELECT statement for fetching table data from the database.

[Visual Basic]

Public Event AfterGenerateSql As ExpressGenerateSqlEventHandler

[C#]

public event ExpressGenerateSqlEventHandler AfterGenerateSql

[Delphi]

public property AfterGenerateSql: ExpressGenerateSqlEventHandler read remove_AfterGenerateSql write add_AfterGenerateSql;


C1ExpressTable.AfterUpdateRow Event

C1ExpressTable.AfterUpdateRow Event

Fired after modifications made to a row are commited to the database.

[Visual Basic]

Public Event AfterUpdateRow As RowUpdateEventHandler

[C#]

public event RowUpdateEventHandler AfterUpdateRow

[Delphi]

public property AfterUpdateRow: RowUpdateEventHandler read remove_AfterUpdateRow write add_AfterUpdateRow;


C1ExpressTable.BeforeFill Event

C1ExpressTable.BeforeFill Event

Fired before the table is filled with data.

[Visual Basic]

Public Event BeforeFill As FillEventHandler

[C#]

public event FillEventHandler BeforeFill

[Delphi]

public property BeforeFill: FillEventHandler read remove_BeforeFill write add_BeforeFill;


C1ExpressTable.BeforeGenerateSql Event

C1ExpressTable.BeforeGenerateSql Event

Fired before generating the SQL SELECT statement for fetching table data from the database.

[Visual Basic]

Public Event BeforeGenerateSql As ExpressGenerateSqlEventHandler

[C#]

public event ExpressGenerateSqlEventHandler BeforeGenerateSql

[Delphi]

public property BeforeGenerateSql: ExpressGenerateSqlEventHandler read remove_BeforeGenerateSql write add_BeforeGenerateSql;


C1ExpressTable.BeforeUpdateRow Event

C1ExpressTable.BeforeUpdateRow Event

Fired before modifications made to a row are commited to the database.

[Visual Basic]

Public Event BeforeUpdateRow As RowUpdateEventHandler

[C#]

public event RowUpdateEventHandler BeforeUpdateRow

[Delphi]

public property BeforeUpdateRow: RowUpdateEventHandler read remove_BeforeUpdateRow write add_BeforeUpdateRow;


C1ExpressTable.UpdateError Event

C1ExpressTable.UpdateError Event

Fired when errors occur in an attempt to update the database when the end user leaves a modifies row.

[Visual Basic]

Public Event UpdateError As ErrorEventHandler

[C#]

public event ErrorEventHandler UpdateError

[Delphi]

public property UpdateError: ErrorEventHandler read remove_UpdateError write add_UpdateError;


C1ExpressView Class

C1ExpressView Class

For a list of all members of this type, see C1ExpressView Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.C1DataView

C1.Data.Express.C1ExpressView

[Visual Basic]

Public Class C1ExpressView

Inherits C1DataView

Implements ISupportInitialize

[C#]

public class C1ExpressView : C1DataView , ISupportInitialize

[Delphi]

type C1ExpressView = class (C1DataView, ISupportInitialize);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


C1ExpressView Members

C1ExpressView Members

C1ExpressView overview

Public Constructors

C1ExpressView Constructor

Public Properties

AllowAddNew (inherited from C1DataView) | Gets or sets a value indicating whether adding new rows to this data view is allowed.
AllowDelete (inherited from C1DataView) | Gets or sets a value indicating whether deleting rows from this data view is allowed.
AutoRefresh (inherited from C1DataView) | Gets or sets a value indicating whether the data view is automatically refreshed when one of the following properties changes: TableViewName, TableName, RowFilter, RowStateFilter, Sort.
Count (inherited from C1DataView) | Gets the total number of rows in the data view.
DataTable (inherited from C1DataView) | Gets the data table object which is the source of this data view.
DefaultDataView (inherited from C1DataView) | Gets the C1DataView component with IsDefault = True, if one is connected to this data view.
ExpressTable | Gets or sets the source C1ExpressTable component.
ExpressTableName | Gets or sets the source C1ExpressTable component name, including components residing in other forms.
IsDefault (inherited from C1DataView) | Gets or sets a value indicating whether this component's RowFilter and Sort settings are applied to any binding to the table view in the data set.
Item (inherited from C1DataView) | Gets the row at the specified index in the data view.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
ReadOnly (inherited from C1DataView) | Gets or sets a value indicating whether changes to the rows of this data view are allowed.
RowFilter (inherited from C1DataView) | Gets or sets the expression used to filter rows in the data view.
RowStateFilter (inherited from C1DataView) | Gets or sets the row state filter used in the data view.
Sort (inherited from C1DataView) | Gets or sets the sort field or fields, and sort order for the data view.

Public Methods

AddNew (inherited from C1DataView) | Adds a new row to the data view.
Delete (inherited from C1DataView) | Deletes a row from the source table view or table.
Find (inherited from C1DataView) | Overloaded. Finds a row in the data view by the specified sort key value.
Refresh (inherited from C1DataView) | Overloaded. Refreshes the collection of data view rows.

Public Events

CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
GetRows (inherited from C1DataView) | Used to programmatically specify the list of rows in a data view.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


C1ExpressView Constructor

C1ExpressView Constructor

Initializes a new instance of the C1ExpressView class.

[Visual Basic]

Public Function New()

[C#]

public C1ExpressView()

[Delphi]

public constructor Create();


C1ExpressView Properties

C1ExpressView Properties

The properties of the C1ExpressView class are listed here. For a complete list of C1ExpressView class members, see the C1ExpressView Members topic.

Public Properties

AllowAddNew (inherited from C1DataView) | Gets or sets a value indicating whether adding new rows to this data view is allowed.
AllowDelete (inherited from C1DataView) | Gets or sets a value indicating whether deleting rows from this data view is allowed.
AutoRefresh (inherited from C1DataView) | Gets or sets a value indicating whether the data view is automatically refreshed when one of the following properties changes: TableViewName, TableName, RowFilter, RowStateFilter, Sort.
Count (inherited from C1DataView) | Gets the total number of rows in the data view.
DataTable (inherited from C1DataView) | Gets the data table object which is the source of this data view.
DefaultDataView (inherited from C1DataView) | Gets the C1DataView component with IsDefault = True, if one is connected to this data view.
ExpressTable | Gets or sets the source C1ExpressTable component.
ExpressTableName | Gets or sets the source C1ExpressTable component name, including components residing in other forms.
IsDefault (inherited from C1DataView) | Gets or sets a value indicating whether this component's RowFilter and Sort settings are applied to any binding to the table view in the data set.
Item (inherited from C1DataView) | Gets the row at the specified index in the data view.
Position (inherited from BaseDataSourceComponent) | Gets or sets the current row position for controls bound to this component.
ReadOnly (inherited from C1DataView) | Gets or sets a value indicating whether changes to the rows of this data view are allowed.
RowFilter (inherited from C1DataView) | Gets or sets the expression used to filter rows in the data view.
RowStateFilter (inherited from C1DataView) | Gets or sets the row state filter used in the data view.
Sort (inherited from C1DataView) | Gets or sets the sort field or fields, and sort order for the data view.


C1ExpressView.ExpressTable Property

C1ExpressView.ExpressTable Property

Gets or sets the source C1ExpressTable component.

[Visual Basic]

Public Property ExpressTable As C1ExpressTable

[C#]

public C1ExpressTable ExpressTable {get;set;}

[Delphi]

public property ExpressTable: C1ExpressTable read get_ExpressTable write set_ExpressTable;


C1ExpressView.ExpressTableName Property

C1ExpressView.ExpressTableName Property

Gets or sets the source C1ExpressTable component name, including components residing in other forms.

[Visual Basic]

Public Property ExpressTableName As String

[C#]

public string ExpressTableName {get;set;}

[Delphi]

public property ExpressTableName: String read get_ExpressTableName write set_ExpressTableName;


C1ExpressView Methods

C1ExpressView Methods

The methods of the C1ExpressView class are listed here. For a complete list of C1ExpressView class members, see the C1ExpressView Members topic.

Public Methods

AddNew (inherited from C1DataView) | Adds a new row to the data view.
Delete (inherited from C1DataView) | Deletes a row from the source table view or table.
Find (inherited from C1DataView) | Overloaded. Finds a row in the data view by the specified sort key value.
Refresh (inherited from C1DataView) | Overloaded. Refreshes the collection of data view rows.


C1ExpressView Events

C1ExpressView Events

The events of the C1ExpressView class are listed here. For a complete list of C1ExpressView class members, see the C1ExpressView Members topic.

Public Events

CurrentRowChanged (inherited from BaseDataSourceComponent) | Fired when there are changes in the current row, whatever their cause, resulting from field change, current row change or complete data refresh.
GetRows (inherited from C1DataView) | Used to programmatically specify the list of rows in a data view.
PositionChanged (inherited from BaseDataSourceComponent) | Fired when controls bound to this component change their current row position.


ExpressGenerateSqlEventArgs Class

ExpressGenerateSqlEventArgs Class

For a list of all members of this type, see ExpressGenerateSqlEventArgs Members.

System.Object

System.EventArgs

C1.Data.GenerateSqlEventArgs

C1.Data.Express.ExpressGenerateSqlEventArgs

[Visual Basic]

Public Class ExpressGenerateSqlEventArgs

Inherits GenerateSqlEventArgs

[C#]

public class ExpressGenerateSqlEventArgs : GenerateSqlEventArgs

[Delphi]

type ExpressGenerateSqlEventArgs = class (GenerateSqlEventArgs);

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)


ExpressGenerateSqlEventArgs Members

ExpressGenerateSqlEventArgs Members

ExpressGenerateSqlEventArgs overview

Public Properties

ClauseFrom (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseOrderBy (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseSelect (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseWhere (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
Command (inherited from GenerateSqlEventArgs) | The IDbCommand object containing the generated SQL SELECT statement.
Filter (inherited from GenerateSqlEventArgs) | Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.
Sql (inherited from GenerateSqlEventArgs) | SQL statement. The programmer can set this argument in the event code to set or modify the SQL SELECT statement used for fetching data. Alternatively, the programmer can set or modify the Command argument to specify the complete command to be executed.
Status (inherited from GenerateSqlEventArgs) | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
TableName |


ExpressGenerateSqlEventArgs Properties

ExpressGenerateSqlEventArgs Properties

The properties of the ExpressGenerateSqlEventArgs class are listed here. For a complete list of ExpressGenerateSqlEventArgs class members, see the ExpressGenerateSqlEventArgs Members topic.

Public Properties

ClauseFrom (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseOrderBy (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseSelect (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
ClauseWhere (inherited from GenerateSqlEventArgs) | ClauseSelect/ClauseFrom/ClauseWhere/ClauseOrderBy are read-only properties that are available in AfterGenerateSql event (not available in BeforeGenerateSql). They contain corresponding parts of the automatically generated SQL SELECT statement (the complete statement is available in the Sql property). They can be used to modify/compose a statement, for example, to add TOP n or another clause after the SELECT clause.
Command (inherited from GenerateSqlEventArgs) | The IDbCommand object containing the generated SQL SELECT statement.
Filter (inherited from GenerateSqlEventArgs) | Filter conditions used to fill the data set. These are all filter conditions for all table views in the data set. You need to extract the filter conditions for the particular table view from this argument.
Sql (inherited from GenerateSqlEventArgs) | SQL statement. The programmer can set this argument in the event code to set or modify the SQL SELECT statement used for fetching data. Alternatively, the programmer can set or modify the Command argument to specify the complete command to be executed.
Status (inherited from GenerateSqlEventArgs) | Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.
TableName |


ExpressGenerateSqlEventArgs.TableName Property

ExpressGenerateSqlEventArgs.TableName Property

[Visual Basic]

Public ReadOnly Property TableName As String

[C#]

public string TableName {get;}

[Delphi]

public property TableName: String read get_TableName;


ExpressGenerateSqlEventHandler Delegate

ExpressGenerateSqlEventHandler Delegate

[Visual Basic]

Public Delegate Sub ExpressGenerateSqlEventHandler( _

ByVal sender As Object, _

ByVal e As ExpressGenerateSqlEventArgs _

)

[C#]

public delegate void ExpressGenerateSqlEventHandler(

object sender,

ExpressGenerateSqlEventArgs e

);

[Delphi]

type ExpressGenerateSqlEventHandler = procedure (

sender: Object;

e: ExpressGenerateSqlEventArgs

) of object;

Namespace: C1.Data.Express

Assembly: C1.Data.Express (in c1.data.express.dll)

See Also

C1.Data.Express Namespace


C1.Data.SchemaObjects Namespace

C1.Data.SchemaObjects Namespace

C1.Data.SchemaObjects Hierarchy

Classes

Class | Description
BaseTable | Base class for all tables and table views.
C1BorlandDPConnection | Represents a connection to a database using Borland Data Provider. This provider can be used in Borland C#Builder as well as in Visual Studio .NET 2003. Borland Data Provider connects to a number of popular databases.
C1CustomConnection | Represents a connection to a generic ADO.NET data provider.
C1MSOracleConnection | Represents a connection to a database, using Microsoft .NET Framework Data Provider for Oracle, classes from namespace System.Data.OracleClient.
C1OleDbConnection | Represents an OLE DB connection to a database, using OLE DB Data Provider for .NET, classes from namespace System.Data.OleDb.
C1OracleConnection | Represents a connection to a database, using Oracle Data Provider for .NET, classes from namespace Oracle.DataAccess.
C1SqlServerConnection | Represents a connection to a database, using SQL Server Data Provider for .NET, classes from namespace System.Data.SqlClient.
CacheProperties | The CacheProperties class is used to specify global cache settings for a DataSetDef using the CacheProperties property.
CompositeDefRelation | Represents an arc in a composite table definition diagram.
CompositeDefView | Represents a node in a composite table definition diagram.
CompositeRelation | Represents a relation between two tables one of which is composite.
CompositeTable | Represents a composite table.
CompositeTableDef | Represents a composite table definition diagram.
CompositeTableField | Represents a composite table field.
Connection | Base class representing a database connection.
ConnectionCollection | Represents a collection of Connection objects.
CustomProviderInfo | Containing information necessary to access a generic .NET data provider.
DataSetDef | Represents a data set definition.
DataSetDefCollection | Represents a collection of DataSetDef objects.
DbTable | Represents a simple table.
DbTableField | Represents a simple table field.
Diagram | Base class for data set diagrams ( DataSetDef) and composite table diagrams ( CompositeTableDef).
Field | The base class for TableField and TableViewField. Contains common field properties.
FieldDefaults | Contains various default settings used for fields accessed through a certain data set.
JoinCondition | Represents an equality condition between a parent and a child field of a SimpleRelation.
JoinConditionCollection | Represents a collection of JoinCondition objects of a SimpleRelation.
Relation | Base class for simple and composite relations.
RelationCollection | Represents a collection of Relation objects.
Schema | The main class of the C1.Data.SchemaObjects namespace, representing a schema.
SimpleRelation | Represents a relation between two simple tables.
SimpleTable | Base class for simple tables.
SqlDialectInfo | This class contains represents various specifics of SQL syntax relevant to C1DataObjects that can vary between different databases.
Table | Base class for simple and composite tables.
TableCollection | Represents a collection of Table objects.
TableField | The base class for DbTableField and CompositeTableField.
TableFieldCollection | Represents a collection of TableField objects.
TableView | Objects of the TableView class represent nodes in a data set definition diagram.
TableViewCollection | Represents a collection of TableView objects.
TableViewField | Represents a table view field.
TableViewFieldCollection | Represents a collection of TableViewField objects.
ViewRelation | Represents a view relation, an arc in a Diagram.
ViewRelationCollection | Represents a collection of ViewRelation objects.

Enumerations

Enumeration | Description
AutoIncrementEnum | Specifies automatic assignment of field values on adding rows to a table and to the database.
ConnectionTypeEnum | Specifies the database engine software used to connect to the database.
DataAccessModeEnum | Specifies how data is fetched from the database to a table view.
DataModeEnum | Specifies how a table is related to the database.
FieldUpdateSetModeEnum | Specifies whether field value is set in the database.
IdentityColumnRetrieveModeEnum | Indicates how autoincrement key value is retrieved for inserted row: before, after or in the same scope with the INSERT command. Used in the IdentityColumnRetrieveMode property of a connection.
ReferentialIntegrityRuleEnum | Specifies the action applied to child rows when their parent key is modified or deleted.
RelationCardinalityEnum | Specifies the cardinality of a relation.
SqlQuoteEnum | Specifies quotation rules for names in SQL statements.
SqlSyntaxEnum | Specifies general SQL syntax used by a database.
TableUpdateLocateModeEnum | Specifies which field values participate in locating the database record for update.
TableUpdateRefreshModeEnum | Specifies how refresh after update is done.
YesNoDefaultEnum | An enumeration used in property values instead of the boolean type where there is a default option (depending on the context) in addition to Yes (True) and No (False).

See Also

C1.Data Assembly


AutoIncrementEnum Enumeration

AutoIncrementEnum Enumeration

Specifies automatic assignment of field values on adding rows to a table and to the database.

[Visual Basic]

Public Enum AutoIncrementEnum

[C#]

public enum AutoIncrementEnum

[Delphi]

type AutoIncrementEnum = (Client, ClientAndServer, None, Server);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Client | The field automatically receives incremented value in a new row added to the table on the client.
ClientAndServer | The field automatically receives incremented value in a new row both in a new row added on the client and in a new row added to the database table on the server. These two values can be different. After adding the row to the database table on the server, the client value is refreshed with the value from the database table.
None | No autoincrement functionality.
Server | The field automatically receives incremented value in a new row added to the database table on the server.

See Also

C1.Data.SchemaObjects Namespace


BaseTable Class

BaseTable Class

Base class for all tables and table views.

For a list of all members of this type, see BaseTable Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.Table

C1.Data.SchemaObjects.TableView

[Visual Basic]

MustInherit Public Class BaseTable

[C#]

public abstract class BaseTable

[Delphi]

type BaseTable = class abstract;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


BaseTable Members

BaseTable Members

BaseTable overview

Public Properties

AllowAddNew | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete | Gets or sets a value indicating whether deleting rows from the table is allowed.
ConstraintsFieldLevel | Gets the collection of field level constraints.
ConstraintsRecordLevel | Gets the collection of record level constraints.
Description | Gets or sets a description for the table.
EffectiveAllowAddNew | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly | Gets the effective value of the UserReadOnly property at run time.
Name | Gets or sets the table name.
PrimaryKey | Gets the name(s) of the table primary key field(s).
ReadOnly | Gets or sets a value indicating whether modifying table data is allowed.
RowType | Gets or sets a class representing rows of this table or view.
UserReadOnly | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


BaseTable Properties

BaseTable Properties

The properties of the BaseTable class are listed here. For a complete list of BaseTable class members, see the BaseTable Members topic.

Public Properties

AllowAddNew | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete | Gets or sets a value indicating whether deleting rows from the table is allowed.
ConstraintsFieldLevel | Gets the collection of field level constraints.
ConstraintsRecordLevel | Gets the collection of record level constraints.
Description | Gets or sets a description for the table.
EffectiveAllowAddNew | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly | Gets the effective value of the UserReadOnly property at run time.
Name | Gets or sets the table name.
PrimaryKey | Gets the name(s) of the table primary key field(s).
ReadOnly | Gets or sets a value indicating whether modifying table data is allowed.
RowType | Gets or sets a class representing rows of this table or view.
UserReadOnly | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


BaseTable.AllowAddNew Property

BaseTable.AllowAddNew Property

Gets or sets a value indicating whether adding new rows to the table is allowed.

[Visual Basic]

Overridable Public Property AllowAddNew As Boolean

[C#]

virtual public bool AllowAddNew {get;set;}

[Delphi]

public property AllowAddNew: Boolean read get_AllowAddNew write set_AllowAddNew;


BaseTable.AllowDelete Property

BaseTable.AllowDelete Property

Gets or sets a value indicating whether deleting rows from the table is allowed.

[Visual Basic]

Overridable Public Property AllowDelete As Boolean

[C#]

virtual public bool AllowDelete {get;set;}

[Delphi]

public property AllowDelete: Boolean read get_AllowDelete write set_AllowDelete;


BaseTable.ConstraintsFieldLevel Property

BaseTable.ConstraintsFieldLevel Property

Gets the collection of field level constraints.

[Visual Basic]

Overridable Public ReadOnly Property ConstraintsFieldLevel As ConstraintCollection

[C#]

virtual public ConstraintCollection ConstraintsFieldLevel {get;}

[Delphi]

public property ConstraintsFieldLevel: ConstraintCollection read get_ConstraintsFieldLevel;


BaseTable.ConstraintsRecordLevel Property

BaseTable.ConstraintsRecordLevel Property

Gets the collection of record level constraints.

[Visual Basic]

Overridable Public ReadOnly Property ConstraintsRecordLevel As ConstraintCollection

[C#]

virtual public ConstraintCollection ConstraintsRecordLevel {get;}

[Delphi]

public property ConstraintsRecordLevel: ConstraintCollection read get_ConstraintsRecordLevel;


BaseTable.Description Property

BaseTable.Description Property

Gets or sets a description for the table.

[Visual Basic]

Public Property Description As String

[C#]

public string Description {get;set;}

[Delphi]

public property Description: String read get_Description write set_Description;

Remarks

This value is displayed in the Schema Designer's Information window when you select the table or table view.


BaseTable.EffectiveAllowAddNew Property

BaseTable.EffectiveAllowAddNew Property

Gets the effective value of the AllowAddNew property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveAllowAddNew As Boolean

[C#]

virtual public bool EffectiveAllowAddNew {get;}

[Delphi]

public property EffectiveAllowAddNew: Boolean read get_EffectiveAllowAddNew;

Remarks

Although a table view’s AllowAddNew property may be True, it will behave as if it is False if it is based on a table with AllowAddNew = False.


BaseTable.EffectiveAllowDelete Property

BaseTable.EffectiveAllowDelete Property

Gets the effective value of the AllowDelete property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveAllowDelete As Boolean

[C#]

virtual public bool EffectiveAllowDelete {get;}

[Delphi]

public property EffectiveAllowDelete: Boolean read get_EffectiveAllowDelete;

Remarks

Although a table view’s AllowDelete property may be True, it will behave as if it is False if it is based on a table with AllowDelete = False.


BaseTable.EffectiveReadOnly Property

BaseTable.EffectiveReadOnly Property

Gets the effective value of the ReadOnly property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveReadOnly As Boolean

[C#]

virtual public bool EffectiveReadOnly {get;}

[Delphi]

public property EffectiveReadOnly: Boolean read get_EffectiveReadOnly;

Remarks

Although a table view’s ReadOnly property may be False, it will behave as if it is True if it is based on a table with ReadOnly = True.


BaseTable.EffectiveUserReadOnly Property

BaseTable.EffectiveUserReadOnly Property

Gets the effective value of the UserReadOnly property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveUserReadOnly As Boolean

[C#]

virtual public bool EffectiveUserReadOnly {get;}

[Delphi]

public property EffectiveUserReadOnly: Boolean read get_EffectiveUserReadOnly;


BaseTable.Name Property

BaseTable.Name Property

Gets or sets the table name.

[Visual Basic]

Overridable MustInherit Public Property Name As String

[C#]

virtual abstract public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


BaseTable.PrimaryKey Property

BaseTable.PrimaryKey Property

Gets the name(s) of the table primary key field(s).

[Visual Basic]

Overridable MustInherit Public ReadOnly Property PrimaryKey As String

[C#]

virtual abstract public string PrimaryKey {get;}

[Delphi]

public property PrimaryKey: String read get_PrimaryKey;

Remarks

This property returns a comma-delimited string consisting of the names of one or more fields whose PrimaryKey property is set to True.


BaseTable.ReadOnly Property

BaseTable.ReadOnly Property

Gets or sets a value indicating whether modifying table data is allowed.

[Visual Basic]

Public Property ReadOnly As Boolean

[C#]

public bool ReadOnly {get;set;}

[Delphi]

public property ReadOnly: Boolean read get_ReadOnly write set_ReadOnly;


BaseTable.RowType Property

BaseTable.RowType Property

Gets or sets a class representing rows of this table or view.

[Visual Basic]

Overridable Public Property RowType As Type

[C#]

virtual public Type RowType {get;set;}

[Delphi]

public property RowType: Type read get_RowType write set_RowType;

Remarks

This property allows you to define a custom class representing rows of a table or table view. By default, row objects are represented by the C1DataRow class. To define a custom class, do the following:

1. In the data library dll, define a class derived from C1DataRow.

2. In the C1SchemaDef.CreateSchema event, assign this class to Table.RowType or TableView.RowType property.

If the RowType property is set for a table, simple or composite (DbTable or CompositeTable), all TableView objects based on this table will automatically use the same class, unless their RowType property is set explicitly, in which case TableView.RowType overrides the table setting.


BaseTable.UserReadOnly Property

BaseTable.UserReadOnly Property

Gets or sets a value indicating whether modifying table data in bould controls is allowed.

[Visual Basic]

Public Property UserReadOnly As Boolean

[C#]

public bool UserReadOnly {get;set;}

[Delphi]

public property UserReadOnly: Boolean read get_UserReadOnly write set_UserReadOnly;


C1BorlandDPConnection Class

C1BorlandDPConnection Class

Represents a connection to a database using Borland Data Provider. This provider can be used in Borland C#Builder as well as in Visual Studio .NET 2003. Borland Data Provider connects to a number of popular databases.

For a list of all members of this type, see C1BorlandDPConnection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1BorlandDPConnection

[Visual Basic]

Public Class C1BorlandDPConnection

Inherits Connection

[C#]

public class C1BorlandDPConnection : Connection

[Delphi]

type C1BorlandDPConnection = class (Connection);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


C1BorlandDPConnection Members

C1BorlandDPConnection Members

C1BorlandDPConnection overview

Public Constructors

C1BorlandDPConnection Constructor

Initializes a new instance of the C1BorlandDPConnection class.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.BorlandDataProvider.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1BorlandDPConnection Constructor

C1BorlandDPConnection Constructor

Overload List

Initializes a new instance of the C1BorlandDPConnection class.

[Visual Basic] Public Function New()

[C#] public C1BorlandDPConnection();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the C1BorlandDPConnection class.

[Visual Basic] Public Function New(Schema)

[C#] public C1BorlandDPConnection(Schema);

[Delphi] public constructor Create(Schema); overload;


C1BorlandDPConnection Constructor ()

C1BorlandDPConnection Constructor ()

Initializes a new instance of the C1BorlandDPConnection class.

[Visual Basic]

Public Function New()

[C#]

public C1BorlandDPConnection()

[Delphi]

public constructor Create(); overload;


C1BorlandDPConnection Constructor (Schema)

C1BorlandDPConnection Constructor (Schema)

Initializes a new instance of the C1BorlandDPConnection class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public C1BorlandDPConnection(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema to which this connection object belongs.


C1BorlandDPConnection Properties

C1BorlandDPConnection Properties

The properties of the C1BorlandDPConnection class are listed here. For a complete list of C1BorlandDPConnection class members, see the C1BorlandDPConnection Members topic.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.BorlandDataProvider.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


C1BorlandDPConnection.ConnectionType Property

C1BorlandDPConnection.ConnectionType Property

In this class this property returns ConnectionTypeEnum.BorlandDataProvider.

[Visual Basic]

Overrides Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

override public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

See the ConnectionType Property.


C1BorlandDPConnection Methods

C1BorlandDPConnection Methods

The methods of the C1BorlandDPConnection class are listed here. For a complete list of C1BorlandDPConnection class members, see the C1BorlandDPConnection Members topic.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1CustomConnection Class

C1CustomConnection Class

Represents a connection to a generic ADO.NET data provider.

For a list of all members of this type, see C1CustomConnection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1CustomConnection

[Visual Basic]

Public Class C1CustomConnection

Inherits Connection

[C#]

public class C1CustomConnection : Connection

[Delphi]

type C1CustomConnection = class (Connection);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


C1CustomConnection Members

C1CustomConnection Members

C1CustomConnection overview

Public Constructors

C1CustomConnection Constructor

Initializes a new instance of the C1CustomConnection class.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.Custom.
CustomProviderInfo | Gets the CustomProviderInfo object containing information necessary to access a generic .NET data provider.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1CustomConnection Constructor

C1CustomConnection Constructor

Overload List

Initializes a new instance of the C1CustomConnection class.

[Visual Basic] Public Function New()

[C#] public C1CustomConnection();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the C1CustomConnection class.

[Visual Basic] Public Function New(Schema)

[C#] public C1CustomConnection(Schema);

[Delphi] public constructor Create(Schema); overload;


C1CustomConnection Constructor ()

C1CustomConnection Constructor ()

Initializes a new instance of the C1CustomConnection class.

[Visual Basic]

Public Function New()

[C#]

public C1CustomConnection()

[Delphi]

public constructor Create(); overload;


C1CustomConnection Constructor (Schema)

C1CustomConnection Constructor (Schema)

Initializes a new instance of the C1CustomConnection class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public C1CustomConnection(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema to which this connection object belongs.


C1CustomConnection Properties

C1CustomConnection Properties

The properties of the C1CustomConnection class are listed here. For a complete list of C1CustomConnection class members, see the C1CustomConnection Members topic.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.Custom.
CustomProviderInfo | Gets the CustomProviderInfo object containing information necessary to access a generic .NET data provider.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


C1CustomConnection.ConnectionType Property

C1CustomConnection.ConnectionType Property

In this class this property returns ConnectionTypeEnum.Custom.

[Visual Basic]

Overrides Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

override public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

See the ConnectionType Property.


C1CustomConnection.CustomProviderInfo Property

C1CustomConnection.CustomProviderInfo Property

Gets the CustomProviderInfo object containing information necessary to access a generic .NET data provider.

[Visual Basic]

Public Property CustomProviderInfo As CustomProviderInfo

[C#]

public CustomProviderInfo CustomProviderInfo {get;set;}

[Delphi]

public property CustomProviderInfo: CustomProviderInfo read get_CustomProviderInfo write set_CustomProviderInfo;


C1CustomConnection Methods

C1CustomConnection Methods

The methods of the C1CustomConnection class are listed here. For a complete list of C1CustomConnection class members, see the C1CustomConnection Members topic.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1MSOracleConnection Class

C1MSOracleConnection Class

Represents a connection to a database, using Microsoft .NET Framework Data Provider for Oracle, classes from namespace System.Data.OracleClient.

For a list of all members of this type, see C1MSOracleConnection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1MSOracleConnection

[Visual Basic]

Public Class C1MSOracleConnection

Inherits Connection

[C#]

public class C1MSOracleConnection : Connection

[Delphi]

type C1MSOracleConnection = class (Connection);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


C1MSOracleConnection Members

C1MSOracleConnection Members

C1MSOracleConnection overview

Public Constructors

C1MSOracleConnection Constructor

Initializes a new instance of the C1MSOracleConnection class.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.MSOracle.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1MSOracleConnection Constructor

C1MSOracleConnection Constructor

Overload List

Initializes a new instance of the C1MSOracleConnection class.

[Visual Basic] Public Function New()

[C#] public C1MSOracleConnection();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the C1MSOracleConnection class.

[Visual Basic] Public Function New(Schema)

[C#] public C1MSOracleConnection(Schema);

[Delphi] public constructor Create(Schema); overload;


C1MSOracleConnection Constructor ()

C1MSOracleConnection Constructor ()

Initializes a new instance of the C1MSOracleConnection class.

[Visual Basic]

Public Function New()

[C#]

public C1MSOracleConnection()

[Delphi]

public constructor Create(); overload;


C1MSOracleConnection Constructor (Schema)

C1MSOracleConnection Constructor (Schema)

Initializes a new instance of the C1MSOracleConnection class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public C1MSOracleConnection(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema to which this connection object belongs.


C1MSOracleConnection Properties

C1MSOracleConnection Properties

The properties of the C1MSOracleConnection class are listed here. For a complete list of C1MSOracleConnection class members, see the C1MSOracleConnection Members topic.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.MSOracle.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


C1MSOracleConnection.ConnectionType Property

C1MSOracleConnection.ConnectionType Property

In this class this property returns ConnectionTypeEnum.MSOracle.

[Visual Basic]

Overrides Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

override public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

See the ConnectionType Property.


C1MSOracleConnection Methods

C1MSOracleConnection Methods

The methods of the C1MSOracleConnection class are listed here. For a complete list of C1MSOracleConnection class members, see the C1MSOracleConnection Members topic.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1OleDbConnection Class

C1OleDbConnection Class

Represents an OLE DB connection to a database, using OLE DB Data Provider for .NET, classes from namespace System.Data.OleDb.

For a list of all members of this type, see C1OleDbConnection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1OleDbConnection

[Visual Basic]

Public Class C1OleDbConnection

Inherits Connection

[C#]

public class C1OleDbConnection : Connection

[Delphi]

type C1OleDbConnection = class (Connection);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


C1OleDbConnection Members

C1OleDbConnection Members

C1OleDbConnection overview

Public Constructors

C1OleDbConnection Constructor

Initializes a new instance of the C1OleDbConnection class.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.OleDb.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1OleDbConnection Constructor

C1OleDbConnection Constructor

Overload List

Initializes a new instance of the C1OleDbConnection class.

[Visual Basic] Public Function New()

[C#] public C1OleDbConnection();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the C1OleDbConnection class.

[Visual Basic] Public Function New(Schema)

[C#] public C1OleDbConnection(Schema);

[Delphi] public constructor Create(Schema); overload;


C1OleDbConnection Constructor ()

C1OleDbConnection Constructor ()

Initializes a new instance of the C1OleDbConnection class.

[Visual Basic]

Public Function New()

[C#]

public C1OleDbConnection()

[Delphi]

public constructor Create(); overload;


C1OleDbConnection Constructor (Schema)

C1OleDbConnection Constructor (Schema)

Initializes a new instance of the C1OleDbConnection class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public C1OleDbConnection(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema to which this connection object belongs.


C1OleDbConnection Properties

C1OleDbConnection Properties

The properties of the C1OleDbConnection class are listed here. For a complete list of C1OleDbConnection class members, see the C1OleDbConnection Members topic.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.OleDb.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


C1OleDbConnection.ConnectionType Property

C1OleDbConnection.ConnectionType Property

In this class this property returns ConnectionTypeEnum.OleDb.

[Visual Basic]

Overrides Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

override public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

See the ConnectionType Property.


C1OleDbConnection Methods

C1OleDbConnection Methods

The methods of the C1OleDbConnection class are listed here. For a complete list of C1OleDbConnection class members, see the C1OleDbConnection Members topic.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1OracleConnection Class

C1OracleConnection Class

Represents a connection to a database, using Oracle Data Provider for .NET, classes from namespace Oracle.DataAccess.

For a list of all members of this type, see C1OracleConnection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1OracleConnection

[Visual Basic]

Public Class C1OracleConnection

Inherits Connection

[C#]

public class C1OracleConnection : Connection

[Delphi]

type C1OracleConnection = class (Connection);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


C1OracleConnection Members

C1OracleConnection Members

C1OracleConnection overview

Public Constructors

C1OracleConnection Constructor

Initializes a new instance of the C1OracleConnection class.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.Oracle.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1OracleConnection Constructor

C1OracleConnection Constructor

Overload List

Initializes a new instance of the C1OracleConnection class.

[Visual Basic] Public Function New()

[C#] public C1OracleConnection();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the C1OracleConnection class.

[Visual Basic] Public Function New(Schema)

[C#] public C1OracleConnection(Schema);

[Delphi] public constructor Create(Schema); overload;


C1OracleConnection Constructor ()

C1OracleConnection Constructor ()

Initializes a new instance of the C1OracleConnection class.

[Visual Basic]

Public Function New()

[C#]

public C1OracleConnection()

[Delphi]

public constructor Create(); overload;


C1OracleConnection Constructor (Schema)

C1OracleConnection Constructor (Schema)

Initializes a new instance of the C1OracleConnection class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public C1OracleConnection(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema to which this connection object belongs.


C1OracleConnection Properties

C1OracleConnection Properties

The properties of the C1OracleConnection class are listed here. For a complete list of C1OracleConnection class members, see the C1OracleConnection Members topic.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.Oracle.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


C1OracleConnection.ConnectionType Property

C1OracleConnection.ConnectionType Property

In this class this property returns ConnectionTypeEnum.Oracle.

[Visual Basic]

Overrides Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

override public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

See the ConnectionType Property.


C1OracleConnection Methods

C1OracleConnection Methods

The methods of the C1OracleConnection class are listed here. For a complete list of C1OracleConnection class members, see the C1OracleConnection Members topic.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1SqlServerConnection Class

C1SqlServerConnection Class

Represents a connection to a database, using SQL Server Data Provider for .NET, classes from namespace System.Data.SqlClient.

For a list of all members of this type, see C1SqlServerConnection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1SqlServerConnection

[Visual Basic]

Public Class C1SqlServerConnection

Inherits Connection

[C#]

public class C1SqlServerConnection : Connection

[Delphi]

type C1SqlServerConnection = class (Connection);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


C1SqlServerConnection Members

C1SqlServerConnection Members

C1SqlServerConnection overview

Public Constructors

C1SqlServerConnection Constructor

Initializes a new instance of the C1SqlServerConnection class.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.SqlServer.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


C1SqlServerConnection Constructor

C1SqlServerConnection Constructor

Overload List

Initializes a new instance of the C1SqlServerConnection class.

[Visual Basic] Public Function New()

[C#] public C1SqlServerConnection();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the C1SqlServerConnection class.

[Visual Basic] Public Function New(Schema)

[C#] public C1SqlServerConnection(Schema);

[Delphi] public constructor Create(Schema); overload;


C1SqlServerConnection Constructor ()

C1SqlServerConnection Constructor ()

Initializes a new instance of the C1SqlServerConnection class.

[Visual Basic]

Public Function New()

[C#]

public C1SqlServerConnection()

[Delphi]

public constructor Create(); overload;


C1SqlServerConnection Constructor (Schema)

C1SqlServerConnection Constructor (Schema)

Initializes a new instance of the C1SqlServerConnection class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public C1SqlServerConnection(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema to which this connection object belongs.


C1SqlServerConnection Properties

C1SqlServerConnection Properties

The properties of the C1SqlServerConnection class are listed here. For a complete list of C1SqlServerConnection class members, see the C1SqlServerConnection Members topic.

Public Properties

CommandTimeout (inherited from Connection) | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString (inherited from Connection) | Gets or sets the string used to connect to a database.
ConnectionType | Overriden. In this class this property returns ConnectionTypeEnum.SqlServer.
DbConnection (inherited from Connection) | Gets .NET IDbConnection object representing open connection.
DbTransaction (inherited from Connection) | Gets .NET IDbTransaction object representing current transaction.
Description (inherited from Connection) | Gets or sets a description for the connection.
Name (inherited from Connection) | Gets or sets the name of the connection object.
Schema (inherited from Connection) | Gets the schema to which the connection object belongs.
SqlInfo (inherited from Connection) | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


C1SqlServerConnection.ConnectionType Property

C1SqlServerConnection.ConnectionType Property

In this class this property returns ConnectionTypeEnum.SqlServer.

[Visual Basic]

Overrides Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

override public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

See the ConnectionType Property.


C1SqlServerConnection Methods

C1SqlServerConnection Methods

The methods of the C1SqlServerConnection class are listed here. For a complete list of C1SqlServerConnection class members, see the C1SqlServerConnection Members topic.

Public Methods

BeginTransaction (inherited from Connection) | Starts a transaction on the connection object.
Clone (inherited from Connection) | Creates a copy of the connection object, with the same Name and other properties.
Close (inherited from Connection) | Closes database connection.
CommitTransaction (inherited from Connection) | Commits the current transaction.
Open (inherited from Connection) | Opens database connection.
RollbackTransaction (inherited from Connection) | Rolls back the current transaction.


CacheProperties Class

CacheProperties Class

The CacheProperties class is used to specify global cache settings for a DataSetDef using the CacheProperties property.

For a list of all members of this type, see CacheProperties Members.

System.Object

C1.Data.SchemaObjects.CacheProperties

[Visual Basic]

Public Class CacheProperties

[C#]

public class CacheProperties

[Delphi]

type CacheProperties = class;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CacheProperties Members

CacheProperties Members

CacheProperties overview

Public Properties

CacheCompressed | Gets or sets a value indicating whether the data in cache should be compressed.
CacheMode | Gets or sets a value indicating under what conditions caching is enabled.
CacheStorage | Gets or sets the storage medium used to cache data.
CacheStoragePath | Gets or sets the path for storing cache data files, if CacheStorage = File.
ChangesCacheCompressed | Gets or sets a value indicating whether the cached changes should be compressed.
ChangesCacheStorage | Gets or sets the storage medium used to cache changes made by the user.
ChangesCacheStoragePath | Gets or sets the path for storing cached changes, if ChangesCacheMode = File.
MaxCount | Gets or sets the maximum number of data sets that can be stored in the cache for this DataSetDef.
PoolSize | Gets or sets the maximum number of data set objects that can be used simultaneously for fetching data by different threads on a server. PoolSize = 0 means object pool is disabled.
PoolTimeout | Gets or sets the number of seconds to wait while all existing data set objects are busy serving other threads on the server and a new object cannot be created because there the PoolSize limit is already reached. PoolTimeout = 0 means wait indefinitely.


CacheProperties Properties

CacheProperties Properties

The properties of the CacheProperties class are listed here. For a complete list of CacheProperties class members, see the CacheProperties Members topic.

Public Properties

CacheCompressed | Gets or sets a value indicating whether the data in cache should be compressed.
CacheMode | Gets or sets a value indicating under what conditions caching is enabled.
CacheStorage | Gets or sets the storage medium used to cache data.
CacheStoragePath | Gets or sets the path for storing cache data files, if CacheStorage = File.
ChangesCacheCompressed | Gets or sets a value indicating whether the cached changes should be compressed.
ChangesCacheStorage | Gets or sets the storage medium used to cache changes made by the user.
ChangesCacheStoragePath | Gets or sets the path for storing cached changes, if ChangesCacheMode = File.
MaxCount | Gets or sets the maximum number of data sets that can be stored in the cache for this DataSetDef.
PoolSize | Gets or sets the maximum number of data set objects that can be used simultaneously for fetching data by different threads on a server. PoolSize = 0 means object pool is disabled.
PoolTimeout | Gets or sets the number of seconds to wait while all existing data set objects are busy serving other threads on the server and a new object cannot be created because there the PoolSize limit is already reached. PoolTimeout = 0 means wait indefinitely.


CacheProperties.CacheCompressed Property

CacheProperties.CacheCompressed Property

Gets or sets a value indicating whether the data in cache should be compressed.

[Visual Basic]

Public Property CacheCompressed As Boolean

[C#]

public bool CacheCompressed {get;set;}

[Delphi]

public property CacheCompressed: Boolean read get_CacheCompressed write set_CacheCompressed;


CacheProperties.CacheMode Property

CacheProperties.CacheMode Property

Gets or sets a value indicating under what conditions caching is enabled.

[Visual Basic]

Public Property CacheMode As CacheModeEnum

[C#]

public CacheModeEnum CacheMode {get;set;}

[Delphi]

public property CacheMode: CacheModeEnum read get_CacheMode write set_CacheMode;


CacheProperties.CacheStorage Property

CacheProperties.CacheStorage Property

Gets or sets the storage medium used to cache data.

[Visual Basic]

Public Property CacheStorage As CacheStorageEnum

[C#]

public CacheStorageEnum CacheStorage {get;set;}

[Delphi]

public property CacheStorage: CacheStorageEnum read get_CacheStorage write set_CacheStorage;


CacheProperties.CacheStoragePath Property

CacheProperties.CacheStoragePath Property

Gets or sets the path for storing cache data files, if CacheStorage = File.

[Visual Basic]

Public Property CacheStoragePath As String

[C#]

public string CacheStoragePath {get;set;}

[Delphi]

public property CacheStoragePath: String read get_CacheStoragePath write set_CacheStoragePath;


CacheProperties.ChangesCacheCompressed Property

CacheProperties.ChangesCacheCompressed Property

Gets or sets a value indicating whether the cached changes should be compressed.

[Visual Basic]

Public Property ChangesCacheCompressed As Boolean

[C#]

public bool ChangesCacheCompressed {get;set;}

[Delphi]

public property ChangesCacheCompressed: Boolean read get_ChangesCacheCompressed write set_ChangesCacheCompressed;


CacheProperties.ChangesCacheStorage Property

CacheProperties.ChangesCacheStorage Property

Gets or sets the storage medium used to cache changes made by the user.

[Visual Basic]

Public Property ChangesCacheStorage As CacheStorageEnum

[C#]

public CacheStorageEnum ChangesCacheStorage {get;set;}

[Delphi]

public property ChangesCacheStorage: CacheStorageEnum read get_ChangesCacheStorage write set_ChangesCacheStorage;


CacheProperties.ChangesCacheStoragePath Property

CacheProperties.ChangesCacheStoragePath Property

Gets or sets the path for storing cached changes, if ChangesCacheMode = File.

[Visual Basic]

Public Property ChangesCacheStoragePath As String

[C#]

public string ChangesCacheStoragePath {get;set;}

[Delphi]

public property ChangesCacheStoragePath: String read get_ChangesCacheStoragePath write set_ChangesCacheStoragePath;


CacheProperties.MaxCount Property

CacheProperties.MaxCount Property

Gets or sets the maximum number of data sets that can be stored in the cache for this DataSetDef.

[Visual Basic]

Public Property MaxCount As Integer

[C#]

public int MaxCount {get;set;}

[Delphi]

public property MaxCount: Int32 read get_MaxCount write set_MaxCount;


CacheProperties.PoolSize Property

CacheProperties.PoolSize Property

Gets or sets the maximum number of data set objects that can be used simultaneously for fetching data by different threads on a server. PoolSize = 0 means object pool is disabled.

[Visual Basic]

Public Property PoolSize As Integer

[C#]

public int PoolSize {get;set;}

[Delphi]

public property PoolSize: Int32 read get_PoolSize write set_PoolSize;


CacheProperties.PoolTimeout Property

CacheProperties.PoolTimeout Property

Gets or sets the number of seconds to wait while all existing data set objects are busy serving other threads on the server and a new object cannot be created because there the PoolSize limit is already reached. PoolTimeout = 0 means wait indefinitely.

[Visual Basic]

Public Property PoolTimeout As Integer

[C#]

public int PoolTimeout {get;set;}

[Delphi]

public property PoolTimeout: Int32 read get_PoolTimeout write set_PoolTimeout;


CompositeDefRelation Class

CompositeDefRelation Class

Represents an arc in a composite table definition diagram.

For a list of all members of this type, see CompositeDefRelation Members.

System.Object

C1.Data.SchemaObjects.ViewRelation

C1.Data.SchemaObjects.CompositeDefRelation

[Visual Basic]

Public Class CompositeDefRelation

Inherits ViewRelation

[C#]

public class CompositeDefRelation : ViewRelation

[Delphi]

type CompositeDefRelation = class (ViewRelation);

Remarks

It is a view relation, based on a table relation between two constituent tables.

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CompositeDefRelation Members

CompositeDefRelation Members

CompositeDefRelation overview

Public Constructors

CompositeDefRelation Constructor

Initializes a new instance of the CompositeDefRelation class.

Public Properties

Cardinality (inherited from ViewRelation) | Gets view relation cardinality, which is determined by the relation cardinality with possible inversion.
Child (inherited from ViewRelation) | Gets or sets the child table view.
Description (inherited from ViewRelation) | Gets or sets a description for the view relation.
Diagram (inherited from ViewRelation) | Gets the diagram this view relation belongs to.
Name (inherited from ViewRelation) | Gets or sets the name of the view relation.
OuterJoinInManyToOne | Overriden. Gets or sets a value indicating whether to use outer join in generated SQL , if Cardinality = ManyToOne.
Parent (inherited from ViewRelation) | Gets or sets the parent table view.
Relation (inherited from ViewRelation) | Gets or sets the relation between tables this view relation is based on.


CompositeDefRelation Constructor

CompositeDefRelation Constructor

Overload List

Initializes a new instance of the CompositeDefRelation class.

[Visual Basic] Public Function New()

[C#] public CompositeDefRelation();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the CompositeDefRelation class.

[Visual Basic] Public Function New(Diagram, Relation)

[C#] public CompositeDefRelation(Diagram, Relation);

[Delphi] public constructor Create(Diagram; Relation); overload;


CompositeDefRelation Constructor ()

CompositeDefRelation Constructor ()

Initializes a new instance of the CompositeDefRelation class.

[Visual Basic]

Public Function New()

[C#]

public CompositeDefRelation()

[Delphi]

public constructor Create(); overload;


CompositeDefRelation Constructor (Diagram, Relation)

CompositeDefRelation Constructor (Diagram, Relation)

Initializes a new instance of the CompositeDefRelation class.

[Visual Basic]

Public Function New( _

ByVal diagram As Diagram, _

ByVal relation As Relation _

)

[C#]

public CompositeDefRelation(

Diagram diagram,

Relation relation

);

[Delphi]

public constructor Create(

diagram: Diagram;

relation: Relation

); overload;

Parameters

diagram

Diagram to which this view relation belongs.

relation

Relation between tables on which this view relation is based.


CompositeDefRelation Properties

CompositeDefRelation Properties

The properties of the CompositeDefRelation class are listed here. For a complete list of CompositeDefRelation class members, see the CompositeDefRelation Members topic.

Public Properties

Cardinality (inherited from ViewRelation) | Gets view relation cardinality, which is determined by the relation cardinality with possible inversion.
Child (inherited from ViewRelation) | Gets or sets the child table view.
Description (inherited from ViewRelation) | Gets or sets a description for the view relation.
Diagram (inherited from ViewRelation) | Gets the diagram this view relation belongs to.
Name (inherited from ViewRelation) | Gets or sets the name of the view relation.
OuterJoinInManyToOne | Overriden. Gets or sets a value indicating whether to use outer join in generated SQL , if Cardinality = ManyToOne.
Parent (inherited from ViewRelation) | Gets or sets the parent table view.
Relation (inherited from ViewRelation) | Gets or sets the relation between tables this view relation is based on.


CompositeDefRelation.OuterJoinInManyToOne Property

CompositeDefRelation.OuterJoinInManyToOne Property

Gets or sets a value indicating whether to use outer join in generated SQL , if Cardinality = ManyToOne.

[Visual Basic]

Overrides Public Property OuterJoinInManyToOne As Boolean

[C#]

override public bool OuterJoinInManyToOne {get;set;}

[Delphi]

public property OuterJoinInManyToOne: Boolean read get_OuterJoinInManyToOne write set_OuterJoinInManyToOne;

Remarks

This property has effect only for many-to-one relations ( Cardinality = ManyToOne).

The default value is True. This means that a many-to-one relation in a composite table diagram generates outer joins in the SQL statement. This ensures the standard interpretation of many-to-one links, where the child table contains one row corresponding to the parent row, or none. If there are no corresponding row, the child fields receive null values. However, some databases do not implement outer joins, or implement them inadequately, with various limitations (as, for example, MS Access). In this case, and when outer joins are undesirable for other reasons, you can set this property to False. Then C1DataObjects will use inner join for this view relation in the composite table diagram.


CompositeDefView Class

CompositeDefView Class

Represents a node in a composite table definition diagram.

For a list of all members of this type, see CompositeDefView Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.TableView

C1.Data.SchemaObjects.CompositeDefView

[Visual Basic]

Public Class CompositeDefView

Inherits TableView

[C#]

public class CompositeDefView : TableView

[Delphi]

type CompositeDefView = class (TableView);

Remarks

It is a table view, based on a table object, one of constituent tables.

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CompositeDefView Members

CompositeDefView Members

CompositeDefView overview

Public Constructors

CompositeDefView Constructor

Initializes a new instance of the CompositeDefView class.

Public Properties

Alias | Overriden. Gets or sets the alias used for this table view in the SQL statement generated for fetching rows into the composite table.
AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
Description (inherited from BaseTable) | Gets or sets a description for the table.
Diagram (inherited from TableView) | Gets the diagram this table view belongs to.
FetchIndex (inherited from TableView) | Gets or sets fetch order of the table view.
Fields (inherited from TableView) | Gets the field collection of the table view.
MemoryResident (inherited from TableView) | This property is used in ComponentOne WebData for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.
Name (inherited from TableView) | Gets or sets the name of the table view.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
Table (inherited from TableView) | Gets the table this table view is based on.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.

Public Methods

RetrieveFields (inherited from TableView)

Retrieves table view fields from table specified in the Table property.


CompositeDefView Constructor

CompositeDefView Constructor

Overload List

Initializes a new instance of the CompositeDefView class.

[Visual Basic] Public Function New()

[C#] public CompositeDefView();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the CompositeDefView class.

[Visual Basic] Public Function New(Diagram, Table)

[C#] public CompositeDefView(Diagram, Table);

[Delphi] public constructor Create(Diagram; Table); overload;

Initializes a new instance of the CompositeDefView class.

[Visual Basic] Public Function New(Diagram, Table, C1DataRow)

[C#] public CompositeDefView(Diagram, Table, C1DataRow);

[Delphi] public constructor Create(Diagram; Table; C1DataRow); overload;


CompositeDefView Constructor ()

CompositeDefView Constructor ()

Initializes a new instance of the CompositeDefView class.

[Visual Basic]

Public Function New()

[C#]

public CompositeDefView()

[Delphi]

public constructor Create(); overload;


CompositeDefView Constructor (Diagram, Table)

CompositeDefView Constructor (Diagram, Table)

Initializes a new instance of the CompositeDefView class.

[Visual Basic]

Public Function New( _

ByVal diagram As Diagram, _

ByVal table As Table _

)

[C#]

public CompositeDefView(

Diagram diagram,

Table table

);

[Delphi]

public constructor Create(

diagram: Diagram;

table: Table

); overload;

Parameters

diagram

Diagram the table view belongs to.

table

Table the table view is based on.


CompositeDefView Constructor (Diagram, Table, C1DataRow)

CompositeDefView Constructor (Diagram, Table, C1DataRow)

Initializes a new instance of the CompositeDefView class.

[Visual Basic]

Public Function New( _

ByVal diagram As Diagram, _

ByVal table As Table, _

ByVal userObjPrototype As C1DataRow _

)

[C#]

public CompositeDefView(

Diagram diagram,

Table table,

C1DataRow userObjPrototype

);

[Delphi]

public constructor Create(

diagram: Diagram;

table: Table;

userObjPrototype: C1DataRow

); overload;

Parameters

diagram

Diagram the table view belongs to.

table

Table the table view is based on.

userObjPrototype

Custom row's prototype.


CompositeDefView Properties

CompositeDefView Properties

The properties of the CompositeDefView class are listed here. For a complete list of CompositeDefView class members, see the CompositeDefView Members topic.

Public Properties

Alias | Overriden. Gets or sets the alias used for this table view in the SQL statement generated for fetching rows into the composite table.
AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
Description (inherited from BaseTable) | Gets or sets a description for the table.
Diagram (inherited from TableView) | Gets the diagram this table view belongs to.
FetchIndex (inherited from TableView) | Gets or sets fetch order of the table view.
Fields (inherited from TableView) | Gets the field collection of the table view.
MemoryResident (inherited from TableView) | This property is used in ComponentOne WebData for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.
Name (inherited from TableView) | Gets or sets the name of the table view.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
Table (inherited from TableView) | Gets the table this table view is based on.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


CompositeDefView.Alias Property

CompositeDefView.Alias Property

Gets or sets the alias used for this table view in the SQL statement generated for fetching rows into the composite table.

[Visual Basic]

Overrides Public Property Alias As String

[C#]

override public string Alias {get;set;}

[Delphi]

public property Alias: String read get_Alias write set_Alias;

Remarks

The default value is empty string.

Generated SQL statement must use aliases for constituent simple tables, because a table can occur more than once in a composite table diagram, so its name may be not unique in the statement, in which case it needs aliasing. By default, view table names are used as aliases, but if you want to change the default alias, you can set it.

This is rarely needed, this property is supported only for completeness, since all other names in the generated SQL statement can be controlled by developers using DbTableName and DbFieldName.


CompositeDefView Methods

CompositeDefView Methods

The methods of the CompositeDefView class are listed here. For a complete list of CompositeDefView class members, see the CompositeDefView Members topic.

Public Methods

RetrieveFields (inherited from TableView)

Retrieves table view fields from table specified in the Table property.


CompositeRelation Class

CompositeRelation Class

Represents a relation between two tables one of which is composite.

For a list of all members of this type, see CompositeRelation Members.

System.Object

C1.Data.SchemaObjects.Relation

C1.Data.SchemaObjects.CompositeRelation

[Visual Basic]

Public Class CompositeRelation

Inherits Relation

[C#]

public class CompositeRelation : Relation

[Delphi]

type CompositeRelation = class (Relation);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CompositeRelation Members

CompositeRelation Members

CompositeRelation overview

Public Constructors

CompositeRelation Constructor

Initializes a new instance of the CompositeRelation class.

Public Properties

Cardinality (inherited from Relation) | Gets or sets one of the two RelationCardinalityEnum values.
Child (inherited from Relation) | Gets or sets the child table of the relation.
ChildTableView | Gets or sets the table view in the Child composite table that is used as the child table for the SimpleRelation.
Description (inherited from Relation) | Gets or sets a description for the relation.
Name (inherited from Relation) | Gets or sets the relation name.
Parent (inherited from Relation) | Gets or sets the parent table of the relation.
ParentTableView | Gets or sets the table view in the Parent composite table that is used as the parent table for the SimpleRelation.
Schema (inherited from Relation) | Gets the schema the relation belongs to.
SimpleRelation | Gets or sets the SimpleRelation on which this composite relation is based.


CompositeRelation Constructor

CompositeRelation Constructor

Overload List

Initializes a new instance of the CompositeRelation class.

[Visual Basic] Public Function New()

[C#] public CompositeRelation();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the CompositeRelation class.

[Visual Basic] Public Function New(Schema)

[C#] public CompositeRelation(Schema);

[Delphi] public constructor Create(Schema); overload;

Initializes a new instance of the CompositeRelation class.

[Visual Basic] Public Function New(SimpleRelation, Table, Table)

[C#] public CompositeRelation(SimpleRelation, Table, Table);

[Delphi] public constructor Create(SimpleRelation; Table; Table); overload;


CompositeRelation Constructor ()

CompositeRelation Constructor ()

Initializes a new instance of the CompositeRelation class.

[Visual Basic]

Public Function New()

[C#]

public CompositeRelation()

[Delphi]

public constructor Create(); overload;


CompositeRelation Constructor (Schema)

CompositeRelation Constructor (Schema)

Initializes a new instance of the CompositeRelation class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public CompositeRelation(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema the relation belongs to.


CompositeRelation Constructor (SimpleRelation, Table, Table)

CompositeRelation Constructor (SimpleRelation, Table, Table)

Initializes a new instance of the CompositeRelation class.

[Visual Basic]

Public Function New( _

ByVal simpleRel As SimpleRelation, _

ByVal parentTable As Table, _

ByVal childTable As Table _

)

[C#]

public CompositeRelation(

SimpleRelation simpleRel,

Table parentTable,

Table childTable

);

[Delphi]

public constructor Create(

simpleRel: SimpleRelation;

parentTable: Table;

childTable: Table

); overload;

Parameters

simpleRel

Simple relation on which the composite relation is based.

parentTable

Parent table of the relation.

childTable

Child table of the relation.


CompositeRelation Properties

CompositeRelation Properties

The properties of the CompositeRelation class are listed here. For a complete list of CompositeRelation class members, see the CompositeRelation Members topic.

Public Properties

Cardinality (inherited from Relation) | Gets or sets one of the two RelationCardinalityEnum values.
Child (inherited from Relation) | Gets or sets the child table of the relation.
ChildTableView | Gets or sets the table view in the Child composite table that is used as the child table for the SimpleRelation.
Description (inherited from Relation) | Gets or sets a description for the relation.
Name (inherited from Relation) | Gets or sets the relation name.
Parent (inherited from Relation) | Gets or sets the parent table of the relation.
ParentTableView | Gets or sets the table view in the Parent composite table that is used as the parent table for the SimpleRelation.
Schema (inherited from Relation) | Gets the schema the relation belongs to.
SimpleRelation | Gets or sets the SimpleRelation on which this composite relation is based.


CompositeRelation.ChildTableView Property

CompositeRelation.ChildTableView Property

Gets or sets the table view in the Child composite table that is used as the child table for the SimpleRelation.

[Visual Basic]

Public Property ChildTableView As TableView

[C#]

public TableView ChildTableView {get;set;}

[Delphi]

public property ChildTableView: TableView read get_ChildTableView write set_ChildTableView;


CompositeRelation.ParentTableView Property

CompositeRelation.ParentTableView Property

Gets or sets the table view in the Parent composite table that is used as the parent table for the SimpleRelation.

[Visual Basic]

Public Property ParentTableView As TableView

[C#]

public TableView ParentTableView {get;set;}

[Delphi]

public property ParentTableView: TableView read get_ParentTableView write set_ParentTableView;


CompositeRelation.SimpleRelation Property

CompositeRelation.SimpleRelation Property

Gets or sets the SimpleRelation on which this composite relation is based.

[Visual Basic]

Public Property SimpleRelation As SimpleRelation

[C#]

public SimpleRelation SimpleRelation {get;set;}

[Delphi]

public property SimpleRelation: SimpleRelation read get_SimpleRelation write set_SimpleRelation;


CompositeTable Class

CompositeTable Class

Represents a composite table.

For a list of all members of this type, see CompositeTable Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.Table

C1.Data.SchemaObjects.CompositeTable

[Visual Basic]

Public Class CompositeTable

Inherits Table

[C#]

public class CompositeTable : Table

[Delphi]

type CompositeTable = class (Table);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CompositeTable Members

CompositeTable Members

CompositeTable overview

Public Constructors

CompositeTable Constructor

Initializes a new instance of the CompositeTable class.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
AllowMultipleConnections | Gets or sets a value indicating whether constituent tables are allowed to use different connections.
CompositeTableDef | Gets the composite table definition diagram.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields (inherited from Table) | Gets the collection of table fields.
Name (inherited from Table) | Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema (inherited from Table) | Gets the schema to which the table belongs.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


CompositeTable Constructor

CompositeTable Constructor

Overload List

Initializes a new instance of the CompositeTable class.

[Visual Basic] Public Function New()

[C#] public CompositeTable();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the CompositeTable class.

[Visual Basic] Public Function New(Schema)

[C#] public CompositeTable(Schema);

[Delphi] public constructor Create(Schema); overload;

Initializes a new instance of the CompositeTable class.

[Visual Basic] Public Function New(Schema, C1DataRow)

[C#] public CompositeTable(Schema, C1DataRow);

[Delphi] public constructor Create(Schema; C1DataRow); overload;


CompositeTable Constructor ()

CompositeTable Constructor ()

Initializes a new instance of the CompositeTable class.

[Visual Basic]

Public Function New()

[C#]

public CompositeTable()

[Delphi]

public constructor Create(); overload;


CompositeTable Constructor (Schema)

CompositeTable Constructor (Schema)

Initializes a new instance of the CompositeTable class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public CompositeTable(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema the table belongs to.


CompositeTable Constructor (Schema, C1DataRow)

CompositeTable Constructor (Schema, C1DataRow)

Initializes a new instance of the CompositeTable class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema, _

ByVal userObjPrototype As C1DataRow _

)

[C#]

public CompositeTable(

Schema schema,

C1DataRow userObjPrototype

);

[Delphi]

public constructor Create(

schema: Schema;

userObjPrototype: C1DataRow

); overload;

Parameters

schema

Schema the table belongs to.

userObjPrototype

Custom class representing rows of a table or table view.


CompositeTable Properties

CompositeTable Properties

The properties of the CompositeTable class are listed here. For a complete list of CompositeTable class members, see the CompositeTable Members topic.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
AllowMultipleConnections | Gets or sets a value indicating whether constituent tables are allowed to use different connections.
CompositeTableDef | Gets the composite table definition diagram.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields (inherited from Table) | Gets the collection of table fields.
Name (inherited from Table) | Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema (inherited from Table) | Gets the schema to which the table belongs.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


CompositeTable.AllowMultipleConnections Property

CompositeTable.AllowMultipleConnections Property

Gets or sets a value indicating whether constituent tables are allowed to use different connections.

[Visual Basic]

Public Property AllowMultipleConnections As Boolean

[C#]

public bool AllowMultipleConnections {get;set;}

[Delphi]

public property AllowMultipleConnections: Boolean read get_AllowMultipleConnections write set_AllowMultipleConnections;


CompositeTable.CompositeTableDef Property

CompositeTable.CompositeTableDef Property

Gets the composite table definition diagram.

[Visual Basic]

Public Property CompositeTableDef As CompositeTableDef

[C#]

public CompositeTableDef CompositeTableDef {get;set;}

[Delphi]

public property CompositeTableDef: CompositeTableDef read get_CompositeTableDef write set_CompositeTableDef;


CompositeTableDef Class

CompositeTableDef Class

Represents a composite table definition diagram.

For a list of all members of this type, see CompositeTableDef Members.

System.Object

C1.Data.SchemaObjects.Diagram

C1.Data.SchemaObjects.CompositeTableDef

[Visual Basic]

Public Class CompositeTableDef

Inherits Diagram

[C#]

public class CompositeTableDef : Diagram

[Delphi]

type CompositeTableDef = class (Diagram);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CompositeTableDef Members

CompositeTableDef Members

CompositeTableDef overview

Public Properties

CompositeTable | Gets the composite table the diagram belongs to.
Name (inherited from Diagram) | Gets or sets the name of the diagram object.
Schema (inherited from Diagram) | Gets the schema the diagram belongs to.
TableViews | Overriden. Gets the collection of table views.
ViewRelations | Overriden. Gets the collection of view relations.


CompositeTableDef Properties

CompositeTableDef Properties

The properties of the CompositeTableDef class are listed here. For a complete list of CompositeTableDef class members, see the CompositeTableDef Members topic.

Public Properties

CompositeTable | Gets the composite table the diagram belongs to.
Name (inherited from Diagram) | Gets or sets the name of the diagram object.
Schema (inherited from Diagram) | Gets the schema the diagram belongs to.
TableViews | Overriden. Gets the collection of table views.
ViewRelations | Overriden. Gets the collection of view relations.


CompositeTableDef.CompositeTable Property

CompositeTableDef.CompositeTable Property

Gets the composite table the diagram belongs to.

[Visual Basic]

Public ReadOnly Property CompositeTable As CompositeTable

[C#]

public CompositeTable CompositeTable {get;}

[Delphi]

public property CompositeTable: CompositeTable read get_CompositeTable;


CompositeTableDef.TableViews Property

CompositeTableDef.TableViews Property

Gets the collection of table views.

[Visual Basic]

Overrides Public ReadOnly Property TableViews As TableViewCollection

[C#]

override public TableViewCollection TableViews {get;}

[Delphi]

public property TableViews: TableViewCollection read get_TableViews;


CompositeTableDef.ViewRelations Property

CompositeTableDef.ViewRelations Property

Gets the collection of view relations.

[Visual Basic]

Overrides Public ReadOnly Property ViewRelations As ViewRelationCollection

[C#]

override public ViewRelationCollection ViewRelations {get;}

[Delphi]

public property ViewRelations: ViewRelationCollection read get_ViewRelations;


CompositeTableField Class

CompositeTableField Class

Represents a composite table field.

For a list of all members of this type, see CompositeTableField Members.

System.Object

C1.Data.SchemaObjects.Field

C1.Data.SchemaObjects.TableField

C1.Data.SchemaObjects.CompositeTableField

[Visual Basic]

Public Class CompositeTableField

Inherits TableField

[C#]

public class CompositeTableField : TableField

[Delphi]

type CompositeTableField = class (TableField);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CompositeTableField Members

CompositeTableField Members

CompositeTableField overview

Public Constructors

CompositeTableField Constructor

Initializes a new instance of the CompositeTableField class.

Public Properties

AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
Table (inherited from TableField) | Gets the table to which the field belongs.
TableViewField | Gets or sets the table view field on which this field is based.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


CompositeTableField Constructor

CompositeTableField Constructor

Overload List

Initializes a new instance of the CompositeTableField class.

[Visual Basic] Public Function New()

[C#] public CompositeTableField();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the CompositeTableField class.

[Visual Basic] Public Function New(CompositeTable)

[C#] public CompositeTableField(CompositeTable);

[Delphi] public constructor Create(CompositeTable); overload;


CompositeTableField Constructor ()

CompositeTableField Constructor ()

Initializes a new instance of the CompositeTableField class.

[Visual Basic]

Public Function New()

[C#]

public CompositeTableField()

[Delphi]

public constructor Create(); overload;


CompositeTableField Constructor (CompositeTable)

CompositeTableField Constructor (CompositeTable)

Initializes a new instance of the CompositeTableField class.

[Visual Basic]

Public Function New( _

ByVal table As CompositeTable _

)

[C#]

public CompositeTableField(

CompositeTable table

);

[Delphi]

public constructor Create(

table: CompositeTable

); overload;

Parameters

table

Composite table the field belongs to.


CompositeTableField Properties

CompositeTableField Properties

The properties of the CompositeTableField class are listed here. For a complete list of CompositeTableField class members, see the CompositeTableField Members topic.

Public Properties

AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
Table (inherited from TableField) | Gets the table to which the field belongs.
TableViewField | Gets or sets the table view field on which this field is based.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


CompositeTableField.TableViewField Property

CompositeTableField.TableViewField Property

Gets or sets the table view field on which this field is based.

[Visual Basic]

Public Property TableViewField As TableViewField

[C#]

public TableViewField TableViewField {get;set;}

[Delphi]

public property TableViewField: TableViewField read get_TableViewField write set_TableViewField;

Remarks

This property value can be null, in which case the field is not based on any of the constituent table fields, represents a calculated field belonging to the composite table.


Connection Class

Connection Class

Base class representing a database connection.

For a list of all members of this type, see Connection Members.

System.Object

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection

C1.Data.SchemaObjects.C1BorlandDPConnection

C1.Data.SchemaObjects.C1CustomConnection

C1.Data.SchemaObjects.C1MSOracleConnection

C1.Data.SchemaObjects.C1OleDbConnection

C1.Data.SchemaObjects.C1OracleConnection

C1.Data.SchemaObjects.C1SqlServerConnection

[Visual Basic]

MustInherit Public Class Connection

Inherits MarshalByRefObject

Implements ICloneable, IDisposable

[C#]

public abstract class Connection : MarshalByRefObject , ICloneable, IDisposable

[Delphi]

type Connection = class abstract (MarshalByRefObject, ICloneable, IDisposable);

Remarks

C1DataObjects supports five types of database connections: OLE DB connection (connecting to any database that has an OLE DB provider), represented by a derived C1OleDbConnection class, native SQL Server connection, represented by a derived C1SqlServerConnection class, two native Oracle connection types ( C1OracleConnection and C1MSOracleConnection), and any other .NET data provider is represented by the C1CustomConnection class.

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


Connection Members

Connection Members

Connection overview

Public Properties

CommandTimeout | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString | Gets or sets the string used to connect to a database.
ConnectionType | Gets the type of database connection, either via OLE DB or using one of the native database access options.
DbConnection | Gets .NET IDbConnection object representing open connection.
DbTransaction | Gets .NET IDbTransaction object representing current transaction.
Description | Gets or sets a description for the connection.
Name | Gets or sets the name of the connection object.
Schema | Gets the schema to which the connection object belongs.
SqlInfo | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

Public Methods

BeginTransaction | Starts a transaction on the connection object.
Clone | Creates a copy of the connection object, with the same Name and other properties.
Close | Closes database connection.
CommitTransaction | Commits the current transaction.
Open | Opens database connection.
RollbackTransaction | Rolls back the current transaction.


Connection Properties

Connection Properties

The properties of the Connection class are listed here. For a complete list of Connection class members, see the Connection Members topic.

Public Properties

CommandTimeout | Gets or sets the wait time before terminating an attempt to execute a command and generating an error.
ConnectionString | Gets or sets the string used to connect to a database.
ConnectionType | Gets the type of database connection, either via OLE DB or using one of the native database access options.
DbConnection | Gets .NET IDbConnection object representing open connection.
DbTransaction | Gets .NET IDbTransaction object representing current transaction.
Description | Gets or sets a description for the connection.
Name | Gets or sets the name of the connection object.
Schema | Gets the schema to which the connection object belongs.
SqlInfo | Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.


Connection.CommandTimeout Property

Connection.CommandTimeout Property

Gets or sets the wait time before terminating an attempt to execute a command and generating an error.

[Visual Basic]

Public Property CommandTimeout As Integer

[C#]

public int CommandTimeout {get;set;}

[Delphi]

public property CommandTimeout: Int32 read get_CommandTimeout write set_CommandTimeout;

Remarks

The default is 30 seconds.


Connection.ConnectionString Property

Connection.ConnectionString Property

Gets or sets the string used to connect to a database.

[Visual Basic]

Public Property ConnectionString As String

[C#]

public string ConnectionString {get;set;}

[Delphi]

public property ConnectionString: String read get_ConnectionString write set_ConnectionString;

Remarks

Connection string includes provider name (only for OLE DB connections), data source name, database name, connection timeout, user ID, password and other required and optional parameters for establishing database connection. It contains all information necessary to open the database.


Connection.ConnectionType Property

Connection.ConnectionType Property

Gets the type of database connection, either via OLE DB or using one of the native database access options.

[Visual Basic]

Overridable MustInherit Public ReadOnly Property ConnectionType As ConnectionTypeEnum

[C#]

virtual abstract public ConnectionTypeEnum ConnectionType {get;}

[Delphi]

public property ConnectionType: ConnectionTypeEnum read get_ConnectionType;

Remarks

This property is overridden in each class derived from Connection, indicating the type of database connection the class represents.


Connection.DbConnection Property

Connection.DbConnection Property

Gets .NET IDbConnection object representing open connection.

[Visual Basic]

Public Property DbConnection As IDbConnection

[C#]

public IDbConnection DbConnection {get;set;}

[Delphi]

public property DbConnection: IDbConnection read get_DbConnection write set_DbConnection;

Remarks

This property returns a non-null object only while the connection is open. Depending on the ConnectionType value, DbConnection returns an object of one of the following classes:

for OleDb: System.Data.OleDb.OleDbConnection,

for SqlServer: System.Data.SqlConnection,

for Oracle: Oracle.DataAccess.Client.OracleConnection,

for MSOracle: System.Data.OracleClient.OracleConnection,

for BorlandDataProvider: Borland.Data.Provider.BdpConnection,

for BorlandDataProvider: Borland.Data.Provider.BdpConnection,

for others (Custom): the type is specified in the ConnectionTypeName property.


Connection.DbTransaction Property

Connection.DbTransaction Property

Gets .NET IDbTransaction object representing current transaction.

[Visual Basic]

Public Property DbTransaction As IDbTransaction

[C#]

public IDbTransaction DbTransaction {get;set;}

[Delphi]

public property DbTransaction: IDbTransaction read get_DbTransaction write set_DbTransaction;

Remarks

This property contains a non-null object only while the database connection is open and is performing a transaction while updating the database. Depending on the ConnectionType value, DbTransaction returns an object of one of the following classes:

for OleDb: System.Data.OleDb.OleDbTransaction,

for SqlServer: System.Data.SqlTransaction,

for Oracle: Oracle.DataAccess.Client.OracleTransaction,

for MSOracle: System.Data.OracleClient.OracleTransaction,

for others (Custom): type depends on the provider.


Connection.Description Property

Connection.Description Property

Gets or sets a description for the connection.

[Visual Basic]

Public Property Description As String

[C#]

public string Description {get;set;}

[Delphi]

public property Description: String read get_Description write set_Description;

Remarks

This value is displayed in the Schema Designer's Information window when you select the connection.


Connection.Name Property

Connection.Name Property

Gets or sets the name of the connection object.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


Connection.Schema Property

Connection.Schema Property

Gets the schema to which the connection object belongs.

[Visual Basic]

Public ReadOnly Property Schema As Schema

[C#]

public Schema Schema {get;}

[Delphi]

public property Schema: Schema read get_Schema;


Connection.SqlInfo Property

Connection.SqlInfo Property

Gets the SqlDialectInfo object containing information about SQL dialect supported by the connection.

[Visual Basic]

Public Property SqlInfo As SqlDialectInfo

[C#]

public SqlDialectInfo SqlInfo {get;set;}

[Delphi]

public property SqlInfo: SqlDialectInfo read get_SqlInfo write set_SqlInfo;

Remarks

Use the properties of this object to specify various options of SQL syntax relevant to C1DataObjects that can vary between different databases. Normally, these properties are set automatically to their appropriate values, according to the selected ConnectionType or OLE DB provider (when you specify the ConnectionString), but, occasionally, they may need manual adjustment, for example, when using a third-party OLE DB provider or a custom .NET data provider.


Connection Methods

Connection Methods

The methods of the Connection class are listed here. For a complete list of Connection class members, see the Connection Members topic.

Public Methods

BeginTransaction | Starts a transaction on the connection object.
Clone | Creates a copy of the connection object, with the same Name and other properties.
Close | Closes database connection.
CommitTransaction | Commits the current transaction.
Open | Opens database connection.
RollbackTransaction | Rolls back the current transaction.


Connection.BeginTransaction Method

Connection.BeginTransaction Method

Starts a transaction on the connection object.

[Visual Basic]

Overridable Public Sub BeginTransaction()

[C#]

virtual public void BeginTransaction()

[Delphi]

public procedure BeginTransaction(); virtual;


Connection.Clone Method

Connection.Clone Method

Creates a copy of the connection object, with the same Name and other properties.

[Visual Basic]

Overridable Public Function Clone() As Object Implements ICloneable.Clone

[C#]

virtual public object Clone()

[Delphi]

public function Clone(): Object; virtual;

Implements

ICloneable.Clone

Return Value


Connection.Close Method

Connection.Close Method

Closes database connection.

[Visual Basic]

Public Sub Close()

[C#]

public void Close()

[Delphi]

public procedure Close();


Connection.CommitTransaction Method

Connection.CommitTransaction Method

Commits the current transaction.

[Visual Basic]

Overridable Public Sub CommitTransaction()

[C#]

virtual public void CommitTransaction()

[Delphi]

public procedure CommitTransaction(); virtual;


Connection.Open Method

Connection.Open Method

Opens database connection.

[Visual Basic]

Public Sub Open()

[C#]

public void Open()

[Delphi]

public procedure Open();


Connection.RollbackTransaction Method

Connection.RollbackTransaction Method

Rolls back the current transaction.

[Visual Basic]

Overridable Public Sub RollbackTransaction()

[C#]

virtual public void RollbackTransaction()

[Delphi]

public procedure RollbackTransaction(); virtual;


ConnectionCollection Class

ConnectionCollection Class

Represents a collection of Connection objects.

For a list of all members of this type, see ConnectionCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.ConnectionCollection

[Visual Basic]

Public Class ConnectionCollection

Inherits CollectionBase

[C#]

public class ConnectionCollection : CollectionBase

[Delphi]

type ConnectionCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


ConnectionCollection Members

ConnectionCollection Members

ConnectionCollection overview

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


ConnectionCollection Properties

ConnectionCollection Properties

The properties of the ConnectionCollection class are listed here. For a complete list of ConnectionCollection class members, see the ConnectionCollection Members topic.

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.


ConnectionCollection.Item Property

ConnectionCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As Connection

[C#] public Connection this[int]{get;}

[Delphi] public property Item[index: Int32]: Connection read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Connection

[C#] public Connection this[string]{get;}

[Delphi] public property Item[name: String]: Connection read get_Item;


ConnectionCollection.Item Property (Int32)

ConnectionCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Connection

[C#]

public Connection this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Connection read get_Item;


ConnectionCollection.Item Property (String)

ConnectionCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As Connection

[C#]

public Connection this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: Connection read get_Item;


ConnectionCollection Methods

ConnectionCollection Methods

The methods of the ConnectionCollection class are listed here. For a complete list of ConnectionCollection class members, see the ConnectionCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


ConnectionCollection.Add Method

ConnectionCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As Connection _

)

[C#]

public void Add(

Connection obj

);

[Delphi]

public procedure Add(

obj: Connection

);

Parameters

obj

The object to be added to the end of the collection.


ConnectionCollection.Contains Method

ConnectionCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


ConnectionCollection.CopyTo Method

ConnectionCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As Connection(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

Connection[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of Connection;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


ConnectionCollection.IndexOf Method

ConnectionCollection.IndexOf Method

Overload List

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(Connection) As Integer

[C#] public int IndexOf(Connection);

[Delphi] public function IndexOf(Connection) : Int32; overload;

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;


ConnectionCollection.IndexOf Method (Connection)

ConnectionCollection.IndexOf Method (Connection)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal conn As Connection _

) As Integer

[C#]

public int IndexOf(

Connection conn

);

[Delphi]

public function IndexOf(

conn: Connection

): Int32; overload;

Parameters

conn

The element of the collection.

Return Value


ConnectionCollection.IndexOf Method (String)

ConnectionCollection.IndexOf Method (String)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


ConnectionCollection.Insert Method

ConnectionCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As Connection _

)

[C#]

public void Insert(

int index,

Connection obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: Connection

);

Parameters

index

The zero-based index at which object should be inserted.

obj

The object to insert.


ConnectionCollection.Remove Method

ConnectionCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal obj As Connection _

)

[C#]

public void Remove(

Connection obj

);

[Delphi]

public procedure Remove(

obj: Connection

);

Parameters

obj

The object to remove from the collection.


ConnectionTypeEnum Enumeration

ConnectionTypeEnum Enumeration

Specifies the database engine software used to connect to the database.

[Visual Basic]

Public Enum ConnectionTypeEnum

[C#]

public enum ConnectionTypeEnum

[Delphi]

type ConnectionTypeEnum = (BorlandDataProvider, Custom, MSOracle, OleDb, Oracle, SqlServer);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
BorlandDataProvider | Connection using Borland Data Provider (BDP), namespace Borland.Data.Provider
Custom | A custom, generic ADO.NET data provider, see class C1CustomConnection.
MSOracle | Connection using Microsoft .NET Framework Data Provider for Oracle, namespace System.Data.OracleClient.OracleType.
OleDb | Connection using OLE DB database access classes in System.Data.OleDb namespace.
Oracle | Connection using Oracle Data Provider for .NET, namespace Oracle.DataAccess.Client.
SqlServer | Connection using SQL Server native database access classes in System.Data.SqlClient namespace.

See Also

C1.Data.SchemaObjects Namespace


CustomProviderInfo Class

CustomProviderInfo Class

Containing information necessary to access a generic .NET data provider.

For a list of all members of this type, see CustomProviderInfo Members.

System.Object

C1.Data.SchemaObjects.CustomProviderInfo

[Visual Basic]

Public Class CustomProviderInfo

[C#]

public class CustomProviderInfo

[Delphi]

type CustomProviderInfo = class;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


CustomProviderInfo Members

CustomProviderInfo Members

CustomProviderInfo overview

Public Properties

AssemblyName | Gets or sets the name of the assembly implementing the .NET data provider.
CommandTypeName | Gets or sets the full name of the type implementing the IDbCommand interface.
ConnectionTypeName | Gets or sets the full name of the type implementing the IDbConnection interface.
DataAdapterTypeName | Gets or sets the full name of the type implementing the IDbDataAdapter interface.
NativeTypeTypeName | Gets or sets the full type name of the native database type enumeration.
ParameterNameFormat | Gets or sets a format string used to generate the value of parameter.ParameterName from parameter number {0} and name {1}.
ParameterNativeTypeProperty | Gets or sets the name of the property of the parameter class specifying parameter native data type.
ParameterTypeName | Gets or sets the full name of the type implementing the IDbDataParameter interface.
SqlParameterNameFormat | Gets or sets a format string used to generate parameter names in SQL statements from parameter number {0} and name {1}.


CustomProviderInfo Properties

CustomProviderInfo Properties

The properties of the CustomProviderInfo class are listed here. For a complete list of CustomProviderInfo class members, see the CustomProviderInfo Members topic.

Public Properties

AssemblyName | Gets or sets the name of the assembly implementing the .NET data provider.
CommandTypeName | Gets or sets the full name of the type implementing the IDbCommand interface.
ConnectionTypeName | Gets or sets the full name of the type implementing the IDbConnection interface.
DataAdapterTypeName | Gets or sets the full name of the type implementing the IDbDataAdapter interface.
NativeTypeTypeName | Gets or sets the full type name of the native database type enumeration.
ParameterNameFormat | Gets or sets a format string used to generate the value of parameter.ParameterName from parameter number {0} and name {1}.
ParameterNativeTypeProperty | Gets or sets the name of the property of the parameter class specifying parameter native data type.
ParameterTypeName | Gets or sets the full name of the type implementing the IDbDataParameter interface.
SqlParameterNameFormat | Gets or sets a format string used to generate parameter names in SQL statements from parameter number {0} and name {1}.


CustomProviderInfo.AssemblyName Property

CustomProviderInfo.AssemblyName Property

Gets or sets the name of the assembly implementing the .NET data provider.

[Visual Basic]

Public Property AssemblyName As String

[C#]

public string AssemblyName {get;set;}

[Delphi]

public property AssemblyName: String read get_AssemblyName write set_AssemblyName;


CustomProviderInfo.CommandTypeName Property

CustomProviderInfo.CommandTypeName Property

Gets or sets the full name of the type implementing the IDbCommand interface.

[Visual Basic]

Public Property CommandTypeName As String

[C#]

public string CommandTypeName {get;set;}

[Delphi]

public property CommandTypeName: String read get_CommandTypeName write set_CommandTypeName;


CustomProviderInfo.ConnectionTypeName Property

CustomProviderInfo.ConnectionTypeName Property

Gets or sets the full name of the type implementing the IDbConnection interface.

[Visual Basic]

Public Property ConnectionTypeName As String

[C#]

public string ConnectionTypeName {get;set;}

[Delphi]

public property ConnectionTypeName: String read get_ConnectionTypeName write set_ConnectionTypeName;


CustomProviderInfo.DataAdapterTypeName Property

CustomProviderInfo.DataAdapterTypeName Property

Gets or sets the full name of the type implementing the IDbDataAdapter interface.

[Visual Basic]

Public Property DataAdapterTypeName As String

[C#]

public string DataAdapterTypeName {get;set;}

[Delphi]

public property DataAdapterTypeName: String read get_DataAdapterTypeName write set_DataAdapterTypeName;


CustomProviderInfo.NativeTypeTypeName Property

CustomProviderInfo.NativeTypeTypeName Property

Gets or sets the full type name of the native database type enumeration.

[Visual Basic]

Public Property NativeTypeTypeName As String

[C#]

public string NativeTypeTypeName {get;set;}

[Delphi]

public property NativeTypeTypeName: String read get_NativeTypeTypeName write set_NativeTypeTypeName;


CustomProviderInfo.ParameterNameFormat Property

CustomProviderInfo.ParameterNameFormat Property

Gets or sets a format string used to generate the value of parameter.ParameterName from parameter number {0} and name {1}.

[Visual Basic]

Public Property ParameterNameFormat As String

[C#]

public string ParameterNameFormat {get;set;}

[Delphi]

public property ParameterNameFormat: String read get_ParameterNameFormat write set_ParameterNameFormat;

Remarks

Generating SQL statements and corresponding commands, C1DataObjects uses this format string to create names to assign to command parameter Name property (IDbDataParameter.Name). For example, for a SQL Server database, the string can be “@{1}” or “@Par{0}”. The latter ignores the suggested name and uses the (unique) parameter number to generate the parameter Name property value. For an Oracle database, examples of a correct format string are “{1}” or “Par{0}”.


CustomProviderInfo.ParameterNativeTypeProperty Property

CustomProviderInfo.ParameterNativeTypeProperty Property

Gets or sets the name of the property of the parameter class specifying parameter native data type.

[Visual Basic]

Public Property ParameterNativeTypeProperty As String

[C#]

public string ParameterNativeTypeProperty {get;set;}

[Delphi]

public property ParameterNativeTypeProperty: String read get_ParameterNativeTypeProperty write set_ParameterNativeTypeProperty;


CustomProviderInfo.ParameterTypeName Property

CustomProviderInfo.ParameterTypeName Property

Gets or sets the full name of the type implementing the IDbDataParameter interface.

[Visual Basic]

Public Property ParameterTypeName As String

[C#]

public string ParameterTypeName {get;set;}

[Delphi]

public property ParameterTypeName: String read get_ParameterTypeName write set_ParameterTypeName;


CustomProviderInfo.SqlParameterNameFormat Property

CustomProviderInfo.SqlParameterNameFormat Property

Gets or sets a format string used to generate parameter names in SQL statements from parameter number {0} and name {1}.

[Visual Basic]

Public Property SqlParameterNameFormat As String

[C#]

public string SqlParameterNameFormat {get;set;}

[Delphi]

public property SqlParameterNameFormat: String read get_SqlParameterNameFormat write set_SqlParameterNameFormat;

Remarks

Generating SQL statements, C1DataObjects uses this format string to generate parameter names in the SQL statement. For example, for a SQL Server database, the string can be “@{1}”, which will generate parameters like this:

SELECT … FROM … WHERE … = @aName

SQL Server accepts named parameters, so we can use the suggested name (parameter name, {1}) in the SQL statement. Suggested name is usually based on a field name, but it is generally at C1DataObjects discretion. Another possible option for SQL Server can be “@Par{0}”, which ignores the suggested name and uses the (unique) parameter number to generate parameter names in the SQL statement. For an Oracle database, a correct format string can be “:{1}” or “:Par{0}”.


DataAccessModeEnum Enumeration

DataAccessModeEnum Enumeration

Specifies how data is fetched from the database to a table view.

[Visual Basic]

Public Enum DataAccessModeEnum

[C#]

public enum DataAccessModeEnum

[Delphi]

type DataAccessModeEnum = (Static, Virtual, VirtualAutomatic, VirtualUnlimited);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Static | All data is pre-fetched when the data set is filled with data. No fetches occur until Fill method is called.
Virtual | Data is fetched in segments of limited size, and the number of segments cached at the client at any given time is limited, segments are uncached when this limit is exceeded.
VirtualAutomatic | Data is fetched in segments of limited size, and the number of segments in the cache is unlimited, segments are never uncached.
VirtualUnlimited | Data is fetched in segments, and the number of segments in the cache is unlimited, and, in addition to that, fetch is continually performed in background mode until all data is fetched.

See Also

C1.Data.SchemaObjects Namespace


DataModeEnum Enumeration

DataModeEnum Enumeration

Specifies how a table is related to the database.

[Visual Basic]

Public Enum DataModeEnum

[C#]

public enum DataModeEnum

[Delphi]

type DataModeEnum = (Bound, SqlBased, Unbound);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Bound | Table is based on a database table, SQL statements generated automatically.
SqlBased | SQL statements specified in user code.
Unbound | Fetch and update performed entirely in user code.

See Also

C1.Data.SchemaObjects Namespace


DataSetDef Class

DataSetDef Class

Represents a data set definition.

For a list of all members of this type, see DataSetDef Members.

System.Object

C1.Data.SchemaObjects.Diagram

C1.Data.SchemaObjects.DataSetDef

[Visual Basic]

Public Class DataSetDef

Inherits Diagram

[C#]

public class DataSetDef : Diagram

[Delphi]

type DataSetDef = class (Diagram);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


DataSetDef Members

DataSetDef Members

DataSetDef overview

Public Constructors

DataSetDef Constructor

Initializes a new instance of the DataSetDef class.

Public Properties

CacheProperties | This property is used in ComponentOne WebDataObjects for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.
Description | Gets or sets a description for the dataset.
FieldDefaults | Gets the FieldDefaults object containing default settings used for fields accessed through this data set.
Name (inherited from Diagram) | Gets or sets the name of the diagram object.
Schema (inherited from Diagram) | Gets the schema the diagram belongs to.
TableViews (inherited from Diagram) | Gets the collection of table views.
ViewRelations (inherited from Diagram) | Gets the collection of view relations.


DataSetDef Constructor

DataSetDef Constructor

Overload List

Initializes a new instance of the DataSetDef class.

[Visual Basic] Public Function New()

[C#] public DataSetDef();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the DataSetDef class.

[Visual Basic] Public Function New(Schema)

[C#] public DataSetDef(Schema);

[Delphi] public constructor Create(Schema); overload;


DataSetDef Constructor ()

DataSetDef Constructor ()

Initializes a new instance of the DataSetDef class.

[Visual Basic]

Public Function New()

[C#]

public DataSetDef()

[Delphi]

public constructor Create(); overload;


DataSetDef Constructor (Schema)

DataSetDef Constructor (Schema)

Initializes a new instance of the DataSetDef class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public DataSetDef(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema the dataset belongs to.


DataSetDef Properties

DataSetDef Properties

The properties of the DataSetDef class are listed here. For a complete list of DataSetDef class members, see the DataSetDef Members topic.

Public Properties

CacheProperties | This property is used in ComponentOne WebDataObjects for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.
Description | Gets or sets a description for the dataset.
FieldDefaults | Gets the FieldDefaults object containing default settings used for fields accessed through this data set.
Name (inherited from Diagram) | Gets or sets the name of the diagram object.
Schema (inherited from Diagram) | Gets the schema the diagram belongs to.
TableViews (inherited from Diagram) | Gets the collection of table views.
ViewRelations (inherited from Diagram) | Gets the collection of view relations.


DataSetDef.CacheProperties Property

DataSetDef.CacheProperties Property

This property is used in ComponentOne WebDataObjects for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.

[Visual Basic]

Public Property CacheProperties As CacheProperties

[C#]

public CacheProperties CacheProperties {get;set;}

[Delphi]

public property CacheProperties: CacheProperties read get_CacheProperties write set_CacheProperties;


DataSetDef.Description Property

DataSetDef.Description Property

Gets or sets a description for the dataset.

[Visual Basic]

Public Property Description As String

[C#]

public string Description {get;set;}

[Delphi]

public property Description: String read get_Description write set_Description;


DataSetDef.FieldDefaults Property

DataSetDef.FieldDefaults Property

Gets the FieldDefaults object containing default settings used for fields accessed through this data set.

[Visual Basic]

Public Property FieldDefaults As FieldDefaults

[C#]

public FieldDefaults FieldDefaults {get;set;}

[Delphi]

public property FieldDefaults: FieldDefaults read get_FieldDefaults write set_FieldDefaults;


DataSetDefCollection Class

DataSetDefCollection Class

Represents a collection of DataSetDef objects.

For a list of all members of this type, see DataSetDefCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.DataSetDefCollection

[Visual Basic]

Public Class DataSetDefCollection

Inherits CollectionBase

[C#]

public class DataSetDefCollection : CollectionBase

[Delphi]

type DataSetDefCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


DataSetDefCollection Members

DataSetDefCollection Members

DataSetDefCollection overview

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object.


DataSetDefCollection Properties

DataSetDefCollection Properties

The properties of the DataSetDefCollection class are listed here. For a complete list of DataSetDefCollection class members, see the DataSetDefCollection Members topic.

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.


DataSetDefCollection.Item Property

DataSetDefCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As DataSetDef

[C#] public DataSetDef this[int]{get;}

[Delphi] public property Item[index: Int32]: DataSetDef read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As DataSetDef

[C#] public DataSetDef this[string]{get;}

[Delphi] public property Item[name: String]: DataSetDef read get_Item;


DataSetDefCollection.Item Property (Int32)

DataSetDefCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As DataSetDef

[C#]

public DataSetDef this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: DataSetDef read get_Item;

Parameters

index

The index of the object.


DataSetDefCollection.Item Property (String)

DataSetDefCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As DataSetDef

[C#]

public DataSetDef this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: DataSetDef read get_Item;

Parameters

name

The DataSetDef.Name of the object.


DataSetDefCollection Methods

DataSetDefCollection Methods

The methods of the DataSetDefCollection class are listed here. For a complete list of DataSetDefCollection class members, see the DataSetDefCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object.


DataSetDefCollection.Add Method

DataSetDefCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As DataSetDef _

)

[C#]

public void Add(

DataSetDef obj

);

[Delphi]

public procedure Add(

obj: DataSetDef

);

Parameters

obj

The object to be added to the end of the collection.


DataSetDefCollection.Contains Method

DataSetDefCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The DataSetDef.Name of the element.

Return Value


DataSetDefCollection.CopyTo Method

DataSetDefCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As DataSetDef(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

DataSetDef[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of DataSetDef;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


DataSetDefCollection.IndexOf Method

DataSetDefCollection.IndexOf Method

Overload List

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(DataSetDef) As Integer

[C#] public int IndexOf(DataSetDef);

[Delphi] public function IndexOf(DataSetDef) : Int32; overload;

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;


DataSetDefCollection.IndexOf Method (DataSetDef)

DataSetDefCollection.IndexOf Method (DataSetDef)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal dataSetDef As DataSetDef _

) As Integer

[C#]

public int IndexOf(

DataSetDef dataSetDef

);

[Delphi]

public function IndexOf(

dataSetDef: DataSetDef

): Int32; overload;

Parameters

dataSetDef

The element of the collection.

Return Value

Gets the index of an object.


DataSetDefCollection.IndexOf Method (String)

DataSetDefCollection.IndexOf Method (String)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The DataSetDef.Name of the element.

Return Value

Returns the index of the object.


DataSetDefCollection.Insert Method

DataSetDefCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As DataSetDef _

)

[C#]

public void Insert(

int index,

DataSetDef obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: DataSetDef

);

Parameters

index

The zero-based index at which obj should be inserted.

obj

The object to insert.


DataSetDefCollection.Remove Method

DataSetDefCollection.Remove Method

Removes the first occurrence of a specific object.

[Visual Basic]

Public Sub Remove( _

ByVal obj As DataSetDef _

)

[C#]

public void Remove(

DataSetDef obj

);

[Delphi]

public procedure Remove(

obj: DataSetDef

);

Parameters

obj

The Object to remove from the collection.


DbTable Class

DbTable Class

Represents a simple table.

For a list of all members of this type, see DbTable Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.Table

C1.Data.SchemaObjects.SimpleTable

C1.Data.SchemaObjects.DbTable

[Visual Basic]

Public Class DbTable

Inherits SimpleTable

[C#]

public class DbTable : SimpleTable

[Delphi]

type DbTable = class (SimpleTable);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


DbTable Members

DbTable Members

DbTable overview

Public Constructors

DbTable Constructor

Initializes a new instance of the DbTable class.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
Connection | Gets or sets the Connection object used for the table.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
DataMode | Gets or sets the table data mode.
DbTableName | Gets or sets the name of a database table on which the table is based.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly (inherited from BaseTable) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields (inherited from Table) | Gets the collection of table fields.
IgnoreDeleteError (inherited from Table) | Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.
Name (inherited from Table) | Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema (inherited from Table) | Gets the schema to which the table belongs.
SelectCommandText | Gets or sets the command text for fetching data used in DataMode = SqlBased.
SelectCommandType | Determines how to interpret SelectCommandText in DataMode = SqlBased.
UpdateLocateMode (inherited from Table) | Gets or sets a value specifying which field values participate in locating the database record for update.
UpdateRefreshMode (inherited from Table) | Gets or sets a value specifying how refresh after updating the database is done.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.

Public Methods

RetrieveFields

Retrieves fields from the database table specified in DbTableName property.


DbTable Constructor

DbTable Constructor

Overload List

Initializes a new instance of the DbTable class.

[Visual Basic] Public Function New()

[C#] public DbTable();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the DbTable class.

[Visual Basic] Public Function New(Schema)

[C#] public DbTable(Schema);

[Delphi] public constructor Create(Schema); overload;

Initializes a new instance of the DbTable class.

[Visual Basic] Public Function New(Schema, C1DataRow)

[C#] public DbTable(Schema, C1DataRow);

[Delphi] public constructor Create(Schema; C1DataRow); overload;


DbTable Constructor ()

DbTable Constructor ()

Initializes a new instance of the DbTable class.

[Visual Basic]

Public Function New()

[C#]

public DbTable()

[Delphi]

public constructor Create(); overload;


DbTable Constructor (Schema)

DbTable Constructor (Schema)

Initializes a new instance of the DbTable class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public DbTable(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema the table belongs to.


DbTable Constructor (Schema, C1DataRow)

DbTable Constructor (Schema, C1DataRow)

Initializes a new instance of the DbTable class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema, _

ByVal userObjPrototype As C1DataRow _

)

[C#]

public DbTable(

Schema schema,

C1DataRow userObjPrototype

);

[Delphi]

public constructor Create(

schema: Schema;

userObjPrototype: C1DataRow

); overload;

Parameters

schema

Schema the table belongs to.

userObjPrototype

Custom class representing rows of a table or table view.


DbTable Properties

DbTable Properties

The properties of the DbTable class are listed here. For a complete list of DbTable class members, see the DbTable Members topic.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
Connection | Gets or sets the Connection object used for the table.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
DataMode | Gets or sets the table data mode.
DbTableName | Gets or sets the name of a database table on which the table is based.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly (inherited from BaseTable) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields (inherited from Table) | Gets the collection of table fields.
IgnoreDeleteError (inherited from Table) | Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.
Name (inherited from Table) | Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema (inherited from Table) | Gets the schema to which the table belongs.
SelectCommandText | Gets or sets the command text for fetching data used in DataMode = SqlBased.
SelectCommandType | Determines how to interpret SelectCommandText in DataMode = SqlBased.
UpdateLocateMode (inherited from Table) | Gets or sets a value specifying which field values participate in locating the database record for update.
UpdateRefreshMode (inherited from Table) | Gets or sets a value specifying how refresh after updating the database is done.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


DbTable.Connection Property

DbTable.Connection Property

Gets or sets the Connection object used for the table.

[Visual Basic]

Public Property Connection As Connection

[C#]

public Connection Connection {get;set;}

[Delphi]

public property Connection: Connection read get_Connection write set_Connection;

Remarks

This property is null for an unbound table.


DbTable.DataMode Property

DbTable.DataMode Property

Gets or sets the table data mode.

[Visual Basic]

Public Property DataMode As DataModeEnum

[C#]

public DataModeEnum DataMode {get;set;}

[Delphi]

public property DataMode: DataModeEnum read get_DataMode write set_DataMode;

Remarks

Data mode is one of the DataModeEnum values specifying whether a table is bound, SQL-based or unbound.


DbTable.DbTableName Property

DbTable.DbTableName Property

Gets or sets the name of a database table on which the table is based.

[Visual Basic]

Public Property DbTableName As String

[C#]

public string DbTableName {get;set;}

[Delphi]

public property DbTableName: String read get_DbTableName write set_DbTableName;


DbTable.SelectCommandText Property

DbTable.SelectCommandText Property

Gets or sets the command text for fetching data used in DataMode = SqlBased.

[Visual Basic]

Public Property SelectCommandText As String

[C#]

public string SelectCommandText {get;set;}

[Delphi]

public property SelectCommandText: String read get_SelectCommandText write set_SelectCommandText;

Remarks

Property SelectCommandType determines whether SelectCommandText is a SQL statement or a stored procedure name.

If specified, SelectCommandType/SelectCommandText determine the command that is executed to fetch data.

The command can also be specified dynamically, in code, in C1.Data.C1DataSetLogic.BeforeGenerateSql or C1.Data.C1DataSetLogic.AfterGenerateSql events.

If DataAdapter property is set and its SelectCommand property is not empty, it supersedes the SelectCommandText property.

The SelectCommandText property can be specified in a DbTable only for a SQL-based table (DataMode = SqlBased).

In C1DataExpress, in a C1ExpressTable component, specifying this property makes the table SQL-based and clears the DbTableName property.

When this property is set at design time, and a database connection exists, fields are automatically retrieved from the database structure, with user confirmation if it is OK to delete the existing fields.


DbTable.SelectCommandType Property

DbTable.SelectCommandType Property

Determines how to interpret SelectCommandText in DataMode = SqlBased.

[Visual Basic]

Public Property SelectCommandType As CommandTypeEnum

[C#]

public CommandTypeEnum SelectCommandType {get;set;}

[Delphi]

public property SelectCommandType: CommandTypeEnum read get_SelectCommandType write set_SelectCommandType;

Remarks

This property determines whether SelectCommandText is a SQL statement or a stored procedure name.


DbTable Methods

DbTable Methods

The methods of the DbTable class are listed here. For a complete list of DbTable class members, see the DbTable Members topic.

Public Methods

RetrieveFields

Retrieves fields from the database table specified in DbTableName property.


DbTable.RetrieveFields Method

DbTable.RetrieveFields Method

Retrieves fields from the database table specified in DbTableName property.

[Visual Basic]

Public Sub RetrieveFields()

[C#]

public void RetrieveFields()

[Delphi]

public procedure RetrieveFields();

Remarks

Connection property should be non-empty.


DbTableField Class

DbTableField Class

Represents a simple table field.

For a list of all members of this type, see DbTableField Members.

System.Object

C1.Data.SchemaObjects.Field

C1.Data.SchemaObjects.TableField

C1.Data.SchemaObjects.DbTableField

[Visual Basic]

Public Class DbTableField

Inherits TableField

[C#]

public class DbTableField : TableField

[Delphi]

type DbTableField = class (TableField);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


DbTableField Members

DbTableField Members

DbTableField overview

Public Constructors

DbTableField Constructor

Initializes a new instance of the DbTableField class.

Public Properties

AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DataSourceReadOnly | Gets or sets the value indicating whether the field value in the database can be changed.
DbFieldName | Gets or sets the name of the database field this field is based on.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly (inherited from Field) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from Field) | Gets the effective value of the UserReadOnly property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
Table (inherited from TableField) | Gets the table to which the field belongs.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UpdateIgnore | Gets or sets a value indicating whether the field value is sent to the database (to the server) for update.
UpdateLocate | Gets or sets the value indicating whether the field value is used to locate the database record that is going to be updated.
UpdateRefresh | Gets or sets the value indicating whether the field value is refreshed, retrieved from the database after updating the database record.
UpdateSet | Gets or sets a value indicating whether the field value is set in the database record.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


DbTableField Constructor

DbTableField Constructor

Overload List

Initializes a new instance of the DbTableField class.

[Visual Basic] Public Function New()

[C#] public DbTableField();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the DbTableField class.

[Visual Basic] Public Function New(Table)

[C#] public DbTableField(Table);

[Delphi] public constructor Create(Table); overload;


DbTableField Constructor ()

DbTableField Constructor ()

Initializes a new instance of the DbTableField class.

[Visual Basic]

Public Function New()

[C#]

public DbTableField()

[Delphi]

public constructor Create(); overload;


DbTableField Constructor (Table)

DbTableField Constructor (Table)

Initializes a new instance of the DbTableField class.

[Visual Basic]

Public Function New( _

ByVal table As Table _

)

[C#]

public DbTableField(

Table table

);

[Delphi]

public constructor Create(

table: Table

); overload;

Parameters

table

Table the field belongs to.


DbTableField Properties

DbTableField Properties

The properties of the DbTableField class are listed here. For a complete list of DbTableField class members, see the DbTableField Members topic.

Public Properties

AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DataSourceReadOnly | Gets or sets the value indicating whether the field value in the database can be changed.
DbFieldName | Gets or sets the name of the database field this field is based on.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly (inherited from Field) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from Field) | Gets the effective value of the UserReadOnly property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
Table (inherited from TableField) | Gets the table to which the field belongs.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UpdateIgnore | Gets or sets a value indicating whether the field value is sent to the database (to the server) for update.
UpdateLocate | Gets or sets the value indicating whether the field value is used to locate the database record that is going to be updated.
UpdateRefresh | Gets or sets the value indicating whether the field value is refreshed, retrieved from the database after updating the database record.
UpdateSet | Gets or sets a value indicating whether the field value is set in the database record.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


DbTableField.DataSourceReadOnly Property

DbTableField.DataSourceReadOnly Property

Gets or sets the value indicating whether the field value in the database can be changed.

[Visual Basic]

Public Property DataSourceReadOnly As Boolean

[C#]

public bool DataSourceReadOnly {get;set;}

[Delphi]

public property DataSourceReadOnly: Boolean read get_DataSourceReadOnly write set_DataSourceReadOnly;

Remarks

If this property is set to True, the field value will not be set in the database update operation (as with UpdateSet = Never) and it cannot be modified unless it is done in a newly added row, before the C1.Data.BaseLogic.AfterEndAddNew event (as with ReadOnlyUnlessNew = True).


DbTableField.DbFieldName Property

DbTableField.DbFieldName Property

Gets or sets the name of the database field this field is based on.

[Visual Basic]

Public Property DbFieldName As String

[C#]

public string DbFieldName {get;set;}

[Delphi]

public property DbFieldName: String read get_DbFieldName write set_DbFieldName;

Remarks

This property value can be empty string, in which case the field is not based on a database field, represents a calculated field.


DbTableField.UpdateIgnore Property

DbTableField.UpdateIgnore Property

Gets or sets a value indicating whether the field value is sent to the database (to the server) for update.

[Visual Basic]

Public Property UpdateIgnore As Boolean

[C#]

public bool UpdateIgnore {get;set;}

[Delphi]

public property UpdateIgnore: Boolean read get_UpdateIgnore write set_UpdateIgnore;

Remarks

If this property is set to True, the field value is not sent to the server for update, even if the user has modified it. The default is False.


DbTableField.UpdateLocate Property

DbTableField.UpdateLocate Property

Gets or sets the value indicating whether the field value is used to locate the database record that is going to be updated.

[Visual Basic]

Public Property UpdateLocate As Boolean

[C#]

public bool UpdateLocate {get;set;}

[Delphi]

public property UpdateLocate: Boolean read get_UpdateLocate write set_UpdateLocate;

Remarks

If this property is set to False, the field is not used for locating the database record, regardless of the value of UpdateLocateMode. If it is set to True (default), this is determined by the value of the UpdateLocateMode property.


DbTableField.UpdateRefresh Property

DbTableField.UpdateRefresh Property

Gets or sets the value indicating whether the field value is refreshed, retrieved from the database after updating the database record.

[Visual Basic]

Public Property UpdateRefresh As Boolean

[C#]

public bool UpdateRefresh {get;set;}

[Delphi]

public property UpdateRefresh: Boolean read get_UpdateRefresh write set_UpdateRefresh;

Remarks

If this property is set to False, the field value is not refreshed, regardless of the value of UpdateRefreshMode. If it is set to True (default), this is determined by the value of the UpdateRefreshMode property.


DbTableField.UpdateSet Property

DbTableField.UpdateSet Property

Gets or sets a value indicating whether the field value is set in the database record.

[Visual Basic]

Public Property UpdateSet As FieldUpdateSetModeEnum

[C#]

public FieldUpdateSetModeEnum UpdateSet {get;set;}

[Delphi]

public property UpdateSet: FieldUpdateSetModeEnum read get_UpdateSet write set_UpdateSet;

Remarks

If this property is set to Always, the value in the database is always modified, set to the current field value. If it is set to Never, the value in the database is always left unchanged. If it is set to IfChanged (default), the value in the database is set to the current field value if the current field value is different from the original field value as it was last fetched from the database. The original value can be retrieved using C1DataRow.Item (field, DataRowVersionEnum.Original).


Diagram Class

Diagram Class

Base class for data set diagrams ( DataSetDef) and composite table diagrams ( CompositeTableDef).

For a list of all members of this type, see Diagram Members.

System.Object

C1.Data.SchemaObjects.Diagram

C1.Data.SchemaObjects.CompositeTableDef

C1.Data.SchemaObjects.DataSetDef

[Visual Basic]

MustInherit Public Class Diagram

[C#]

public abstract class Diagram

[Delphi]

type Diagram = class abstract;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


Diagram Members

Diagram Members

Diagram overview

Public Properties

Name | Gets or sets the name of the diagram object.
Schema | Gets the schema the diagram belongs to.
TableViews | Gets the collection of table views.
ViewRelations | Gets the collection of view relations.


Diagram Properties

Diagram Properties

The properties of the Diagram class are listed here. For a complete list of Diagram class members, see the Diagram Members topic.

Public Properties

Name | Gets or sets the name of the diagram object.
Schema | Gets the schema the diagram belongs to.
TableViews | Gets the collection of table views.
ViewRelations | Gets the collection of view relations.


Diagram.Name Property

Diagram.Name Property

Gets or sets the name of the diagram object.

[Visual Basic]

Overridable Public Property Name As String

[C#]

virtual public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


Diagram.Schema Property

Diagram.Schema Property

Gets the schema the diagram belongs to.

[Visual Basic]

Public ReadOnly Property Schema As Schema

[C#]

public Schema Schema {get;}

[Delphi]

public property Schema: Schema read get_Schema;


Diagram.TableViews Property

Diagram.TableViews Property

Gets the collection of table views.

[Visual Basic]

Overridable Public ReadOnly Property TableViews As TableViewCollection

[C#]

virtual public TableViewCollection TableViews {get;}

[Delphi]

public property TableViews: TableViewCollection read get_TableViews;


Diagram.ViewRelations Property

Diagram.ViewRelations Property

Gets the collection of view relations.

[Visual Basic]

Overridable Public ReadOnly Property ViewRelations As ViewRelationCollection

[C#]

virtual public ViewRelationCollection ViewRelations {get;}

[Delphi]

public property ViewRelations: ViewRelationCollection read get_ViewRelations;


Field Class

Field Class

The base class for TableField and TableViewField. Contains common field properties.

For a list of all members of this type, see Field Members.

System.Object

C1.Data.SchemaObjects.Field

C1.Data.Express.C1ExpressField

C1.Data.SchemaObjects.TableField

C1.Data.SchemaObjects.TableViewField

[Visual Basic]

MustInherit Public Class Field

[C#]

public abstract class Field

[Delphi]

type Field = class abstract;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


Field Members

Field Members

Field overview

Public Properties

AllowDbNull | Gets or sets a value indicating whether null or empty string values are allowed in this field.
AutoIncrement | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression | Gets or sets the boolean expression used to test a constraint.
Constraints | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue | Gets or sets the default value for the field when creating new rows.
Description | Gets or sets a description for the field.
EffectiveAllowDbNull | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly | Gets the effective value of the ReadOnly property at run time.
EffectiveReadOnlyUnlessNew | Gets the effective value of the ReadOnlyUnlessNew property at run time.
EffectiveUserReadOnly | Gets the effective value of the UserReadOnly property at run time.
MaxLength | Gets or sets the maximum length of a string field, in characters.
Name | Gets or sets the name of the field.
NativeDbType | Gets or sets the field data type as a native data type of the underlying database.
Precision | Gets or sets the maximum number of digits used to represent the field value.
PrimaryKey | Gets or sets a value indicating whether the field belongs to the table’s primary key.
ReadOnly | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale | Gets or sets the number of decimal places to in the field value.
Type | Gets or sets the type of field data.
Unique | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly | Gets or sets a value indicating whether the user can change this field value using bound controls.


Field Properties

Field Properties

The properties of the Field class are listed here. For a complete list of Field class members, see the Field Members topic.

Public Properties

AllowDbNull | Gets or sets a value indicating whether null or empty string values are allowed in this field.
AutoIncrement | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression | Gets or sets the boolean expression used to test a constraint.
Constraints | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue | Gets or sets the default value for the field when creating new rows.
Description | Gets or sets a description for the field.
EffectiveAllowDbNull | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly | Gets the effective value of the ReadOnly property at run time.
EffectiveReadOnlyUnlessNew | Gets the effective value of the ReadOnlyUnlessNew property at run time.
EffectiveUserReadOnly | Gets the effective value of the UserReadOnly property at run time.
MaxLength | Gets or sets the maximum length of a string field, in characters.
Name | Gets or sets the name of the field.
NativeDbType | Gets or sets the field data type as a native data type of the underlying database.
Precision | Gets or sets the maximum number of digits used to represent the field value.
PrimaryKey | Gets or sets a value indicating whether the field belongs to the table’s primary key.
ReadOnly | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale | Gets or sets the number of decimal places to in the field value.
Type | Gets or sets the type of field data.
Unique | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly | Gets or sets a value indicating whether the user can change this field value using bound controls.


Field.AllowDbNull Property

Field.AllowDbNull Property

Gets or sets a value indicating whether null or empty string values are allowed in this field.

[Visual Basic]

Overridable Public Property AllowDbNull As Boolean

[C#]

virtual public bool AllowDbNull {get;set;}

[Delphi]

public property AllowDbNull: Boolean read get_AllowDbNull write set_AllowDbNull;

Remarks

If this property is set to False, an attempt to assign null or empty string value to this field generates an exception.

The effective value of this property at run time (see EffectiveAllowDbNull) for fields based on other fields (composite table fields, table view fields) is False if the base field’s property value is False, even though the property value itself is independent of the base field’s property value.


Field.AutoIncrement Property

Field.AutoIncrement Property

Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.

[Visual Basic]

Overridable Public Property AutoIncrement As AutoIncrementEnum

[C#]

virtual public AutoIncrementEnum AutoIncrement {get;set;}

[Delphi]

public property AutoIncrement: AutoIncrementEnum read get_AutoIncrement write set_AutoIncrement;

Remarks

The most common way of implementing the autoincrement functionality is using the ClientAndServer option. In this case, your database field must be an autoincrement field (an integer field having autoincrement functionality in the database), and C1DataObjects implements autoincrement functionality on the client. When a new row is added on the client, the field receives a negative autoincrement value (both AutoIncrementSeed and AutoIncrementStep are equal to –1). C1DataObjects uses negative values on the client to ensure their uniqueness, to distinguish them from autoincremented values assigned by the database. When the new row is added to the database table on the server, C1DataObjects gets the autoincrement value assigned by the database and refreshes the field value on the client with this value. For this functionality to work with Oracle, Interbase and other databases that support sequence/generator objects, you must also set the AutoIncrementSequenceName property.


Field.AutoIncrementSeed Property

Field.AutoIncrementSeed Property

Gets or sets the starting value for a field with AutoIncrement value other than None.

[Visual Basic]

Overridable Public Property AutoIncrementSeed As Long

[C#]

virtual public long AutoIncrementSeed {get;set;}

[Delphi]

public property AutoIncrementSeed: Int64 read get_AutoIncrementSeed write set_AutoIncrementSeed;

Remarks

If AutoIncrement = ClientAndServer, the values of the AutoIncrementSeed and AutoIncrementStep properties are equal to –1, to distinguish client autoincrement values from those of the server, see AutoIncrement.


Field.AutoIncrementSequenceName Property

Field.AutoIncrementSequenceName Property

Gets or sets the name of a sequence or generator database object used for autoincrement on the server.

[Visual Basic]

Overridable Public Property AutoIncrementSequenceName As String

[C#]

virtual public string AutoIncrementSequenceName {get;set;}

[Delphi]

public property AutoIncrementSequenceName: String read get_AutoIncrementSequenceName write set_AutoIncrementSequenceName;

Remarks

This property is used to enable autoincrement key field functionality in Oracle, InterBase and other databases that support special database objects used to generate unique (autoincrementing) values. With SQL Server, Access and Sybase, the autoincrement (identity) is assigned automatically by the database and can be retrieved with a special SQL command, see the IdentityColumnLastValueSelect property. In Oracle and Interbase, setting the key value is not done automatically by the database. It can be done either automatically by C1DataObjects, if you set IdentityColumnRetrieveMode = BeforeInsertCommand, or by a trigger, in which case you set IdentityColumnRetrieveMode = AfterInsertCommand. In both cases, in addition to setting the IdentityColumnLastValueSelect property that retrieves the autoincremented value, you must set the AutoIncrementSequenceName property to the name of the object generating the value, a sequence in Oracle, a generator in Interbase.


Field.AutoIncrementStep Property

Field.AutoIncrementStep Property

Gets or sets the increment for a field with AutoIncrement value other than None.

[Visual Basic]

Overridable Public Property AutoIncrementStep As Long

[C#]

virtual public long AutoIncrementStep {get;set;}

[Delphi]

public property AutoIncrementStep: Int64 read get_AutoIncrementStep write set_AutoIncrementStep;

Remarks

If AutoIncrement = ClientAndServer, the values of the AutoIncrementSeed and AutoIncrementStep properties are equal to –1, to distinguish client autoincrement values from those of the server, see AutoIncrement.


Field.CalculationCondition Property

Field.CalculationCondition Property

Gets or sets an optional boolean expression defining applicability of a calculation.

[Visual Basic]

Public Property CalculationCondition As String

[C#]

public string CalculationCondition {get;set;}

[Delphi]

public property CalculationCondition: String read get_CalculationCondition write set_CalculationCondition;

Remarks

The Field’s CalculationCondition property corresponds to the Condition property of the first FieldCalculationInfo object in the Calculations collection. Since in most cases Calculations consists of a single calculation, this field property, together with Field’s CalculationExpression and CalculationFireEvent makes it easier to specify a single calculation for a field, without using the collection editor.


Field.CalculationExpression Property

Field.CalculationExpression Property

Gets or sets the expression producing the result of a calculation.

[Visual Basic]

Public Property CalculationExpression As String

[C#]

public string CalculationExpression {get;set;}

[Delphi]

public property CalculationExpression: String read get_CalculationExpression write set_CalculationExpression;

Remarks

The Field’s CalculationExpression property corresponds to the Expression property of the first FieldCalculationInfo object in the Calculations collection. Since in most cases Calculations consists of a single calculation, this field property, together with Field’s CalculationCondition and CalculationFireEvent makes it easier to specify a single calculation for a field, without using the collection editor.


Field.CalculationFireEvent Property

Field.CalculationFireEvent Property

Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.

[Visual Basic]

Public Property CalculationFireEvent As Boolean

[C#]

public bool CalculationFireEvent {get;set;}

[Delphi]

public property CalculationFireEvent: Boolean read get_CalculationFireEvent write set_CalculationFireEvent;

Remarks

The Field’s CalculationFireEvent property corresponds to the FireEvent property of the first FieldCalculationInfo object in the Calculations collection. Since in most cases Calculations consists of a single calculation, this field property, together with Field’s CalculationExpression and CalculationCondition makes it easier to specify a single calculation for a field, without using the collection editor.


Field.Calculations Property

Field.Calculations Property

Gets the collection of field calculations, FieldCalculationInfo objects.

[Visual Basic]

Public ReadOnly Property Calculations As FieldCalculationCollection

[C#]

public FieldCalculationCollection Calculations {get;}

[Delphi]

public property Calculations: FieldCalculationCollection read get_Calculations;


Field.ConstraintCondition Property

Field.ConstraintCondition Property

Gets or sets an optional boolean expression defining applicability of a calculation.

[Visual Basic]

Public Property ConstraintCondition As String

[C#]

public string ConstraintCondition {get;set;}

[Delphi]

public property ConstraintCondition: String read get_ConstraintCondition write set_ConstraintCondition;

Remarks

If this expression is empty or evaluates to True, the CalculationExpression is evaluated and assigned to the field. If it evaluates to False, this calculation is skipped.

The Field’s CalculationCondition property corresponds to the Condition property of the first FieldCalculationInfo object in the Calculations collection. Since in most cases Calculations consists of a single calculation, this field property, together with Field’s CalculationExpression and CalculationFireEvent makes it easier to specify a single calculation for a field, without using the collection editor.


Field.ConstraintErrorDescription Property

Field.ConstraintErrorDescription Property

Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.

[Visual Basic]

Public Property ConstraintErrorDescription As String

[C#]

public string ConstraintErrorDescription {get;set;}

[Delphi]

public property ConstraintErrorDescription: String read get_ConstraintErrorDescription write set_ConstraintErrorDescription;

Remarks

The Field’s ConstraintErrorDescription property corresponds to the ErrorDescription property of the first ConstraintInfo object in the Constraints collection. Since in many cases Constraints consists of a single constraint, this field property, together with Field’s ConstraintCondition and ConstraintExpression makes it easier to specify a single constraint for a field, without using the collection editor.


Field.ConstraintExpression Property

Field.ConstraintExpression Property

Gets or sets the boolean expression used to test a constraint.

[Visual Basic]

Public Property ConstraintExpression As String

[C#]

public string ConstraintExpression {get;set;}

[Delphi]

public property ConstraintExpression: String read get_ConstraintExpression write set_ConstraintExpression;

Remarks

The Field’s ConstraintExpression property corresponds to the Expression property of the first ConstraintInfo object in the Constraints collection. Since in many cases Constraints consists of a single constraint, this field property, together with Field’s ConstraintCondition and ConstraintErrorDescription makes it easier to specify a single constraint for a field, without using the collection editor.


Field.Constraints Property

Field.Constraints Property

Gets the collection of field constraints, ConstraintInfo objects.

[Visual Basic]

Public ReadOnly Property Constraints As ConstraintCollection

[C#]

public ConstraintCollection Constraints {get;}

[Delphi]

public property Constraints: ConstraintCollection read get_Constraints;


Field.ConvertEmptyToNull Property

Field.ConvertEmptyToNull Property

Gets or sets a value indicating whether empty strings are stored as DbNull values.

[Visual Basic]

Overridable Public Property ConvertEmptyToNull As YesNoDefaultEnum

[C#]

virtual public YesNoDefaultEnum ConvertEmptyToNull {get;set;}

[Delphi]

public property ConvertEmptyToNull: YesNoDefaultEnum read get_ConvertEmptyToNull write set_ConvertEmptyToNull;


Field.ConvertNullToEmpty Property

Field.ConvertNullToEmpty Property

Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.

[Visual Basic]

Overridable Public Property ConvertNullToEmpty As YesNoDefaultEnum

[C#]

virtual public YesNoDefaultEnum ConvertNullToEmpty {get;set;}

[Delphi]

public property ConvertNullToEmpty: YesNoDefaultEnum read get_ConvertNullToEmpty write set_ConvertNullToEmpty;


Field.DefaultValue Property

Field.DefaultValue Property

Gets or sets the default value for the field when creating new rows.

[Visual Basic]

Public Property DefaultValue As Object

[C#]

public object DefaultValue {get;set;}

[Delphi]

public property DefaultValue: Object read get_DefaultValue write set_DefaultValue;


Field.Description Property

Field.Description Property

Gets or sets a description for the field.

[Visual Basic]

Public Property Description As String

[C#]

public string Description {get;set;}

[Delphi]

public property Description: String read get_Description write set_Description;


Field.EffectiveAllowDbNull Property

Field.EffectiveAllowDbNull Property

Gets the effective value of the AllowDbNull property at run time.

[Visual Basic]

Public ReadOnly Property EffectiveAllowDbNull As Boolean

[C#]

public bool EffectiveAllowDbNull {get;}

[Delphi]

public property EffectiveAllowDbNull: Boolean read get_EffectiveAllowDbNull;

Remarks

Although a field’s AllowDbNull property may be True, it will behave as if it is False if the field is based on another field and that field’s AllowDbNull is set to False. The EffectiveAllowDbNull property allows you to get this effective value.

A table view field is based on a table field if the table view field’s TableField property is not empty.

A composite table field is based on a table field if the composite table field’s TableViewField property is not empty and TableField is not empty.


Field.EffectiveReadOnly Property

Field.EffectiveReadOnly Property

Gets the effective value of the ReadOnly property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveReadOnly As Boolean

[C#]

virtual public bool EffectiveReadOnly {get;}

[Delphi]

public property EffectiveReadOnly: Boolean read get_EffectiveReadOnly;

Remarks

Although a field’s ReadOnly property may be False, it will behave as if it is True if the field is based on another field and that field’s ReadOnly is set to False. The EffectiveReadOnly property allows you to get this effective value. A table view field is based on a table field if the table view field’s TableField property is not empty. A composite table field is based on a table field if the composite table field’s TableViewField property is not empty and TableViewField.TableField is not empty.


Field.EffectiveReadOnlyUnlessNew Property

Field.EffectiveReadOnlyUnlessNew Property

Gets the effective value of the ReadOnlyUnlessNew property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveReadOnlyUnlessNew As Boolean

[C#]

virtual public bool EffectiveReadOnlyUnlessNew {get;}

[Delphi]

public property EffectiveReadOnlyUnlessNew: Boolean read get_EffectiveReadOnlyUnlessNew;

Remarks

Although a field’s ReadOnlyUnlessNew property may be False, it will behave as if it is True if the field is based on another field and that field’s ReadOnlyUnlessNew is set to False. The EffectiveReadOnly property allows you to get this effective value.

A table view field is based on a table field if the table view field’s TableField property is not empty.

A composite table field is based on a table field if the composite table field’s TableViewField property is not empty and TableField is not empty.


Field.EffectiveUserReadOnly Property

Field.EffectiveUserReadOnly Property

Gets the effective value of the UserReadOnly property at run time.

[Visual Basic]

Overridable Public ReadOnly Property EffectiveUserReadOnly As Boolean

[C#]

virtual public bool EffectiveUserReadOnly {get;}

[Delphi]

public property EffectiveUserReadOnly: Boolean read get_EffectiveUserReadOnly;

Remarks

Although a field’s UserReadOnly property may be False, it will behave as if it is True if the field is based on another field and that field’s UserReadOnly is set to False. The EffectiveReadOnly property allows you to get this effective value.

A table view field is based on a table field if the table view field’s TableField property is not empty.

A composite table field is based on a table field if the composite table field’s TableViewField property is not empty and TableField is not empty.


Field.MaxLength Property

Field.MaxLength Property

Gets or sets the maximum length of a string field, in characters.

[Visual Basic]

Overridable Public Property MaxLength As Integer

[C#]

virtual public int MaxLength {get;set;}

[Delphi]

public property MaxLength: Int32 read get_MaxLength write set_MaxLength;

Remarks

If the length is unlimited, the value is 0 (default).


Field.Name Property

Field.Name Property

Gets or sets the name of the field.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


Field.NativeDbType Property

Field.NativeDbType Property

Gets or sets the field data type as a native data type of the underlying database.

[Visual Basic]

Overridable Public Property NativeDbType As Integer

[C#]

virtual public int NativeDbType {get;set;}

[Delphi]

public property NativeDbType: Int32 read get_NativeDbType write set_NativeDbType;

Remarks

NativeDbType contains the numeric value corresponding to one of the values of the enumerated type describing all possible data types for the database access provider. These enumerations are:

for OleDb: System.Data.OleDb.OleDbType,

for SqlServer: System.Data.SqlDbType,

for Oracle: Oracle.DataAccess.Client.OracleDbType,

for MSOracle: System.Data.OracleClient.OracleType,

for BorlandDataProvider: Borland.Data.Common.BdpType,

for others (Custom): enumeration type is specified in the NativeTypeTypeName property.

This property is used for database update, to specify the type of command parameters containing field values that are written to the database. Sometimes it is essential to specify the type for database update more exactly than it can be inferred from the .NET type of the field (from C1.Data.SchemaObjects.Field.DataType). For example, DataType = String can be further specialized to be a Unicode or ASCII string. When you create a schema importing it from database structure, Field.NativeDbType is automatically set to the actual type of the database field. In those rare cases when you need to change it, you can set the Field.NativeDbType property to a specific native type you need, or you can use Field.NativeDbType = Any (-1) to indicate that inferring parameter type from C1.Data.SchemaObjects.Field.DataType is good enough (or not needed at all, as, for example, in calculated fields).


Field.Precision Property

Field.Precision Property

Gets or sets the maximum number of digits used to represent the field value.

[Visual Basic]

Overridable Public Property Precision As Byte

[C#]

virtual public Byte Precision {get;set;}

[Delphi]

public property Precision: Byte read get_Precision write set_Precision;


Field.PrimaryKey Property

Field.PrimaryKey Property

Gets or sets a value indicating whether the field belongs to the table’s primary key.

[Visual Basic]

Overridable Public Property PrimaryKey As Boolean

[C#]

virtual public bool PrimaryKey {get;set;}

[Delphi]

public property PrimaryKey: Boolean read get_PrimaryKey write set_PrimaryKey;

Remarks

Every modifiable (ReadOnly:Table set to False) table must have primary key, that is, at least one field with PrimaryKey property set to True. Primary key values must be unique in table rows, an attempt to set a duplicate primary key generates an exception.


Field.ReadOnly Property

Field.ReadOnly Property

Gets or sets a value indicating whether modifications to field values are allowed.

[Visual Basic]

Overridable Public Property ReadOnly As Boolean

[C#]

virtual public bool ReadOnly {get;set;}

[Delphi]

public property ReadOnly: Boolean read get_ReadOnly write set_ReadOnly;

Remarks

If this property is set to True, modifying this field’s values is not allowed.

The effective value of this property at run time (see EffectiveReadOnly) for fields based on other fields (composite table fields, table view fields) is True if the base field’s property value is True, even though the property value itself is independent of the base field’s property value.


Field.ReadOnlyUnlessNew Property

Field.ReadOnlyUnlessNew Property

Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.

[Visual Basic]

Overridable Public Property ReadOnlyUnlessNew As Boolean

[C#]

virtual public bool ReadOnlyUnlessNew {get;set;}

[Delphi]

public property ReadOnlyUnlessNew: Boolean read get_ReadOnlyUnlessNew write set_ReadOnlyUnlessNew;

Remarks

If this property is set to True, modifying this field’s values is allowed only in newly added rows and that only while the row is in detached state ( EndEdit not yet called, see Keys Assigned by Client: New Row Detached and Attached State) The effective value of this property at run time (see EffectiveReadOnlyUnlessNew) for fields based on other fields (composite table fields, table view fields) is True if the base field’s property value is True, even though the property value itself is independent of the base field’s property value.


Field.Scale Property

Field.Scale Property

Gets or sets the number of decimal places to in the field value.

[Visual Basic]

Overridable Public Property Scale As Byte

[C#]

virtual public Byte Scale {get;set;}

[Delphi]

public property Scale: Byte read get_Scale write set_Scale;


Field.Type Property

Field.Type Property

Gets or sets the type of field data.

[Visual Basic]

Public Property Type As Type

[C#]

public Type Type {get;set;}

[Delphi]

public property Type: Type read get_Type write set_Type;


Field.Unique Property

Field.Unique Property

Gets or sets a value indicating whether the values of this field in each row must be unique.

[Visual Basic]

Overridable Public Property Unique As Boolean

[C#]

virtual public bool Unique {get;set;}

[Delphi]

public property Unique: Boolean read get_Unique write set_Unique;

Remarks

If it is set to True, an attempt to assign a duplicate value to this field generates an exception.


Field.UserReadOnly Property

Field.UserReadOnly Property

Gets or sets a value indicating whether the user can change this field value using bound controls.

[Visual Basic]

Overridable Public Property UserReadOnly As Boolean

[C#]

virtual public bool UserReadOnly {get;set;}

[Delphi]

public property UserReadOnly: Boolean read get_UserReadOnly write set_UserReadOnly;


FieldDefaults Class

FieldDefaults Class

Contains various default settings used for fields accessed through a certain data set.

For a list of all members of this type, see FieldDefaults Members.

System.Object

C1.Data.SchemaObjects.FieldDefaults

[Visual Basic]

Public Class FieldDefaults

[C#]

public class FieldDefaults

[Delphi]

type FieldDefaults = class;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


FieldDefaults Members

FieldDefaults Members

FieldDefaults overview

Public Constructors

FieldDefaults Constructor

Initializes a new instance of the FieldDefaults class.

Public Properties

ConvertEmptyToNull | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty | Gets or sets a value indicating whether DbNull values of string fields are returned as empty strings.


FieldDefaults Constructor

FieldDefaults Constructor

Initializes a new instance of the FieldDefaults class.

[Visual Basic]

Public Function New()

[C#]

public FieldDefaults()

[Delphi]

public constructor Create();


FieldDefaults Properties

FieldDefaults Properties

The properties of the FieldDefaults class are listed here. For a complete list of FieldDefaults class members, see the FieldDefaults Members topic.

Public Properties

ConvertEmptyToNull | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty | Gets or sets a value indicating whether DbNull values of string fields are returned as empty strings.


FieldDefaults.ConvertEmptyToNull Property

FieldDefaults.ConvertEmptyToNull Property

Gets or sets a value indicating whether empty strings are stored as DbNull values.

[Visual Basic]

Public Property ConvertEmptyToNull As Boolean

[C#]

public bool ConvertEmptyToNull {get;set;}

[Delphi]

public property ConvertEmptyToNull: Boolean read get_ConvertEmptyToNull write set_ConvertEmptyToNull;

Remarks

If ConvertEmptyToNull is set to Default (default option for a field), the value of this property, defined in FieldDefaults, takes effect for the field.


FieldDefaults.ConvertNullToEmpty Property

FieldDefaults.ConvertNullToEmpty Property

Gets or sets a value indicating whether DbNull values of string fields are returned as empty strings.

[Visual Basic]

Public Property ConvertNullToEmpty As Boolean

[C#]

public bool ConvertNullToEmpty {get;set;}

[Delphi]

public property ConvertNullToEmpty: Boolean read get_ConvertNullToEmpty write set_ConvertNullToEmpty;

Remarks

If ConvertNullToEmpty is set to Default (default option for a field), the value of this property, defined in FieldDefaults, takes effect for the field.


FieldUpdateSetModeEnum Enumeration

FieldUpdateSetModeEnum Enumeration

Specifies whether field value is set in the database.

[Visual Basic]

Public Enum FieldUpdateSetModeEnum

[C#]

public enum FieldUpdateSetModeEnum

[Delphi]

type FieldUpdateSetModeEnum = (Always, IfChanged, Never);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Always | Value is always assigned to the database field.
IfChanged | Value is assigned to the database field if the value has been changed since it was fetched from the database.
Never | Value is never assigned to the database field.

See Also

C1.Data.SchemaObjects Namespace


IdentityColumnRetrieveModeEnum Enumeration

IdentityColumnRetrieveModeEnum Enumeration

Indicates how autoincrement key value is retrieved for inserted row: before, after or in the same scope with the INSERT command. Used in the IdentityColumnRetrieveMode property of a connection.

[Visual Basic]

Public Enum IdentityColumnRetrieveModeEnum

[C#]

public enum IdentityColumnRetrieveModeEnum

[Delphi]

type IdentityColumnRetrieveModeEnum = (AfterInsertCommand, BeforeInsertCommand, InInsertCommand);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
AfterInsertCommand | Autoincrement value is retrieved by a separate command after the INSERT command has been executed. This option is used with Microsoft Access and can be used with other databases.
BeforeInsertCommand | Autoincrement key value is obtained (generated by a sequence/generator object) before executing the INSERT command. This option is used with Oracle, Interbase and other databases that support special database objects for generating autoincrement (identity) values. This option is used if there is no on INSERT trigger setting the autoincrement key value. If there is such trigger, the AfterInsertCommand option is used.
InInsertCommand | Autoincrement key value retrieval is done by the same command that inserts the row. The generated command consists of two SQL commands separated by semicolon: first INSERT, then the identity retrieval command. This option is used with Sql Server and can be used with other databases. It is necessary to support the SCOPE_IDENTITY() function that is used for identity retrieval.

See Also

C1.Data.SchemaObjects Namespace


JoinCondition Class

JoinCondition Class

Represents an equality condition between a parent and a child field of a SimpleRelation.

For a list of all members of this type, see JoinCondition Members.

System.Object

C1.Data.SchemaObjects.JoinCondition

[Visual Basic]

Public Class JoinCondition

[C#]

public class JoinCondition

[Delphi]

type JoinCondition = class;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


JoinCondition Members

JoinCondition Members

JoinCondition overview

Public Constructors

JoinCondition Constructor

Initializes a new instance of the JoinCondition class.

Public Properties

ChildField | Gets or sets the child field of the join condition.
Owner | Gets the collection to which the join object belongs.
ParentField | Gets or sets the parent field of the join condition.


JoinCondition Constructor

JoinCondition Constructor

Initializes a new instance of the JoinCondition class.

[Visual Basic]

Public Function New( _

ByVal owner As JoinConditionCollection _

)

[C#]

public JoinCondition(

JoinConditionCollection owner

);

[Delphi]

public constructor Create(

owner: JoinConditionCollection

);

Parameters

owner

The collection of join conditions of a relation this join condition belongs to.


JoinCondition Properties

JoinCondition Properties

The properties of the JoinCondition class are listed here. For a complete list of JoinCondition class members, see the JoinCondition Members topic.

Public Properties

ChildField | Gets or sets the child field of the join condition.
Owner | Gets the collection to which the join object belongs.
ParentField | Gets or sets the parent field of the join condition.


JoinCondition.ChildField Property

JoinCondition.ChildField Property

Gets or sets the child field of the join condition.

[Visual Basic]

Public Property ChildField As TableField

[C#]

public TableField ChildField {get;set;}

[Delphi]

public property ChildField: TableField read get_ChildField write set_ChildField;


JoinCondition.Owner Property

JoinCondition.Owner Property

Gets the collection to which the join object belongs.

[Visual Basic]

Public ReadOnly Property Owner As JoinConditionCollection

[C#]

public JoinConditionCollection Owner {get;}

[Delphi]

public property Owner: JoinConditionCollection read get_Owner;


JoinCondition.ParentField Property

JoinCondition.ParentField Property

Gets or sets the parent field of the join condition.

[Visual Basic]

Public Property ParentField As TableField

[C#]

public TableField ParentField {get;set;}

[Delphi]

public property ParentField: TableField read get_ParentField write set_ParentField;


JoinConditionCollection Class

JoinConditionCollection Class

Represents a collection of JoinCondition objects of a SimpleRelation.

For a list of all members of this type, see JoinConditionCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.JoinConditionCollection

[Visual Basic]

Public Class JoinConditionCollection

Inherits CollectionBase

[C#]

public class JoinConditionCollection : CollectionBase

[Delphi]

type JoinConditionCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


JoinConditionCollection Members

JoinConditionCollection Members

JoinConditionCollection overview

Public Properties

Item | Gets the element of the collection at the specified index.
Relation | Gets the SimpleRelation this collection belongs to.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


JoinConditionCollection Properties

JoinConditionCollection Properties

The properties of the JoinConditionCollection class are listed here. For a complete list of JoinConditionCollection class members, see the JoinConditionCollection Members topic.

Public Properties

Item | Gets the element of the collection at the specified index.
Relation | Gets the SimpleRelation this collection belongs to.


JoinConditionCollection.Item Property

JoinConditionCollection.Item Property

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As JoinCondition

[C#]

public JoinCondition this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: JoinCondition read get_Item;

Parameters

index

The zero-based index of the element.


JoinConditionCollection.Relation Property

JoinConditionCollection.Relation Property

Gets the SimpleRelation this collection belongs to.

[Visual Basic]

Public ReadOnly Property Relation As Relation

[C#]

public Relation Relation {get;}

[Delphi]

public property Relation: Relation read get_Relation;


JoinConditionCollection Methods

JoinConditionCollection Methods

The methods of the JoinConditionCollection class are listed here. For a complete list of JoinConditionCollection class members, see the JoinConditionCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


JoinConditionCollection.Add Method

JoinConditionCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal cond As JoinCondition _

)

[C#]

public void Add(

JoinCondition cond

);

[Delphi]

public procedure Add(

cond: JoinCondition

);

Parameters

cond

The object to be added to the end of the collection.


JoinConditionCollection.Contains Method

JoinConditionCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal join As JoinCondition _

) As Boolean

[C#]

public bool Contains(

JoinCondition join

);

[Delphi]

public function Contains(

join: JoinCondition

): Boolean;

Parameters

join

The Object to locate in the collection.

Return Value


JoinConditionCollection.CopyTo Method

JoinConditionCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As JoinCondition(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

JoinCondition[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of JoinCondition;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


JoinConditionCollection.IndexOf Method

JoinConditionCollection.IndexOf Method

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal join As JoinCondition _

) As Integer

[C#]

public int IndexOf(

JoinCondition join

);

[Delphi]

public function IndexOf(

join: JoinCondition

): Int32;

Parameters

join

The Object to locate in the collection.

Return Value


JoinConditionCollection.Insert Method

JoinConditionCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal join As JoinCondition _

)

[C#]

public void Insert(

int index,

JoinCondition join

);

[Delphi]

public procedure Insert(

index: Int32;

join: JoinCondition

);

Parameters

index

The zero-based index at which object should be inserted.

join

The object to insert.


JoinConditionCollection.Remove Method

JoinConditionCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal join As JoinCondition _

)

[C#]

public void Remove(

JoinCondition join

);

[Delphi]

public procedure Remove(

join: JoinCondition

);

Parameters

join

The object to remove from the collection.


ReferentialIntegrityRuleEnum Enumeration

ReferentialIntegrityRuleEnum Enumeration

Specifies the action applied to child rows when their parent key is modified or deleted.

[Visual Basic]

Public Enum ReferentialIntegrityRuleEnum

[C#]

public enum ReferentialIntegrityRuleEnum

[Delphi]

type ReferentialIntegrityRuleEnum = (Cascade, None, SetDefault, SetNull);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Cascade | Delete or update child rows.
None | No action taken on child rows.
SetDefault | Set values in child rows to the value specified by the DefaultValue property.
SetNull | Set values in child rows to DbNull.

See Also

C1.Data.SchemaObjects Namespace


Relation Class

Relation Class

Base class for simple and composite relations.

For a list of all members of this type, see Relation Members.

System.Object

C1.Data.SchemaObjects.Relation

C1.Data.SchemaObjects.CompositeRelation

C1.Data.SchemaObjects.SimpleRelation

[Visual Basic]

Public Class Relation

[C#]

public class Relation

[Delphi]

type Relation = class;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


Relation Members

Relation Members

Relation overview

Public Constructors

Relation Constructor

Initializes a new instance of the Relation class.

Public Properties

Cardinality | Gets or sets one of the two RelationCardinalityEnum values.
Child | Gets or sets the child table of the relation.
Description | Gets or sets a description for the relation.
Name | Gets or sets the relation name.
Parent | Gets or sets the parent table of the relation.
Schema | Gets the schema the relation belongs to.


Relation Constructor

Relation Constructor

Overload List

Initializes a new instance of the Relation class.

[Visual Basic] Public Function New()

[C#] public Relation();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the Relation class.

[Visual Basic] Public Function New(Schema, Table, Table)

[C#] public Relation(Schema, Table, Table);

[Delphi] public constructor Create(Schema; Table; Table); overload;


Relation Constructor ()

Relation Constructor ()

Initializes a new instance of the Relation class.

[Visual Basic]

Public Function New()

[C#]

public Relation()

[Delphi]

public constructor Create(); overload;


Relation Constructor (Schema, Table, Table)

Relation Constructor (Schema, Table, Table)

Initializes a new instance of the Relation class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema, _

ByVal parentTable As Table, _

ByVal childTable As Table _

)

[C#]

public Relation(

Schema schema,

Table parentTable,

Table childTable

);

[Delphi]

public constructor Create(

schema: Schema;

parentTable: Table;

childTable: Table

); overload;

Parameters

schema

Schema the relation belongs to.

parentTable

Parent table of the relation.

childTable

Child table of the relation.


Relation Properties

Relation Properties

The properties of the Relation class are listed here. For a complete list of Relation class members, see the Relation Members topic.

Public Properties

Cardinality | Gets or sets one of the two RelationCardinalityEnum values.
Child | Gets or sets the child table of the relation.
Description | Gets or sets a description for the relation.
Name | Gets or sets the relation name.
Parent | Gets or sets the parent table of the relation.
Schema | Gets the schema the relation belongs to.


Relation.Cardinality Property

Relation.Cardinality Property

Gets or sets one of the two RelationCardinalityEnum values.

[Visual Basic]

Public Property Cardinality As RelationCardinalityEnum

[C#]

public RelationCardinalityEnum Cardinality {get;set;}

[Delphi]

public property Cardinality: RelationCardinalityEnum read get_Cardinality write set_Cardinality;


Relation.Child Property

Relation.Child Property

Gets or sets the child table of the relation.

[Visual Basic]

Public Property Child As Table

[C#]

public Table Child {get;set;}

[Delphi]

public property Child: Table read get_Child write set_Child;


Relation.Description Property

Relation.Description Property

Gets or sets a description for the relation.

[Visual Basic]

Public Property Description As String

[C#]

public string Description {get;set;}

[Delphi]

public property Description: String read get_Description write set_Description;

Remarks

This value is displayed in the Schema Designer's Information window when you select the relation.


Relation.Name Property

Relation.Name Property

Gets or sets the relation name.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


Relation.Parent Property

Relation.Parent Property

Gets or sets the parent table of the relation.

[Visual Basic]

Public Property Parent As Table

[C#]

public Table Parent {get;set;}

[Delphi]

public property Parent: Table read get_Parent write set_Parent;


Relation.Schema Property

Relation.Schema Property

Gets the schema the relation belongs to.

[Visual Basic]

Public ReadOnly Property Schema As Schema

[C#]

public Schema Schema {get;}

[Delphi]

public property Schema: Schema read get_Schema;


RelationCardinalityEnum Enumeration

RelationCardinalityEnum Enumeration

Specifies the cardinality of a relation.

[Visual Basic]

Public Enum RelationCardinalityEnum

[C#]

public enum RelationCardinalityEnum

[Delphi]

type RelationCardinalityEnum = (ManyToOne, OneToMany);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
ManyToOne | Many-to-one relation.
OneToMany | One-to-many relation.

See Also

C1.Data.SchemaObjects Namespace


RelationCollection Class

RelationCollection Class

Represents a collection of Relation objects.

For a list of all members of this type, see RelationCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.RelationCollection

[Visual Basic]

Public Class RelationCollection

Inherits CollectionBase

[C#]

public class RelationCollection : CollectionBase

[Delphi]

type RelationCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


RelationCollection Members

RelationCollection Members

RelationCollection overview

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object.


RelationCollection Properties

RelationCollection Properties

The properties of the RelationCollection class are listed here. For a complete list of RelationCollection class members, see the RelationCollection Members topic.

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.


RelationCollection.Item Property

RelationCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default Property Item(Integer) As Relation

[C#] public Relation this[int]{get;set;}

[Delphi] public property Item[index: Int32]: Relation read get_Item write set_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Relation

[C#] public Relation this[string]{get;}

[Delphi] public property Item[name: String]: Relation read get_Item;


RelationCollection.Item Property (Int32)

RelationCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default Property Item( _

ByVal index As Integer _

) As Relation

[C#]

public Relation this[

int index

] {get;set;}

[Delphi]

public property Item[

index: Int32

]: Relation read get_Item write set_Item;

Parameters

index

The index of the object.


RelationCollection.Item Property (String)

RelationCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As Relation

[C#]

public Relation this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: Relation read get_Item;

Parameters

name

The Name of the object.


RelationCollection Methods

RelationCollection Methods

The methods of the RelationCollection class are listed here. For a complete list of RelationCollection class members, see the RelationCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object.


RelationCollection.Add Method

RelationCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As Relation _

)

[C#]

public void Add(

Relation obj

);

[Delphi]

public procedure Add(

obj: Relation

);

Parameters

obj

The object to be added to the end of the collection.


RelationCollection.Contains Method

RelationCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element.

Return Value


RelationCollection.CopyTo Method

RelationCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As Relation(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

Relation[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of Relation;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


RelationCollection.IndexOf Method

RelationCollection.IndexOf Method

Overload List

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(Relation) As Integer

[C#] public int IndexOf(Relation);

[Delphi] public function IndexOf(Relation) : Int32; overload;

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;


RelationCollection.IndexOf Method (Relation)

RelationCollection.IndexOf Method (Relation)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal relation As Relation _

) As Integer

[C#]

public int IndexOf(

Relation relation

);

[Delphi]

public function IndexOf(

relation: Relation

): Int32; overload;

Parameters

relation

The element of the collection.

Return Value

Gets the index of an object.


RelationCollection.IndexOf Method (String)

RelationCollection.IndexOf Method (String)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element.

Return Value

Returns the index of the object.


RelationCollection.Insert Method

RelationCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As Relation _

)

[C#]

public void Insert(

int index,

Relation obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: Relation

);

Parameters

index

The zero-based index at which obj should be inserted.

obj

The object to insert.


RelationCollection.Remove Method

RelationCollection.Remove Method

Removes the first occurrence of a specific object.

[Visual Basic]

Public Sub Remove( _

ByVal obj As Relation _

)

[C#]

public void Remove(

Relation obj

);

[Delphi]

public procedure Remove(

obj: Relation

);

Parameters

obj

The Object to remove from the collection.


Schema Class

Schema Class

The main class of the C1.Data.SchemaObjects namespace, representing a schema.

For a list of all members of this type, see Schema Members.

System.Object

C1.Data.SchemaObjects.Schema

[Visual Basic]

Public Class Schema

Implements ISerializable

[C#]

public class Schema : ISerializable

[Delphi]

type Schema = class (TObject, ISerializable);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


Schema Members

Schema Members

Schema overview

Public Properties

Connections | Gets the connection collection.
DataSetDefs | Gets the data set definition collection.
Relations | Gets the relation collection.
Tables | Gets the table collection.

Public Methods

Load | Overloaded. Loads the schema from a file or stream.
Save | Overloaded. Saves the schema in a file or stream.


Schema Properties

Schema Properties

The properties of the Schema class are listed here. For a complete list of Schema class members, see the Schema Members topic.

Public Properties

Connections | Gets the connection collection.
DataSetDefs | Gets the data set definition collection.
Relations | Gets the relation collection.
Tables | Gets the table collection.


Schema.Connections Property

Schema.Connections Property

Gets the connection collection.

[Visual Basic]

Public ReadOnly Property Connections As ConnectionCollection

[C#]

public ConnectionCollection Connections {get;}

[Delphi]

public property Connections: ConnectionCollection read get_Connections;


Schema.DataSetDefs Property

Schema.DataSetDefs Property

Gets the data set definition collection.

[Visual Basic]

Public ReadOnly Property DataSetDefs As DataSetDefCollection

[C#]

public DataSetDefCollection DataSetDefs {get;}

[Delphi]

public property DataSetDefs: DataSetDefCollection read get_DataSetDefs;


Schema.Relations Property

Schema.Relations Property

Gets the relation collection.

[Visual Basic]

Public ReadOnly Property Relations As RelationCollection

[C#]

public RelationCollection Relations {get;}

[Delphi]

public property Relations: RelationCollection read get_Relations;


Schema.Tables Property

Schema.Tables Property

Gets the table collection.

[Visual Basic]

Public ReadOnly Property Tables As TableCollection

[C#]

public TableCollection Tables {get;}

[Delphi]

public property Tables: TableCollection read get_Tables;


Schema Methods

Schema Methods

The methods of the Schema class are listed here. For a complete list of Schema class members, see the Schema Members topic.

Public Methods

Load | Overloaded. Loads the schema from a file or stream.
Save | Overloaded. Saves the schema in a file or stream.


Schema.Load Method

Schema.Load Method

Overload List

Loads the schema from a file or stream.

[Visual Basic] Overloads Public Shared Function Load(Stream) As Schema

[C#] public static Schema Load(Stream);

[Delphi] public class function Load(Stream) : Schema; overload;

Loads the schema from a file or stream.

[Visual Basic] Overloads Public Shared Function Load(String) As Schema

[C#] public static Schema Load(string);

[Delphi] public class function Load(String) : Schema; overload;


Schema.Load Method (Stream)

Schema.Load Method (Stream)

Loads the schema from a file or stream.

[Visual Basic]

Overloads Public Shared Function Load( _

ByVal stream As Stream _

) As Schema

[C#]

public static Schema Load(

Stream stream

);

[Delphi]

public class function Load(

stream: Stream

): Schema; overload;

Parameters

stream

The stream from which the schema is loaded.


Schema.Load Method (String)

Schema.Load Method (String)

Loads the schema from a file or stream.

[Visual Basic]

Overloads Public Shared Function Load( _

ByVal path As String _

) As Schema

[C#]

public static Schema Load(

string path

);

[Delphi]

public class function Load(

path: String

): Schema; overload;

Parameters

path

Full name of the file from which the schema is loaded.


Schema.Save Method

Schema.Save Method

Overload List

Saves the schema in a file or stream.

[Visual Basic] Overloads Public Sub Save(Stream)

[C#] public Save(Stream);

[Delphi] public procedure Save(Stream); overload;

Saves the schema in a file or stream.

[Visual Basic] Overloads Public Sub Save(String)

[C#] public Save(string);

[Delphi] public procedure Save(String); overload;


Schema.Save Method (Stream)

Schema.Save Method (Stream)

Saves the schema in a file or stream.

[Visual Basic]

Overloads Public Sub Save( _

ByVal stream As Stream _

)

[C#]

public void Save(

Stream stream

);

[Delphi]

public procedure Save(

stream: Stream

); overload;

Parameters

stream

The stream where the schema is saved.


Schema.Save Method (String)

Schema.Save Method (String)

Saves the schema in a file or stream.

[Visual Basic]

Overloads Public Sub Save( _

ByVal path As String _

)

[C#]

public void Save(

string path

);

[Delphi]

public procedure Save(

path: String

); overload;

Parameters

path

Full name of the file where the schema is saved.


SimpleRelation Class

SimpleRelation Class

Represents a relation between two simple tables.

For a list of all members of this type, see SimpleRelation Members.

System.Object

C1.Data.SchemaObjects.Relation

C1.Data.SchemaObjects.SimpleRelation

[Visual Basic]

Public Class SimpleRelation

Inherits Relation

[C#]

public class SimpleRelation : Relation

[Delphi]

type SimpleRelation = class (Relation);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


SimpleRelation Members

SimpleRelation Members

SimpleRelation overview

Public Constructors

SimpleRelation Constructor

Initializes a new instance of the SimpleRelation class.

Public Properties

Cardinality (inherited from Relation) | Gets or sets one of the two RelationCardinalityEnum values.
Child (inherited from Relation) | Gets or sets the child table of the relation.
DeleteCascadeRule | Gets or sets a value specifying the action applied to child rows when their parent key is deleted.
Description (inherited from Relation) | Gets or sets a description for the relation.
EnforceConstraints | Gets or sets a value indicating whether the rule prohibiting child rows without parent is enforced.
Joins | Gets the joins collection of the relation.
Name (inherited from Relation) | Gets or sets the relation name.
Parent (inherited from Relation) | Gets or sets the parent table of the relation.
Schema (inherited from Relation) | Gets the schema the relation belongs to.
UpdateCascadeRule | Gets or sets a value specifying the action applied to child rows when their parent key is modified.
UpdateCascadeServer | Gets or sets a value indicating whether the database performs cascade update of child key values when their parent key value is modified.


SimpleRelation Constructor

SimpleRelation Constructor

Overload List

Initializes a new instance of the SimpleRelation class.

[Visual Basic] Public Function New()

[C#] public SimpleRelation();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the SimpleRelation class.

[Visual Basic] Public Function New(Schema)

[C#] public SimpleRelation(Schema);

[Delphi] public constructor Create(Schema); overload;

Initializes a new instance of the SimpleRelation class.

[Visual Basic] Public Function New(Table, Table)

[C#] public SimpleRelation(Table, Table);

[Delphi] public constructor Create(Table; Table); overload;


SimpleRelation Constructor ()

SimpleRelation Constructor ()

Initializes a new instance of the SimpleRelation class.

[Visual Basic]

Public Function New()

[C#]

public SimpleRelation()

[Delphi]

public constructor Create(); overload;


SimpleRelation Constructor (Schema)

SimpleRelation Constructor (Schema)

Initializes a new instance of the SimpleRelation class.

[Visual Basic]

Public Function New( _

ByVal schema As Schema _

)

[C#]

public SimpleRelation(

Schema schema

);

[Delphi]

public constructor Create(

schema: Schema

); overload;

Parameters

schema

Schema the relation belongs to.


SimpleRelation Constructor (Table, Table)

SimpleRelation Constructor (Table, Table)

Initializes a new instance of the SimpleRelation class.

[Visual Basic]

Public Function New( _

ByVal parentTable As Table, _

ByVal childTable As Table _

)

[C#]

public SimpleRelation(

Table parentTable,

Table childTable

);

[Delphi]

public constructor Create(

parentTable: Table;

childTable: Table

); overload;

Parameters

parentTable

Parent table of the relation.

childTable

Child table of the relation.


SimpleRelation Properties

SimpleRelation Properties

The properties of the SimpleRelation class are listed here. For a complete list of SimpleRelation class members, see the SimpleRelation Members topic.

Public Properties

Cardinality (inherited from Relation) | Gets or sets one of the two RelationCardinalityEnum values.
Child (inherited from Relation) | Gets or sets the child table of the relation.
DeleteCascadeRule | Gets or sets a value specifying the action applied to child rows when their parent key is deleted.
Description (inherited from Relation) | Gets or sets a description for the relation.
EnforceConstraints | Gets or sets a value indicating whether the rule prohibiting child rows without parent is enforced.
Joins | Gets the joins collection of the relation.
Name (inherited from Relation) | Gets or sets the relation name.
Parent (inherited from Relation) | Gets or sets the parent table of the relation.
Schema (inherited from Relation) | Gets the schema the relation belongs to.
UpdateCascadeRule | Gets or sets a value specifying the action applied to child rows when their parent key is modified.
UpdateCascadeServer | Gets or sets a value indicating whether the database performs cascade update of child key values when their parent key value is modified.


SimpleRelation.DeleteCascadeRule Property

SimpleRelation.DeleteCascadeRule Property

Gets or sets a value specifying the action applied to child rows when their parent key is deleted.

[Visual Basic]

Public Property DeleteCascadeRule As ReferentialIntegrityRuleEnum

[C#]

public ReferentialIntegrityRuleEnum DeleteCascadeRule {get;set;}

[Delphi]

public property DeleteCascadeRule: ReferentialIntegrityRuleEnum read get_DeleteCascadeRule write set_DeleteCascadeRule;

Remarks

The default is None.


SimpleRelation.EnforceConstraints Property

SimpleRelation.EnforceConstraints Property

Gets or sets a value indicating whether the rule prohibiting child rows without parent is enforced.

[Visual Basic]

Public Property EnforceConstraints As Boolean

[C#]

public bool EnforceConstraints {get;set;}

[Delphi]

public property EnforceConstraints: Boolean read get_EnforceConstraints write set_EnforceConstraints;

Remarks

The default is True.


SimpleRelation.Joins Property

SimpleRelation.Joins Property

Gets the joins collection of the relation.

[Visual Basic]

Public ReadOnly Property Joins As JoinConditionCollection

[C#]

public JoinConditionCollection Joins {get;}

[Delphi]

public property Joins: JoinConditionCollection read get_Joins;


SimpleRelation.UpdateCascadeRule Property

SimpleRelation.UpdateCascadeRule Property

Gets or sets a value specifying the action applied to child rows when their parent key is modified.

[Visual Basic]

Public Property UpdateCascadeRule As ReferentialIntegrityRuleEnum

[C#]

public ReferentialIntegrityRuleEnum UpdateCascadeRule {get;set;}

[Delphi]

public property UpdateCascadeRule: ReferentialIntegrityRuleEnum read get_UpdateCascadeRule write set_UpdateCascadeRule;

Remarks

The default is Cascade.


SimpleRelation.UpdateCascadeServer Property

SimpleRelation.UpdateCascadeServer Property

Gets or sets a value indicating whether the database performs cascade update of child key values when their parent key value is modified.

[Visual Basic]

Public Property UpdateCascadeServer As Boolean

[C#]

public bool UpdateCascadeServer {get;set;}

[Delphi]

public property UpdateCascadeServer: Boolean read get_UpdateCascadeServer write set_UpdateCascadeServer;

Remarks

The default is True.

Performing database update in a cascade key update situation, C1DataObjects must know whether the database is performing cascade update as well.


SimpleTable Class

SimpleTable Class

Base class for simple tables.

For a list of all members of this type, see SimpleTable Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.Table

C1.Data.SchemaObjects.SimpleTable

C1.Data.SchemaObjects.DbTable

[Visual Basic]

MustInherit Public Class SimpleTable

Inherits Table

[C#]

public abstract class SimpleTable : Table

[Delphi]

type SimpleTable = class abstract (Table);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


SimpleTable Members

SimpleTable Members

SimpleTable overview

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly (inherited from BaseTable) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields (inherited from Table) | Gets the collection of table fields.
IgnoreDeleteError (inherited from Table) | Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.
Name (inherited from Table) | Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema (inherited from Table) | Gets the schema to which the table belongs.
UpdateLocateMode (inherited from Table) | Gets or sets a value specifying which field values participate in locating the database record for update.
UpdateRefreshMode (inherited from Table) | Gets or sets a value specifying how refresh after updating the database is done.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


SimpleTable Properties

SimpleTable Properties

The properties of the SimpleTable class are listed here. For a complete list of SimpleTable class members, see the SimpleTable Members topic.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly (inherited from BaseTable) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields (inherited from Table) | Gets the collection of table fields.
IgnoreDeleteError (inherited from Table) | Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.
Name (inherited from Table) | Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema (inherited from Table) | Gets the schema to which the table belongs.
UpdateLocateMode (inherited from Table) | Gets or sets a value specifying which field values participate in locating the database record for update.
UpdateRefreshMode (inherited from Table) | Gets or sets a value specifying how refresh after updating the database is done.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


SqlDialectInfo Class

SqlDialectInfo Class

This class contains represents various specifics of SQL syntax relevant to C1DataObjects that can vary between different databases.

For a list of all members of this type, see SqlDialectInfo Members.

System.Object

C1.Data.SchemaObjects.SqlDialectInfo

[Visual Basic]

Public Class SqlDialectInfo

[C#]

public class SqlDialectInfo

[Delphi]

type SqlDialectInfo = class;

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


SqlDialectInfo Members

SqlDialectInfo Members

SqlDialectInfo overview

Public Properties

AddAsToTableAlias | Gets or sets a value indicating whether to add “AS” between table name and table alias.
AlwaysEscapeNames | Gets or sets a value indicating whether every table and column name must be quoted to avoid collision with reserved keywords.
Connection | Gets the Connection object to which this object belongs.
DefaultInInsertValues | Gets or sets a value indicating whether DEFAULT keyword is supported in the VALUES() list in INSERT statement.
IdentityColumnLastValueSelect | Gets or sets a string representing the SELECT command returning the last assigned identity (autoincrement) value in the current database connection.
IdentityColumnRetrieveMode | Gets or sets a value indicating how autoincrement key value is retrieved for inserted row: before, after or in the same scope with the INSERT command.
NameQuote | Gets or sets one of the SqlQuoteEnum values specifying the quotation rule for names.
Syntax | Gets or sets one of the SqlSyntaxEnum values specifying the SQL dialect syntax.


SqlDialectInfo Properties

SqlDialectInfo Properties

The properties of the SqlDialectInfo class are listed here. For a complete list of SqlDialectInfo class members, see the SqlDialectInfo Members topic.

Public Properties

AddAsToTableAlias | Gets or sets a value indicating whether to add “AS” between table name and table alias.
AlwaysEscapeNames | Gets or sets a value indicating whether every table and column name must be quoted to avoid collision with reserved keywords.
Connection | Gets the Connection object to which this object belongs.
DefaultInInsertValues | Gets or sets a value indicating whether DEFAULT keyword is supported in the VALUES() list in INSERT statement.
IdentityColumnLastValueSelect | Gets or sets a string representing the SELECT command returning the last assigned identity (autoincrement) value in the current database connection.
IdentityColumnRetrieveMode | Gets or sets a value indicating how autoincrement key value is retrieved for inserted row: before, after or in the same scope with the INSERT command.
NameQuote | Gets or sets one of the SqlQuoteEnum values specifying the quotation rule for names.
Syntax | Gets or sets one of the SqlSyntaxEnum values specifying the SQL dialect syntax.


SqlDialectInfo.AddAsToTableAlias Property

SqlDialectInfo.AddAsToTableAlias Property

Gets or sets a value indicating whether to add “AS” between table name and table alias.

[Visual Basic]

Public Property AddAsToTableAlias As Boolean

[C#]

public bool AddAsToTableAlias {get;set;}

[Delphi]

public property AddAsToTableAlias: Boolean read get_AddAsToTableAlias write set_AddAsToTableAlias;


SqlDialectInfo.AlwaysEscapeNames Property

SqlDialectInfo.AlwaysEscapeNames Property

Gets or sets a value indicating whether every table and column name must be quoted to avoid collision with reserved keywords.

[Visual Basic]

Public Property AlwaysEscapeNames As Boolean

[C#]

public bool AlwaysEscapeNames {get;set;}

[Delphi]

public property AlwaysEscapeNames: Boolean read get_AlwaysEscapeNames write set_AlwaysEscapeNames;

Remarks

If this property is set to True, table and field names are always escaped in generated SQL statements. This is useful to ensure that the names do not conflict with database-reserved words. The quotation mark is determined by the NameQuote property value (for example, [field] in MS Access, "field" in SQL Server and Oracle). Default: False.


SqlDialectInfo.Connection Property

SqlDialectInfo.Connection Property

Gets the Connection object to which this object belongs.

[Visual Basic]

Public ReadOnly Property Connection As Connection

[C#]

public Connection Connection {get;}

[Delphi]

public property Connection: Connection read get_Connection;


SqlDialectInfo.DefaultInInsertValues Property

SqlDialectInfo.DefaultInInsertValues Property

Gets or sets a value indicating whether DEFAULT keyword is supported in the VALUES() list in INSERT statement.

[Visual Basic]

Public Property DefaultInInsertValues As Boolean

[C#]

public bool DefaultInInsertValues {get;set;}

[Delphi]

public property DefaultInInsertValues: Boolean read get_DefaultInInsertValues write set_DefaultInInsertValues;

Remarks

This property is used generating an INSERT statement, only if no field values are specified, so all fields in the new row must have default values determined by the database. If this property is True, “VALUES (DEFAULT)” is used in the statement. If it is False, “DEFAULT VALUES” is used.


SqlDialectInfo.IdentityColumnLastValueSelect Property

SqlDialectInfo.IdentityColumnLastValueSelect Property

Gets or sets a string representing the SELECT command returning the last assigned identity (autoincrement) value in the current database connection.

[Visual Basic]

Public Property IdentityColumnLastValueSelect As String

[C#]

public string IdentityColumnLastValueSelect {get;set;}

[Delphi]

public property IdentityColumnLastValueSelect: String read get_IdentityColumnLastValueSelect write set_IdentityColumnLastValueSelect;


SqlDialectInfo.IdentityColumnRetrieveMode Property

SqlDialectInfo.IdentityColumnRetrieveMode Property

Gets or sets a value indicating how autoincrement key value is retrieved for inserted row: before, after or in the same scope with the INSERT command.

[Visual Basic]

Public Property IdentityColumnRetrieveMode As IdentityColumnRetrieveModeEnum

[C#]

public IdentityColumnRetrieveModeEnum IdentityColumnRetrieveMode {get;set;}

[Delphi]

public property IdentityColumnRetrieveMode: IdentityColumnRetrieveModeEnum read get_IdentityColumnRetrieveMode write set_IdentityColumnRetrieveMode;


SqlDialectInfo.NameQuote Property

SqlDialectInfo.NameQuote Property

Gets or sets one of the SqlQuoteEnum values specifying the quotation rule for names.

[Visual Basic]

Public Property NameQuote As SqlQuoteEnum

[C#]

public SqlQuoteEnum NameQuote {get;set;}

[Delphi]

public property NameQuote: SqlQuoteEnum read get_NameQuote write set_NameQuote;

Remarks

Name that are not well-formed identifiers (not start with a letter or containing characters other than letters and digits) need to be quoted in SQL statements. This property determines the quotation mark used in these cases.


SqlDialectInfo.Syntax Property

SqlDialectInfo.Syntax Property

Gets or sets one of the SqlSyntaxEnum values specifying the SQL dialect syntax.

[Visual Basic]

Public Property Syntax As SqlSyntaxEnum

[C#]

public SqlSyntaxEnum Syntax {get;set;}

[Delphi]

public property Syntax: SqlSyntaxEnum read get_Syntax write set_Syntax;


SqlQuoteEnum Enumeration

SqlQuoteEnum Enumeration

Specifies quotation rules for names in SQL statements.

[Visual Basic]

Public Enum SqlQuoteEnum

[C#]

public enum SqlQuoteEnum

[Delphi]

type SqlQuoteEnum = (Brackets, DoubleQuote, None, SingleQuote);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Brackets | Square brackets: Example: [a name]
DoubleQuote | Double quote. Example: “a name”
None | No quotation. Example: a name
SingleQuote | Single quote. Example: ‘a name’

See Also

C1.Data.SchemaObjects Namespace


SqlSyntaxEnum Enumeration

SqlSyntaxEnum Enumeration

Specifies general SQL syntax used by a database.

[Visual Basic]

Public Enum SqlSyntaxEnum

[C#]

public enum SqlSyntaxEnum

[Delphi]

type SqlSyntaxEnum = (Oracle, SQL1, SQL2);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Remarks

Current C1DataObjects version uses the following features of SQL2 standard, if Syntax = SQL2: Joins in FROM clause.

Members

Member name | Description
Oracle | Oracle SQL syntax.
SQL1 | SQL engines supporting only SQL1 standard.
SQL2 | Compliant with SQL2 standard. Such are, for example, Microsoft SQL Server and Microsoft Access.

See Also

C1.Data.SchemaObjects Namespace


Table Class

Table Class

Base class for simple and composite tables.

For a list of all members of this type, see Table Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.Table

C1.Data.SchemaObjects.CompositeTable

C1.Data.SchemaObjects.SimpleTable

[Visual Basic]

MustInherit Public Class Table

Inherits BaseTable

[C#]

public abstract class Table : BaseTable

[Delphi]

type Table = class abstract (BaseTable);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


Table Members

Table Members

Table overview

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly (inherited from BaseTable) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields | Gets the collection of table fields.
IgnoreDeleteError | Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.
Name | Overriden. Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema | Gets the schema to which the table belongs.
UpdateLocateMode | Gets or sets a value specifying which field values participate in locating the database record for update.
UpdateRefreshMode | Gets or sets a value specifying how refresh after updating the database is done.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


Table Properties

Table Properties

The properties of the Table class are listed here. For a complete list of Table class members, see the Table Members topic.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
Description (inherited from BaseTable) | Gets or sets a description for the table.
EffectiveAllowAddNew (inherited from BaseTable) | Gets the effective value of the AllowAddNew property at run time.
EffectiveAllowDelete (inherited from BaseTable) | Gets the effective value of the AllowDelete property at run time.
EffectiveReadOnly (inherited from BaseTable) | Gets the effective value of the ReadOnly property at run time.
EffectiveUserReadOnly (inherited from BaseTable) | Gets the effective value of the UserReadOnly property at run time.
Fields | Gets the collection of table fields.
IgnoreDeleteError | Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.
Name | Overriden. Gets or sets the name of the table.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
RowType (inherited from BaseTable) | Gets or sets a class representing rows of this table or view.
Schema | Gets the schema to which the table belongs.
UpdateLocateMode | Gets or sets a value specifying which field values participate in locating the database record for update.
UpdateRefreshMode | Gets or sets a value specifying how refresh after updating the database is done.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.


Table.Fields Property

Table.Fields Property

Gets the collection of table fields.

[Visual Basic]

Public ReadOnly Property Fields As TableFieldCollection

[C#]

public TableFieldCollection Fields {get;}

[Delphi]

public property Fields: TableFieldCollection read get_Fields;


Table.IgnoreDeleteError Property

Table.IgnoreDeleteError Property

Gets or sets a value indicating whether the absence of a record to delete in the database is interpreted as an error.

[Visual Basic]

Overridable Public Property IgnoreDeleteError As Boolean

[C#]

virtual public bool IgnoreDeleteError {get;set;}

[Delphi]

public property IgnoreDeleteError: Boolean read get_IgnoreDeleteError write set_IgnoreDeleteError;


Table.Name Property

Table.Name Property

Gets or sets the name of the table.

[Visual Basic]

Overrides Public Property Name As String

[C#]

override public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


Table.Schema Property

Table.Schema Property

Gets the schema to which the table belongs.

[Visual Basic]

Public ReadOnly Property Schema As Schema

[C#]

public Schema Schema {get;}

[Delphi]

public property Schema: Schema read get_Schema;


Table.UpdateLocateMode Property

Table.UpdateLocateMode Property

Gets or sets a value specifying which field values participate in locating the database record for update.

[Visual Basic]

Overridable Public Property UpdateLocateMode As TableUpdateLocateModeEnum

[C#]

virtual public TableUpdateLocateModeEnum UpdateLocateMode {get;set;}

[Delphi]

public property UpdateLocateMode: TableUpdateLocateModeEnum read get_UpdateLocateMode write set_UpdateLocateMode;


Table.UpdateRefreshMode Property

Table.UpdateRefreshMode Property

Gets or sets a value specifying how refresh after updating the database is done.

[Visual Basic]

Overridable Public Property UpdateRefreshMode As TableUpdateRefreshModeEnum

[C#]

virtual public TableUpdateRefreshModeEnum UpdateRefreshMode {get;set;}

[Delphi]

public property UpdateRefreshMode: TableUpdateRefreshModeEnum read get_UpdateRefreshMode write set_UpdateRefreshMode;


TableCollection Class

TableCollection Class

Represents a collection of Table objects.

For a list of all members of this type, see TableCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.TableCollection

[Visual Basic]

Public Class TableCollection

Inherits CollectionBase

[C#]

public class TableCollection : CollectionBase

[Delphi]

type TableCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableCollection Members

TableCollection Members

TableCollection overview

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object.


TableCollection Properties

TableCollection Properties

The properties of the TableCollection class are listed here. For a complete list of TableCollection class members, see the TableCollection Members topic.

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.


TableCollection.Item Property

TableCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As Table

[C#] public Table this[int]{get;}

[Delphi] public property Item[index: Int32]: Table read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Table

[C#] public Table this[string]{get;}

[Delphi] public property Item[name: String]: Table read get_Item;


TableCollection.Item Property (Int32)

TableCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Table

[C#]

public Table this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Table read get_Item;

Parameters

index

The index of the object.


TableCollection.Item Property (String)

TableCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As Table

[C#]

public Table this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: Table read get_Item;

Parameters

name

The Name of the object.


TableCollection Methods

TableCollection Methods

The methods of the TableCollection class are listed here. For a complete list of TableCollection class members, see the TableCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object.


TableCollection.Add Method

TableCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As Table _

)

[C#]

public void Add(

Table obj

);

[Delphi]

public procedure Add(

obj: Table

);

Parameters

obj

The object to be added to the end of the collection.


TableCollection.Contains Method

TableCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element.

Return Value


TableCollection.CopyTo Method

TableCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As Table(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

Table[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of Table;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


TableCollection.IndexOf Method

TableCollection.IndexOf Method

Overload List

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(Table) As Integer

[C#] public int IndexOf(Table);

[Delphi] public function IndexOf(Table) : Int32; overload;


TableCollection.IndexOf Method (String)

TableCollection.IndexOf Method (String)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element.

Return Value

Returns the index of the object.


TableCollection.IndexOf Method (Table)

TableCollection.IndexOf Method (Table)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal table As Table _

) As Integer

[C#]

public int IndexOf(

Table table

);

[Delphi]

public function IndexOf(

table: Table

): Int32; overload;

Parameters

table

The element of the collection.

Return Value

Gets the index of an object.


TableCollection.Insert Method

TableCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As Table _

)

[C#]

public void Insert(

int index,

Table obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: Table

);

Parameters

index

The zero-based index at which obj should be inserted.

obj

The object to insert.


TableCollection.Remove Method

TableCollection.Remove Method

Removes the first occurrence of a specific object.

[Visual Basic]

Public Sub Remove( _

ByVal obj As Table _

)

[C#]

public void Remove(

Table obj

);

[Delphi]

public procedure Remove(

obj: Table

);

Parameters

obj

The Object to remove from the collection.


TableField Class

TableField Class

The base class for DbTableField and CompositeTableField.

For a list of all members of this type, see TableField Members.

System.Object

C1.Data.SchemaObjects.Field

C1.Data.SchemaObjects.TableField

C1.Data.SchemaObjects.CompositeTableField

C1.Data.SchemaObjects.DbTableField

[Visual Basic]

MustInherit Public Class TableField

Inherits Field

[C#]

public abstract class TableField : Field

[Delphi]

type TableField = class abstract (Field);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableField Members

TableField Members

TableField overview

Public Properties

AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly (inherited from Field) | Gets the effective value of the ReadOnly property at run time.
EffectiveReadOnlyUnlessNew (inherited from Field) | Gets the effective value of the ReadOnlyUnlessNew property at run time.
EffectiveUserReadOnly (inherited from Field) | Gets the effective value of the UserReadOnly property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
Table | Gets the table to which the field belongs.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


TableField Properties

TableField Properties

The properties of the TableField class are listed here. For a complete list of TableField class members, see the TableField Members topic.

Public Properties

AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
EffectiveReadOnly (inherited from Field) | Gets the effective value of the ReadOnly property at run time.
EffectiveReadOnlyUnlessNew (inherited from Field) | Gets the effective value of the ReadOnlyUnlessNew property at run time.
EffectiveUserReadOnly (inherited from Field) | Gets the effective value of the UserReadOnly property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
Table | Gets the table to which the field belongs.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


TableField.Table Property

TableField.Table Property

Gets the table to which the field belongs.

[Visual Basic]

Public ReadOnly Property Table As Table

[C#]

public Table Table {get;}

[Delphi]

public property Table: Table read get_Table;


TableFieldCollection Class

TableFieldCollection Class

Represents a collection of TableField objects.

For a list of all members of this type, see TableFieldCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.TableFieldCollection

[Visual Basic]

Public Class TableFieldCollection

Inherits CollectionBase

[C#]

public class TableFieldCollection : CollectionBase

[Delphi]

type TableFieldCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableFieldCollection Members

TableFieldCollection Members

TableFieldCollection overview

Public Properties

Item | Overloaded. Gets the element of the collection at the specified index.
Table | Gets the table to which the field collection belongs.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


TableFieldCollection Properties

TableFieldCollection Properties

The properties of the TableFieldCollection class are listed here. For a complete list of TableFieldCollection class members, see the TableFieldCollection Members topic.

Public Properties

Item | Overloaded. Gets the element of the collection at the specified index.
Table | Gets the table to which the field collection belongs.


TableFieldCollection.Item Property

TableFieldCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As TableField

[C#] public TableField this[int]{get;}

[Delphi] public property Item[index: Int32]: TableField read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As TableField

[C#] public TableField this[string]{get;}

[Delphi] public property Item[name: String]: TableField read get_Item;


TableFieldCollection.Item Property (Int32)

TableFieldCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As TableField

[C#]

public TableField this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: TableField read get_Item;


TableFieldCollection.Item Property (String)

TableFieldCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As TableField

[C#]

public TableField this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: TableField read get_Item;

Parameters

name

The Name of the element. The search is not case-sensitive.


TableFieldCollection.Table Property

TableFieldCollection.Table Property

Gets the table to which the field collection belongs.

[Visual Basic]

Public ReadOnly Property Table As Table

[C#]

public Table Table {get;}

[Delphi]

public property Table: Table read get_Table;


TableFieldCollection Methods

TableFieldCollection Methods

The methods of the TableFieldCollection class are listed here. For a complete list of TableFieldCollection class members, see the TableFieldCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


TableFieldCollection.Add Method

TableFieldCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As TableField _

)

[C#]

public void Add(

TableField obj

);

[Delphi]

public procedure Add(

obj: TableField

);

Parameters

obj

The object to be added to the end of the collection.


TableFieldCollection.Contains Method

TableFieldCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


TableFieldCollection.CopyTo Method

TableFieldCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As TableField(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

TableField[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of TableField;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


TableFieldCollection.IndexOf Method

TableFieldCollection.IndexOf Method

Overload List

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(TableField) As Integer

[C#] public int IndexOf(TableField);

[Delphi] public function IndexOf(TableField) : Int32; overload;


TableFieldCollection.IndexOf Method (String)

TableFieldCollection.IndexOf Method (String)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


TableFieldCollection.IndexOf Method (TableField)

TableFieldCollection.IndexOf Method (TableField)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal field As TableField _

) As Integer

[C#]

public int IndexOf(

TableField field

);

[Delphi]

public function IndexOf(

field: TableField

): Int32; overload;

Parameters

field

The Object to locate in the collection.

Return Value


TableFieldCollection.Insert Method

TableFieldCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal field As TableField _

)

[C#]

public void Insert(

int index,

TableField field

);

[Delphi]

public procedure Insert(

index: Int32;

field: TableField

);

Parameters

index

The zero-based index at which object should be inserted.

field

The object to insert.


TableFieldCollection.Remove Method

TableFieldCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal obj As TableField _

)

[C#]

public void Remove(

TableField obj

);

[Delphi]

public procedure Remove(

obj: TableField

);

Parameters

obj

The object to remove from the collection.


TableUpdateLocateModeEnum Enumeration

TableUpdateLocateModeEnum Enumeration

Specifies which field values participate in locating the database record for update.

[Visual Basic]

Public Enum TableUpdateLocateModeEnum

[C#]

public enum TableUpdateLocateModeEnum

[Delphi]

type TableUpdateLocateModeEnum = (AllFields, PrimaryKey, PrimaryKeyAndChangedFields);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
AllFields | All field values in the database record must match the original row values.
PrimaryKey | Primary key field values in the database record must match the original row values.
PrimaryKeyAndChangedFields | Primary key field values and those field values that have changed from their original values must match the original row values.

See Also

C1.Data.SchemaObjects Namespace


TableUpdateRefreshModeEnum Enumeration

TableUpdateRefreshModeEnum Enumeration

Specifies how refresh after update is done.

[Visual Basic]

Public Enum TableUpdateRefreshModeEnum

[C#]

public enum TableUpdateRefreshModeEnum

[Delphi]

type TableUpdateRefreshModeEnum = (Always, IfPossible, Never);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Always | Always retrieve the resulting database record after adding or modifying record in the database.
IfPossible | Try to retrieve the resulting database record after adding or modifying record in the database, but ignore errors if they occur.
Never | Do not retrieve the resulting database record after adding or modifying record in the database.

See Also

C1.Data.SchemaObjects Namespace


TableView Class

TableView Class

Objects of the TableView class represent nodes in a data set definition diagram.

For a list of all members of this type, see TableView Members.

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.TableView

C1.Data.SchemaObjects.CompositeDefView

[Visual Basic]

Public Class TableView

Inherits BaseTable

[C#]

public class TableView : BaseTable

[Delphi]

type TableView = class (BaseTable);

Remarks

Objects of the derived CompositeDefView class represent nodes in a composite table definition diagrams. For both kinds of table views, every table view object is based on a table object.

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableView Members

TableView Members

TableView overview

Public Constructors

TableView Constructor

Initializes a new instance of the TableView class.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
AutoEndAddNew | Gets or sets a value indicating whether EndEdit must be called automatically for newly added rows once their primary key is defined.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
DataAccessMode | Gets or sets a value specifying how data is fetched from the database to the table view.
Description (inherited from BaseTable) | Gets or sets a description for the table.
Diagram | Gets the diagram this table view belongs to.
ExposedInBinding | Gets or sets a value indicating whether table view is used for data binding (shown in the DataMember property of bound controls).
FetchIndex | Gets or sets fetch order of the table view.
Fields | Gets the field collection of the table view.
FillIgnore | Gets or sets a value indicating whether this table view is skipped when the data set is filled with data.
FillSort | Gets or sets the sort field or fields, and sort order for filling the table view with data.
MemoryResident | This property is used in ComponentOne WebData for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.
Name | Overriden. Gets or sets the name of the table view.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
Table | Gets the table this table view is based on.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.
VirtualAsyncThreshold | Gets or sets a percent value from 0 to 100 determining (in virtual mode) the distance to the end of a segment that is considered a “preemptive fetch zone”.
VirtualConsolidateRows | Gets or sets a value indicating (in VirtualAutomatic mode) whether the table view rebuilds its rowset after all rows are fetched.
VirtualSegmentCount | Gets or sets the maximum number of segments in the cache in virtual mode.
VirtualSegmentSize | Gets or sets the size (number of rows) of a segment of rows fetched from the database in virtual mode.
VirtualSyncThreshold | Gets or sets a percent value from 0 to 100 determining (in virtual mode) the distance to the end of a segment that is considered a “mandatory fetch zone”.

Public Methods

RetrieveFields

Retrieves table view fields from table specified in the Table property.


TableView Constructor

TableView Constructor

Overload List

Initializes a new instance of the TableView class.

[Visual Basic] Public Function New()

[C#] public TableView();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the TableView class.

[Visual Basic] Public Function New(Diagram, Table)

[C#] public TableView(Diagram, Table);

[Delphi] public constructor Create(Diagram; Table); overload;

Initializes a new instance of the TableView class.

[Visual Basic] Public Function New(Diagram, Table, C1DataRow)

[C#] public TableView(Diagram, Table, C1DataRow);

[Delphi] public constructor Create(Diagram; Table; C1DataRow); overload;


TableView Constructor ()

TableView Constructor ()

Initializes a new instance of the TableView class.

[Visual Basic]

Public Function New()

[C#]

public TableView()

[Delphi]

public constructor Create(); overload;


TableView Constructor (Diagram, Table)

TableView Constructor (Diagram, Table)

Initializes a new instance of the TableView class.

[Visual Basic]

Public Function New( _

ByVal diagram As Diagram, _

ByVal table As Table _

)

[C#]

public TableView(

Diagram diagram,

Table table

);

[Delphi]

public constructor Create(

diagram: Diagram;

table: Table

); overload;

Parameters

diagram

Diagram the table view belongs to.

table

Table the table view is based on.


TableView Constructor (Diagram, Table, C1DataRow)

TableView Constructor (Diagram, Table, C1DataRow)

Initializes a new instance of the TableView class.

[Visual Basic]

Public Function New( _

ByVal diagram As Diagram, _

ByVal table As Table, _

ByVal userObjPrototype As C1DataRow _

)

[C#]

public TableView(

Diagram diagram,

Table table,

C1DataRow userObjPrototype

);

[Delphi]

public constructor Create(

diagram: Diagram;

table: Table;

userObjPrototype: C1DataRow

); overload;

Parameters

diagram

Diagram the table view belongs to.

table

Table the table view is based on.

userObjPrototype

Custom row's prototype.


TableView Properties

TableView Properties

The properties of the TableView class are listed here. For a complete list of TableView class members, see the TableView Members topic.

Public Properties

AllowAddNew (inherited from BaseTable) | Gets or sets a value indicating whether adding new rows to the table is allowed.
AllowDelete (inherited from BaseTable) | Gets or sets a value indicating whether deleting rows from the table is allowed.
AutoEndAddNew | Gets or sets a value indicating whether EndEdit must be called automatically for newly added rows once their primary key is defined.
ConstraintsFieldLevel (inherited from BaseTable) | Gets the collection of field level constraints.
ConstraintsRecordLevel (inherited from BaseTable) | Gets the collection of record level constraints.
DataAccessMode | Gets or sets a value specifying how data is fetched from the database to the table view.
Description (inherited from BaseTable) | Gets or sets a description for the table.
Diagram | Gets the diagram this table view belongs to.
ExposedInBinding | Gets or sets a value indicating whether table view is used for data binding (shown in the DataMember property of bound controls).
FetchIndex | Gets or sets fetch order of the table view.
Fields | Gets the field collection of the table view.
FillIgnore | Gets or sets a value indicating whether this table view is skipped when the data set is filled with data.
FillSort | Gets or sets the sort field or fields, and sort order for filling the table view with data.
MemoryResident | This property is used in ComponentOne WebData for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.
Name | Overriden. Gets or sets the name of the table view.
ReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data is allowed.
Table | Gets the table this table view is based on.
UserReadOnly (inherited from BaseTable) | Gets or sets a value indicating whether modifying table data in bould controls is allowed.
VirtualAsyncThreshold | Gets or sets a percent value from 0 to 100 determining (in virtual mode) the distance to the end of a segment that is considered a “preemptive fetch zone”.
VirtualConsolidateRows | Gets or sets a value indicating (in VirtualAutomatic mode) whether the table view rebuilds its rowset after all rows are fetched.
VirtualSegmentCount | Gets or sets the maximum number of segments in the cache in virtual mode.
VirtualSegmentSize | Gets or sets the size (number of rows) of a segment of rows fetched from the database in virtual mode.
VirtualSyncThreshold | Gets or sets a percent value from 0 to 100 determining (in virtual mode) the distance to the end of a segment that is considered a “mandatory fetch zone”.


TableView.AutoEndAddNew Property

TableView.AutoEndAddNew Property

Gets or sets a value indicating whether EndEdit must be called automatically for newly added rows once their primary key is defined.

[Visual Basic]

Overridable Public Property AutoEndAddNew As Boolean

[C#]

virtual public bool AutoEndAddNew {get;set;}

[Delphi]

public property AutoEndAddNew: Boolean read get_AutoEndAddNew write set_AutoEndAddNew;


TableView.DataAccessMode Property

TableView.DataAccessMode Property

Gets or sets a value specifying how data is fetched from the database to the table view.

[Visual Basic]

Overridable Public Property DataAccessMode As DataAccessModeEnum

[C#]

virtual public DataAccessModeEnum DataAccessMode {get;set;}

[Delphi]

public property DataAccessMode: DataAccessModeEnum read get_DataAccessMode write set_DataAccessMode;

Remarks

The default value is Static. The other three possible values specify a virtual fetch mode, where data is fetched in chunks (segments) allowing to work with large datasets.


TableView.Diagram Property

TableView.Diagram Property

Gets the diagram this table view belongs to.

[Visual Basic]

Public ReadOnly Property Diagram As Diagram

[C#]

public Diagram Diagram {get;}

[Delphi]

public property Diagram: Diagram read get_Diagram;


TableView.ExposedInBinding Property

TableView.ExposedInBinding Property

Gets or sets a value indicating whether table view is used for data binding (shown in the DataMember property of bound controls).

[Visual Basic]

Overridable Public Property ExposedInBinding As Boolean

[C#]

virtual public bool ExposedInBinding {get;set;}

[Delphi]

public property ExposedInBinding: Boolean read get_ExposedInBinding write set_ExposedInBinding;

Remarks

The default value of this property is True.

If this property is set to False, the table view will be available only programmatically (through the C1DataSet.TableViews[] collection), but data binding will not see it. A data bound control, such as a grid, has only table views with ExposedInBinding=True available for selection in its DataMember property for data binding.

Use this property to hide table views that you only need programmatically and do not need to appear in bound controls for the end user.

This property shows/hides individual TableView objects in data binding. If you need to show/hide a whole path of TableView objects, use the ExposedInBinding property.


TableView.FetchIndex Property

TableView.FetchIndex Property

Gets or sets fetch order of the table view.

[Visual Basic]

Public Property FetchIndex As Integer

[C#]

public int FetchIndex {get;set;}

[Delphi]

public property FetchIndex: Int32 read get_FetchIndex write set_FetchIndex;

Remarks

This property allows you to change the order in which table views in the dataset are fetched. Controlling fetch order can be necessary, for example, if you have both bound and unbound or SQL-based tables in one dataset.

You can set TableView.FetchIndex at design time in the Schema Designer or programmatically at run time, in the C1.Data.C1SchemaDef.CreateSchema event.

Possible values: from 0 up to the number of table views in the dataset.


TableView.Fields Property

TableView.Fields Property

Gets the field collection of the table view.

[Visual Basic]

Public ReadOnly Property Fields As TableViewFieldCollection

[C#]

public TableViewFieldCollection Fields {get;}

[Delphi]

public property Fields: TableViewFieldCollection read get_Fields;


TableView.FillIgnore Property

TableView.FillIgnore Property

Gets or sets a value indicating whether this table view is skipped when the data set is filled with data.

[Visual Basic]

Overridable Public Property FillIgnore As Boolean

[C#]

virtual public bool FillIgnore {get;set;}

[Delphi]

public property FillIgnore: Boolean read get_FillIgnore write set_FillIgnore;

Remarks

The default value is False. If this property is set to True, this table view data is not fetched from the database when the data set is filled with data.


TableView.FillSort Property

TableView.FillSort Property

Gets or sets the sort field or fields, and sort order for filling the table view with data.

[Visual Basic]

Overridable Public Property FillSort As String

[C#]

virtual public string FillSort {get;set;}

[Delphi]

public property FillSort: String read get_FillSort write set_FillSort;

Remarks

This property controls the order in which data rows are sorted after fetch. By default, fetched data is sorted by primary key. If a different sort is required, set this property to the sort field name(s). To specify sort order (ascending/descending), add “ASC” (ascending) or “DESC” (descending) after the field name. If no order is specified, the order is “ASC” (ascending). Multiple field names are separated with commas.

Example: “CustomerID DESC, OrderID”.


TableView.MemoryResident Property

TableView.MemoryResident Property

This property is used in ComponentOne WebData for data caching in web applications. It is ignored if the schema is used in WinForms application or in WebForms application without WebDataObjects.

[Visual Basic]

Public Property MemoryResident As Boolean

[C#]

public bool MemoryResident {get;set;}

[Delphi]

public property MemoryResident: Boolean read get_MemoryResident write set_MemoryResident;


TableView.Name Property

TableView.Name Property

Gets or sets the name of the table view.

[Visual Basic]

Overrides Public Property Name As String

[C#]

override public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


TableView.Table Property

TableView.Table Property

Gets the table this table view is based on.

[Visual Basic]

Public Property Table As Table

[C#]

public Table Table {get;set;}

[Delphi]

public property Table: Table read get_Table write set_Table;


TableView.VirtualAsyncThreshold Property

TableView.VirtualAsyncThreshold Property

Gets or sets a percent value from 0 to 100 determining (in virtual mode) the distance to the end of a segment that is considered a “preemptive fetch zone”.

[Visual Basic]

Overridable Public Property VirtualAsyncThreshold As Integer

[C#]

virtual public int VirtualAsyncThreshold {get;set;}

[Delphi]

public property VirtualAsyncThreshold: Int32 read get_VirtualAsyncThreshold write set_VirtualAsyncThreshold;

Remarks

This property has effect only in virtual mode (when DataAccessMode is not Static). It is a performance tuning property. Do not change the default value unless you thoroughly understand the mechanics of virtual mode. The default value is 30%.

This property determines the distance (number of rows) to the end of a segment that is considered a “preemptive fetch zone”, in the sense that a new segment must be fetched from the database (if not found in the cache) when the user positions on a row inside that zone. By default, it is 30% of 400 = 120 rows.


TableView.VirtualConsolidateRows Property

TableView.VirtualConsolidateRows Property

Gets or sets a value indicating (in VirtualAutomatic mode) whether the table view rebuilds its rowset after all rows are fetched.

[Visual Basic]

Overridable Public Property VirtualConsolidateRows As Boolean

[C#]

virtual public bool VirtualConsolidateRows {get;set;}

[Delphi]

public property VirtualConsolidateRows: Boolean read get_VirtualConsolidateRows write set_VirtualConsolidateRows;

Remarks

This property has effect only in virtual automatic mode (when DataAccessMode = VirtualAutomatic).


TableView.VirtualSegmentCount Property

TableView.VirtualSegmentCount Property

Gets or sets the maximum number of segments in the cache in virtual mode.

[Visual Basic]

Overridable Public Property VirtualSegmentCount As Integer

[C#]

virtual public int VirtualSegmentCount {get;set;}

[Delphi]

public property VirtualSegmentCount: Int32 read get_VirtualSegmentCount write set_VirtualSegmentCount;

Remarks

This property has effect only when DataAccessMode is set to Virtual. It is a performance tuning property. Do not change the default value unless you thoroughly understand the mechanics of virtual mode. The default value is 4.


TableView.VirtualSegmentSize Property

TableView.VirtualSegmentSize Property

Gets or sets the size (number of rows) of a segment of rows fetched from the database in virtual mode.

[Visual Basic]

Overridable Public Property VirtualSegmentSize As Integer

[C#]

virtual public int VirtualSegmentSize {get;set;}

[Delphi]

public property VirtualSegmentSize: Int32 read get_VirtualSegmentSize write set_VirtualSegmentSize;

Remarks

This property has effect only in virtual mode (when DataAccessMode is not Static). It is a performance tuning property. Do not change the default value unless you thoroughly understand the mechanics of virtual mode. The default value is 400.


TableView.VirtualSyncThreshold Property

TableView.VirtualSyncThreshold Property

Gets or sets a percent value from 0 to 100 determining (in virtual mode) the distance to the end of a segment that is considered a “mandatory fetch zone”.

[Visual Basic]

Overridable Public Property VirtualSyncThreshold As Integer

[C#]

virtual public int VirtualSyncThreshold {get;set;}

[Delphi]

public property VirtualSyncThreshold: Int32 read get_VirtualSyncThreshold write set_VirtualSyncThreshold;

Remarks

This property has effect only in virtual mode (when DataAccessMode is not Static). It is a performance tuning property. Do not change the default value unless you thoroughly understand the mechanics of virtual mode. The default value is 12%.

This property determines the distance (number of rows) to the end of a segment that is considered a “danger zone”, or a “mandatory fetch zone”, in the sense that the current segment must be changed to another segment (taken from the cache or fetched from the database) when the user positions on a row inside that zone. By default, it is 12% of 400 = 48 rows.


TableView Methods

TableView Methods

The methods of the TableView class are listed here. For a complete list of TableView class members, see the TableView Members topic.

Public Methods

RetrieveFields

Retrieves table view fields from table specified in the Table property.


TableView.RetrieveFields Method

TableView.RetrieveFields Method

Retrieves table view fields from table specified in the Table property.

[Visual Basic]

Public Sub RetrieveFields()

[C#]

public void RetrieveFields()

[Delphi]

public procedure RetrieveFields();


TableViewCollection Class

TableViewCollection Class

Represents a collection of TableView objects.

For a list of all members of this type, see TableViewCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.TableViewCollection

[Visual Basic]

Public Class TableViewCollection

Inherits CollectionBase

[C#]

public class TableViewCollection : CollectionBase

[Delphi]

type TableViewCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableViewCollection Members

TableViewCollection Members

TableViewCollection overview

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


TableViewCollection Properties

TableViewCollection Properties

The properties of the TableViewCollection class are listed here. For a complete list of TableViewCollection class members, see the TableViewCollection Members topic.

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.


TableViewCollection.Item Property

TableViewCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As TableView

[C#] public TableView this[int]{get;}

[Delphi] public property Item[index: Int32]: TableView read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As TableView

[C#] public TableView this[string]{get;}

[Delphi] public property Item[name: String]: TableView read get_Item;


TableViewCollection.Item Property (Int32)

TableViewCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As TableView

[C#]

public TableView this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: TableView read get_Item;

Parameters

index

The zero-based index of the element.


TableViewCollection.Item Property (String)

TableViewCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As TableView

[C#]

public TableView this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: TableView read get_Item;

Parameters

name

The Name of the element. The search is not case-sensitive.


TableViewCollection Methods

TableViewCollection Methods

The methods of the TableViewCollection class are listed here. For a complete list of TableViewCollection class members, see the TableViewCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Gets the index of an object in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


TableViewCollection.Add Method

TableViewCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As TableView _

)

[C#]

public void Add(

TableView obj

);

[Delphi]

public procedure Add(

obj: TableView

);

Parameters

obj

The object to be added to the end of the collection.


TableViewCollection.Contains Method

TableViewCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


TableViewCollection.CopyTo Method

TableViewCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As TableView(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

TableView[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of TableView;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


TableViewCollection.IndexOf Method

TableViewCollection.IndexOf Method

Overload List

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;

Gets the index of an object in the collection.

[Visual Basic] Overloads Public Function IndexOf(TableView) As Integer

[C#] public int IndexOf(TableView);

[Delphi] public function IndexOf(TableView) : Int32; overload;


TableViewCollection.IndexOf Method (String)

TableViewCollection.IndexOf Method (String)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


TableViewCollection.IndexOf Method (TableView)

TableViewCollection.IndexOf Method (TableView)

Gets the index of an object in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal tableView As TableView _

) As Integer

[C#]

public int IndexOf(

TableView tableView

);

[Delphi]

public function IndexOf(

tableView: TableView

): Int32; overload;

Parameters

tableView

The element of the collection.

Return Value


TableViewCollection.Insert Method

TableViewCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As TableView _

)

[C#]

public void Insert(

int index,

TableView obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: TableView

);

Parameters

index

The zero-based index at which object should be inserted.

obj

The object to insert.


TableViewCollection.Remove Method

TableViewCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal obj As TableView _

)

[C#]

public void Remove(

TableView obj

);

[Delphi]

public procedure Remove(

obj: TableView

);

Parameters

obj

The object to remove from the collection.


TableViewField Class

TableViewField Class

Represents a table view field.

For a list of all members of this type, see TableViewField Members.

System.Object

C1.Data.SchemaObjects.Field

C1.Data.SchemaObjects.TableViewField

[Visual Basic]

Public Class TableViewField

Inherits Field

[C#]

public class TableViewField : Field

[Delphi]

type TableViewField = class (Field);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableViewField Members

TableViewField Members

TableViewField overview

Public Constructors

TableViewField Constructor

Initializes a new instance of the TableViewField class.

Public Properties

AllowDbNull (inherited from Field) | Gets or sets a value indicating whether null or empty string values are allowed in this field.
AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
TableField | Gets or sets the table field on which this field is based.
TableView | Gets the table view to which the field belongs.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


TableViewField Constructor

TableViewField Constructor

Overload List

Initializes a new instance of the TableViewField class.

[Visual Basic] Public Function New()

[C#] public TableViewField();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the TableViewField class.

[Visual Basic] Public Function New(TableView)

[C#] public TableViewField(TableView);

[Delphi] public constructor Create(TableView); overload;


TableViewField Constructor ()

TableViewField Constructor ()

Initializes a new instance of the TableViewField class.

[Visual Basic]

Public Function New()

[C#]

public TableViewField()

[Delphi]

public constructor Create(); overload;


TableViewField Constructor (TableView)

TableViewField Constructor (TableView)

Initializes a new instance of the TableViewField class.

[Visual Basic]

Public Function New( _

ByVal tableView As TableView _

)

[C#]

public TableViewField(

TableView tableView

);

[Delphi]

public constructor Create(

tableView: TableView

); overload;

Parameters

tableView

Table view the field belongs to.


TableViewField Properties

TableViewField Properties

The properties of the TableViewField class are listed here. For a complete list of TableViewField class members, see the TableViewField Members topic.

Public Properties

AllowDbNull (inherited from Field) | Gets or sets a value indicating whether null or empty string values are allowed in this field.
AutoIncrement (inherited from Field) | Gets or sets a value indicating whether the field automatically receives an incremented value for a new row added to the table.
AutoIncrementSeed (inherited from Field) | Gets or sets the starting value for a field with AutoIncrement value other than None.
AutoIncrementSequenceName (inherited from Field) | Gets or sets the name of a sequence or generator database object used for autoincrement on the server.
AutoIncrementStep (inherited from Field) | Gets or sets the increment for a field with AutoIncrement value other than None.
CalculationCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
CalculationExpression (inherited from Field) | Gets or sets the expression producing the result of a calculation.
CalculationFireEvent (inherited from Field) | Gets or sets a value indicating whether calculation triggers the same events as field modification by the user.
Calculations (inherited from Field) | Gets the collection of field calculations, FieldCalculationInfo objects.
ConstraintCondition (inherited from Field) | Gets or sets an optional boolean expression defining applicability of a calculation.
ConstraintErrorDescription (inherited from Field) | Gets or sets the string used as the error description in the exception thrown when a constraint is not satisfied.
ConstraintExpression (inherited from Field) | Gets or sets the boolean expression used to test a constraint.
Constraints (inherited from Field) | Gets the collection of field constraints, ConstraintInfo objects.
ConvertEmptyToNull (inherited from Field) | Gets or sets a value indicating whether empty strings are stored as DbNull values.
ConvertNullToEmpty (inherited from Field) | Gets or sets a value indicating whether DbNull values of a string field are returned as empty strings.
DefaultValue (inherited from Field) | Gets or sets the default value for the field when creating new rows.
Description (inherited from Field) | Gets or sets a description for the field.
EffectiveAllowDbNull (inherited from Field) | Gets the effective value of the AllowDbNull property at run time.
MaxLength (inherited from Field) | Gets or sets the maximum length of a string field, in characters.
Name (inherited from Field) | Gets or sets the name of the field.
NativeDbType (inherited from Field) | Gets or sets the field data type as a native data type of the underlying database.
Precision (inherited from Field) | Gets or sets the maximum number of digits used to represent the field value.
ReadOnly (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed.
ReadOnlyUnlessNew (inherited from Field) | Gets or sets a value indicating whether modifications to field values are allowed only in newly added rows.
Scale (inherited from Field) | Gets or sets the number of decimal places to in the field value.
TableField | Gets or sets the table field on which this field is based.
TableView | Gets the table view to which the field belongs.
Type (inherited from Field) | Gets or sets the type of field data.
Unique (inherited from Field) | Gets or sets a value indicating whether the values of this field in each row must be unique.
UserReadOnly (inherited from Field) | Gets or sets a value indicating whether the user can change this field value using bound controls.


TableViewField.TableField Property

TableViewField.TableField Property

Gets or sets the table field on which this field is based.

[Visual Basic]

Public Property TableField As TableField

[C#]

public TableField TableField {get;set;}

[Delphi]

public property TableField: TableField read get_TableField write set_TableField;

Remarks

This property value can be null, in which case the field is not based on any of the table fields, represents a calculated field belonging to the table view.


TableViewField.TableView Property

TableViewField.TableView Property

Gets the table view to which the field belongs.

[Visual Basic]

Public ReadOnly Property TableView As TableView

[C#]

public TableView TableView {get;}

[Delphi]

public property TableView: TableView read get_TableView;


TableViewFieldCollection Class

TableViewFieldCollection Class

Represents a collection of TableViewField objects.

For a list of all members of this type, see TableViewFieldCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.TableViewFieldCollection

[Visual Basic]

Public Class TableViewFieldCollection

Inherits CollectionBase

[C#]

public class TableViewFieldCollection : CollectionBase

[Delphi]

type TableViewFieldCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


TableViewFieldCollection Members

TableViewFieldCollection Members

TableViewFieldCollection overview

Public Properties

Item | Overloaded. Gets the element of the collection at the specified index.
TableView | Gets the table view to which the collection belongs.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


TableViewFieldCollection Properties

TableViewFieldCollection Properties

The properties of the TableViewFieldCollection class are listed here. For a complete list of TableViewFieldCollection class members, see the TableViewFieldCollection Members topic.

Public Properties

Item | Overloaded. Gets the element of the collection at the specified index.
TableView | Gets the table view to which the collection belongs.


TableViewFieldCollection.Item Property

TableViewFieldCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As TableViewField

[C#] public TableViewField this[int]{get;}

[Delphi] public property Item[index: Int32]: TableViewField read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As TableViewField

[C#] public TableViewField this[string]{get;}

[Delphi] public property Item[name: String]: TableViewField read get_Item;


TableViewFieldCollection.Item Property (Int32)

TableViewFieldCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As TableViewField

[C#]

public TableViewField this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: TableViewField read get_Item;

Parameters

index

The zero-based index of the element.


TableViewFieldCollection.Item Property (String)

TableViewFieldCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As TableViewField

[C#]

public TableViewField this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: TableViewField read get_Item;

Parameters

name

The Name of the element. The search is not case-sensitive.


TableViewFieldCollection.TableView Property

TableViewFieldCollection.TableView Property

Gets the table view to which the collection belongs.

[Visual Basic]

Public ReadOnly Property TableView As TableView

[C#]

public TableView TableView {get;}

[Delphi]

public property TableView: TableView read get_TableView;


TableViewFieldCollection Methods

TableViewFieldCollection Methods

The methods of the TableViewFieldCollection class are listed here. For a complete list of TableViewFieldCollection class members, see the TableViewFieldCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


TableViewFieldCollection.Add Method

TableViewFieldCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As TableViewField _

)

[C#]

public void Add(

TableViewField obj

);

[Delphi]

public procedure Add(

obj: TableViewField

);

Parameters

obj

The object to be added to the end of the collection.


TableViewFieldCollection.Contains Method

TableViewFieldCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


TableViewFieldCollection.CopyTo Method

TableViewFieldCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As TableViewField(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

TableViewField[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of TableViewField;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


TableViewFieldCollection.IndexOf Method

TableViewFieldCollection.IndexOf Method

Overload List

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(TableViewField) As Integer

[C#] public int IndexOf(TableViewField);

[Delphi] public function IndexOf(TableViewField) : Int32; overload;


TableViewFieldCollection.IndexOf Method (String)

TableViewFieldCollection.IndexOf Method (String)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


TableViewFieldCollection.IndexOf Method (TableViewField)

TableViewFieldCollection.IndexOf Method (TableViewField)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal tableViewField As TableViewField _

) As Integer

[C#]

public int IndexOf(

TableViewField tableViewField

);

[Delphi]

public function IndexOf(

tableViewField: TableViewField

): Int32; overload;

Parameters

tableViewField

The Object to locate in the collection.

Return Value


TableViewFieldCollection.Insert Method

TableViewFieldCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As TableViewField _

)

[C#]

public void Insert(

int index,

TableViewField obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: TableViewField

);

Parameters

index

The zero-based index at which object should be inserted.

obj

The object to insert.


TableViewFieldCollection.Remove Method

TableViewFieldCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal obj As TableViewField _

)

[C#]

public void Remove(

TableViewField obj

);

[Delphi]

public procedure Remove(

obj: TableViewField

);

Parameters

obj

The object to remove from the collection.


ViewRelation Class

ViewRelation Class

Represents a view relation, an arc in a Diagram.

For a list of all members of this type, see ViewRelation Members.

System.Object

C1.Data.SchemaObjects.ViewRelation

C1.Data.SchemaObjects.CompositeDefRelation

[Visual Basic]

Public Class ViewRelation

[C#]

public class ViewRelation

[Delphi]

type ViewRelation = class;

Remarks

A view relation between two table views is always based on a Relation between two tables.

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


ViewRelation Members

ViewRelation Members

ViewRelation overview

Public Constructors

ViewRelation Constructor

Initializes a new instance of the ViewRelation class.

Public Properties

Cardinality | Gets view relation cardinality, which is determined by the relation cardinality with possible inversion.
Child | Gets or sets the child table view.
Description | Gets or sets a description for the view relation.
Diagram | Gets the diagram this view relation belongs to.
ExposedInBinding | Gets or sets a value indicating whether relation is used for data binding (shown in the DataMember property of bound controls).
GetRowsEvent | Gets or sets a value indicating whether relation is specified in code in C1.Data.C1DataSetLogic.GetChildRows and C1.Data.C1DataSetLogic.GetParentRow events (and not based on a Relation between tables).
Name | Gets or sets the name of the view relation.
OneWay | For a relation specified in code in GetChildRows event, indicates whether GetParentRow is not available.
Parent | Gets or sets the parent table view.
Relation | Gets or sets the relation between tables this view relation is based on.


ViewRelation Constructor

ViewRelation Constructor

Overload List

Initializes a new instance of the ViewRelation class.

[Visual Basic] Public Function New()

[C#] public ViewRelation();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the ViewRelation class.

[Visual Basic] Public Function New(Diagram, Relation)

[C#] public ViewRelation(Diagram, Relation);

[Delphi] public constructor Create(Diagram; Relation); overload;


ViewRelation Constructor ()

ViewRelation Constructor ()

Initializes a new instance of the ViewRelation class.

[Visual Basic]

Public Function New()

[C#]

public ViewRelation()

[Delphi]

public constructor Create(); overload;


ViewRelation Constructor (Diagram, Relation)

ViewRelation Constructor (Diagram, Relation)

Initializes a new instance of the ViewRelation class.

[Visual Basic]

Public Function New( _

ByVal diagram As Diagram, _

ByVal relation As Relation _

)

[C#]

public ViewRelation(

Diagram diagram,

Relation relation

);

[Delphi]

public constructor Create(

diagram: Diagram;

relation: Relation

); overload;

Parameters

diagram

Diagram to which this view relation belongs.

relation

Relation between tables on which this view relation is based.


ViewRelation Properties

ViewRelation Properties

The properties of the ViewRelation class are listed here. For a complete list of ViewRelation class members, see the ViewRelation Members topic.

Public Properties

Cardinality | Gets view relation cardinality, which is determined by the relation cardinality with possible inversion.
Child | Gets or sets the child table view.
Description | Gets or sets a description for the view relation.
Diagram | Gets the diagram this view relation belongs to.
ExposedInBinding | Gets or sets a value indicating whether relation is used for data binding (shown in the DataMember property of bound controls).
GetRowsEvent | Gets or sets a value indicating whether relation is specified in code in C1.Data.C1DataSetLogic.GetChildRows and C1.Data.C1DataSetLogic.GetParentRow events (and not based on a Relation between tables).
Name | Gets or sets the name of the view relation.
OneWay | For a relation specified in code in GetChildRows event, indicates whether GetParentRow is not available.
Parent | Gets or sets the parent table view.
Relation | Gets or sets the relation between tables this view relation is based on.


ViewRelation.Cardinality Property

ViewRelation.Cardinality Property

Gets view relation cardinality, which is determined by the relation cardinality with possible inversion.

[Visual Basic]

Public ReadOnly Property Cardinality As RelationCardinalityEnum

[C#]

public RelationCardinalityEnum Cardinality {get;}

[Delphi]

public property Cardinality: RelationCardinalityEnum read get_Cardinality;

Remarks

A view relation, as an arc in the data set diagram, can have direction opposite to the direction of the table relation on which it is based. For example, having a one-to-many relation Customers – Orders, we can create a many-to-one view relation Orders – Customers, based on Customers – Orders, but in inverse order (direction). So, if the Relation object Customers – Orders has Parent = Customers, Child = Orders, the view relation, if inverted, will have Parent = Orders, Child = Customers.


ViewRelation.Child Property

ViewRelation.Child Property

Gets or sets the child table view.

[Visual Basic]

Public Property Child As TableView

[C#]

public TableView Child {get;set;}

[Delphi]

public property Child: TableView read get_Child write set_Child;

Remarks

If the view relation is inverted with respect to the table relation on which it is based, the view relation’s Child is based on the table relation’s Relation, and the view relation’s Parent is based on the table relation’s Relation.


ViewRelation.Description Property

ViewRelation.Description Property

Gets or sets a description for the view relation.

[Visual Basic]

Public Property Description As String

[C#]

public string Description {get;set;}

[Delphi]

public property Description: String read get_Description write set_Description;

Remarks

This value is displayed in the Schema Designer's Information window when you select the relation.


ViewRelation.Diagram Property

ViewRelation.Diagram Property

Gets the diagram this view relation belongs to.

[Visual Basic]

Public ReadOnly Property Diagram As Diagram

[C#]

public Diagram Diagram {get;}

[Delphi]

public property Diagram: Diagram read get_Diagram;


ViewRelation.ExposedInBinding Property

ViewRelation.ExposedInBinding Property

Gets or sets a value indicating whether relation is used for data binding (shown in the DataMember property of bound controls).

[Visual Basic]

Overridable Public Property ExposedInBinding As Boolean

[C#]

virtual public bool ExposedInBinding {get;set;}

[Delphi]

public property ExposedInBinding: Boolean read get_ExposedInBinding write set_ExposedInBinding;

Remarks

Default: True.

If this property is set to False, the relation will be available only programmatically (through the GetChildRows (String) method and typed business logic methods), but data binding will not see it. A data bound control, such as a grid, has only relations with ExposedInBinding=True available for selection in its DataMember property for data binding.

Use this property to hide relations that you only need programmatically, do not need to appear in bound controls for the end user.

In C1DataExpress, the value of the ExposedInBinding property is determined by the Master-detail check box in the Relations editor. If the check box is unchecked, ExposedInBinding=False.


ViewRelation.GetRowsEvent Property

ViewRelation.GetRowsEvent Property

Gets or sets a value indicating whether relation is specified in code in C1.Data.C1DataSetLogic.GetChildRows and C1.Data.C1DataSetLogic.GetParentRow events (and not based on a Relation between tables).

[Visual Basic]

Overridable Public Property GetRowsEvent As Boolean

[C#]

virtual public bool GetRowsEvent {get;set;}

[Delphi]

public property GetRowsEvent: Boolean read get_GetRowsEvent write set_GetRowsEvent;

Remarks

If this property is set to True, the view relation is not based on a table relation (its Relation property is ignored), it is defined by custom code returning the list of child rows for a parent row in C1.Data.C1DataSetLogic.GetChildRows event (in C1DataExpress, C1ExpressConnection.GetChildRows).

Only view relations (only relations between table views, not relations between tables) can be custom (have this property set to True). Furthermore, custom relations are allowed only in data set diagrams, not in composite table diagrams. You can define custom relations between table views based on composite tables, but cannot use custom relation inside a composite table diagram.

Related topic: OneWay


ViewRelation.Name Property

ViewRelation.Name Property

Gets or sets the name of the view relation.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;


ViewRelation.OneWay Property

ViewRelation.OneWay Property

For a relation specified in code in GetChildRows event, indicates whether GetParentRow is not available.

[Visual Basic]

Overridable Public Property OneWay As Boolean

[C#]

virtual public bool OneWay {get;set;}

[Delphi]

public property OneWay: Boolean read get_OneWay write set_OneWay;

Remarks

This property has effect only for custom relations, those defined in code, with GetRowsEvent=True. If this property is set to True, code in C1.Data.C1DataSetLogic.GetParentRow event can be omitted, calling C1.Data.C1DataSetLogic.GetParentRow for this relation will throw exception. Set this property to True if it is difficult or simply unnecessary to reverse your algorithm enumerating child rows. Note that only C1.Data.C1DataSetLogic.GetChildRows is used for master-detail data binding, C1.Data.C1DataSetLogic.GetParentRow is not necessary.

In C1DataExpress, OneWay is always True for custom relations.


ViewRelation.Parent Property

ViewRelation.Parent Property

Gets or sets the parent table view.

[Visual Basic]

Public Property Parent As TableView

[C#]

public TableView Parent {get;set;}

[Delphi]

public property Parent: TableView read get_Parent write set_Parent;

Remarks

If the view relation is inverted with respect to the table relation on which it is based, the view relation’s Child is based on the table relation’s Relation, and the view relation’s Parent is based on the table relation’s Relation.


ViewRelation.Relation Property

ViewRelation.Relation Property

Gets or sets the relation between tables this view relation is based on.

[Visual Basic]

Public Property Relation As Relation

[C#]

public Relation Relation {get;set;}

[Delphi]

public property Relation: Relation read get_Relation write set_Relation;


ViewRelationCollection Class

ViewRelationCollection Class

Represents a collection of ViewRelation objects.

For a list of all members of this type, see ViewRelationCollection Members.

System.Object

System.Collections.CollectionBase

C1.Data.SchemaObjects.ViewRelationCollection

[Visual Basic]

Public Class ViewRelationCollection

Inherits CollectionBase

[C#]

public class ViewRelationCollection : CollectionBase

[Delphi]

type ViewRelationCollection = class (CollectionBase);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)


ViewRelationCollection Members

ViewRelationCollection Members

ViewRelationCollection overview

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


ViewRelationCollection Properties

ViewRelationCollection Properties

The properties of the ViewRelationCollection class are listed here. For a complete list of ViewRelationCollection class members, see the ViewRelationCollection Members topic.

Public Properties

Item

Overloaded. Gets the element of the collection at the specified index.


ViewRelationCollection.Item Property

ViewRelationCollection.Item Property

Overload List

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As ViewRelation

[C#] public ViewRelation this[int]{get;}

[Delphi] public property Item[index: Int32]: ViewRelation read get_Item;

Gets the element of the collection at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As ViewRelation

[C#] public ViewRelation this[string]{get;}

[Delphi] public property Item[name: String]: ViewRelation read get_Item;


ViewRelationCollection.Item Property (Int32)

ViewRelationCollection.Item Property (Int32)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As ViewRelation

[C#]

public ViewRelation this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: ViewRelation read get_Item;

Parameters

index

The zero-based index of the element.


ViewRelationCollection.Item Property (String)

ViewRelationCollection.Item Property (String)

Gets the element of the collection at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As ViewRelation

[C#]

public ViewRelation this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: ViewRelation read get_Item;

Parameters

name

The Name of the element. The search is not case-sensitive.


ViewRelationCollection Methods

ViewRelationCollection Methods

The methods of the ViewRelationCollection class are listed here. For a complete list of ViewRelationCollection class members, see the ViewRelationCollection Members topic.

Public Methods

Add | Adds a new element to the collection.
Contains | Determines whether an element is in the collection.
CopyTo | Copies the collection or a portion of it to a one-dimensional array.
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the collection.
Insert | Inserts an element into the collection at the specified index.
Remove | Removes the first occurrence of a specific object from the collection.


ViewRelationCollection.Add Method

ViewRelationCollection.Add Method

Adds a new element to the collection.

[Visual Basic]

Public Sub Add( _

ByVal obj As ViewRelation _

)

[C#]

public void Add(

ViewRelation obj

);

[Delphi]

public procedure Add(

obj: ViewRelation

);

Parameters

obj

The object to be added to the end of the collection.


ViewRelationCollection.Contains Method

ViewRelationCollection.Contains Method

Determines whether an element is in the collection.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


ViewRelationCollection.CopyTo Method

ViewRelationCollection.CopyTo Method

Copies the collection or a portion of it to a one-dimensional array.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As ViewRelation(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

ViewRelation[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of ViewRelation;

index: Int32

);

Parameters

array

The one-dimensional Array that is the destination of the elements copied from collection. The Array must have zero-based indexing.

index

The zero-based index in array at which copying begins.


ViewRelationCollection.IndexOf Method

ViewRelationCollection.IndexOf Method

Overload List

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic] Overloads Public Function IndexOf(ViewRelation) As Integer

[C#] public int IndexOf(ViewRelation);

[Delphi] public function IndexOf(ViewRelation) : Int32; overload;


ViewRelationCollection.IndexOf Method (String)

ViewRelationCollection.IndexOf Method (String)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

The Name of the element. The search is not case-sensitive.

Return Value


ViewRelationCollection.IndexOf Method (ViewRelation)

ViewRelationCollection.IndexOf Method (ViewRelation)

Returns the zero-based index of the first occurrence of a value in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal viewRelation As ViewRelation _

) As Integer

[C#]

public int IndexOf(

ViewRelation viewRelation

);

[Delphi]

public function IndexOf(

viewRelation: ViewRelation

): Int32; overload;

Parameters

viewRelation

The Object to locate in the collection.

Return Value


ViewRelationCollection.Insert Method

ViewRelationCollection.Insert Method

Inserts an element into the collection at the specified index.

[Visual Basic]

Public Sub Insert( _

ByVal index As Integer, _

ByVal obj As ViewRelation _

)

[C#]

public void Insert(

int index,

ViewRelation obj

);

[Delphi]

public procedure Insert(

index: Int32;

obj: ViewRelation

);

Parameters

index

The zero-based index at which object should be inserted.

obj

The object to insert.


ViewRelationCollection.Remove Method

ViewRelationCollection.Remove Method

Removes the first occurrence of a specific object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal obj As ViewRelation _

)

[C#]

public void Remove(

ViewRelation obj

);

[Delphi]

public procedure Remove(

obj: ViewRelation

);

Parameters

obj

The object to remove from the collection.


YesNoDefaultEnum Enumeration

YesNoDefaultEnum Enumeration

An enumeration used in property values instead of the boolean type where there is a default option (depending on the context) in addition to Yes (True) and No (False).

[Visual Basic]

Public Enum YesNoDefaultEnum

[C#]

public enum YesNoDefaultEnum

[Delphi]

type YesNoDefaultEnum = (Default, No, Yes);

Namespace: C1.Data.SchemaObjects

Assembly: C1.Data (in c1.data.dll)

Members

Member name | Description
Default | This can be Yes or No depending on other properties of the object. Where Default is used, the value of the property is determined by some rules documented with the property.
No | Property value is False.
Yes | Property value is True.

See Also

C1.Data.SchemaObjects Namespace


Action Order and Execution Mode- C#

C#

private void table_Customers_AfterAddNew(object sender, C1.Data.RowChangeEventArgs e)

{

e.DataTable.DataSet.PushExecutionMode(ExecutionModeEnum.Deferred);

// The following field value assignment and a method call

// will actually execute only after all other actions handling the row

// addition will be finished

e.Row["CustomerID"] = textBox1.Text;

e.Row.EndEdit();

e.DataTable.DataSet.PopExecutionMode();

}


Action Order and Execution Mode- Delphi

Delphi

procedure Class1.table_Customers_AfterAddNew(sender: System.Object; e: C1.Data.RowChangeEventArgs);

begin

e.DataTable.DataSet.PushExecutionMode(ExecutionModeEnum.Deferred);

// The following field value assignment and a method call

// will actually execute only after all other actions handling the row

// addition will be finished

e.Row['CustomerID'] := textBox1.Text;

e.Row.EndEdit;

e.DataTable.DataSet.PopExecutionMode;

end;


Action Order and Execution Mode- Visual Basic

Visual Basic

Private Sub table_Customers_AfterAddNew(ByVal sender As Object, ByVal e As C1.Data.RowChangeEventArgs) Handles TableLogic1.AfterAddNew

e.DataTable.DataSet.PushExecutionMode _

(C1.Data.ExecutionModeEnum.Deferred)

'The following field value assignment and a method call

' will actually execute only after all other actions handling the row

' addition will be finished

e.Row("CustomerID") = TextBox1.Text

e.Row.EndEdit()

e.DataTable.DataSet.PopExecutionMode()

End Sub


C1.Data.Express Hierarchy

C1.Data.Express Hierarchy

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.BaseDataTableSource ---- System.ComponentModel.IBindingList, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.ITypedList

C1.Data.Express.C1ExpressTable ---- System.ComponentModel.ISupportInitialize

C1.Data.C1DataView ---- System.ComponentModel.IBindingList, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.ISupportInitialize, System.ComponentModel.ITypedList

C1.Data.Express.C1ExpressView ---- System.ComponentModel.ISupportInitialize

C1.Data.Express.C1ExpressConnection ---- System.ComponentModel.IComponent, System.ComponentModel.IListSource, System.ComponentModel.ISupportInitialize

C1.Data.SchemaObjects.Field

C1.Data.Express.C1ExpressField

System.Collections.CollectionBase

C1.Data.Express.C1ExpressFieldCollection

C1.Data.Express.C1ExpressJoinCollection

C1.Data.Express.C1ExpressRelationCollection

C1.Data.Express.C1ExpressJoin

C1.Data.Express.C1ExpressRelation

System.EventArgs

C1.Data.GenerateSqlEventArgs

C1.Data.Express.ExpressGenerateSqlEventArgs

System.Delegate

System.MulticastDelegate

C1.Data.Express.ExpressGenerateSqlEventHandler

See Also

C1.Data.Express Namespace


C1.Data Hierarchy

C1.Data Hierarchy

System.Object

System.Collections.CollectionBase

C1.Data.ConstraintCollection

C1.Data.FieldCalculationCollection

C1.Data.FilterConditions

System.ComponentModel.MarshalByValueComponent

C1.Data.BaseFormAwareMarshalByValueComponent

C1.Data.C1DataSet ---- System.ComponentModel.IListSource, System.Runtime.Serialization.ISerializable, System.ComponentModel.ISupportInitialize

C1.Data.C1DataRow ---- System.ComponentModel.ICustomTypeDescriptor, System.ComponentModel.IDataErrorInfo, System.ComponentModel.IEditableObject

System.EventArgs

C1.Data.CurrentRowChangedEventArgs

C1.Data.DataSetEventArgs

C1.Data.ErrorEventArgs

C1.Data.FetchEventArgs

C1.Data.FieldChangeEventArgs

C1.Data.FillEventArgs

C1.Data.GenerateSqlEventArgs

C1.Data.GetListEventArgs

C1.Data.PositionChangeEventArgs

C1.Data.RowChangeEventArgs

C1.Data.RowUpdateEventArgs

System.MarshalByRefObject

C1.Data.RemoteDataService

C1.Data.UnboundDataReader ---- System.Data.IDataReader, System.Data.IDataRecord, System.IDisposable

System.ComponentModel.Component

C1.Data.BaseComponent

C1.Data.BaseFormAwareComponent

C1.Data.BaseDataSourceComponent

C1.Data.BaseDataTableSource ---- System.ComponentModel.IBindingList, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.ITypedList

C1.Data.C1DataTableSource

C1.Data.C1DataView ---- System.ComponentModel.IBindingList, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.ISupportInitialize, System.ComponentModel.ITypedList

C1.Data.BaseLogic

C1.Data.C1DataSetLogic

C1.Data.C1TableLogic

C1.Data.SchemaBase

C1.Data.C1SchemaDef ---- System.ComponentModel.ISupportInitialize

C1.Data.C1SchemaRef

System.Exception

System.ApplicationException

C1.Data.C1DataException

C1.Data.DataActionCanceledException

C1.Data.DbAccessException

C1.Data.DisabledOperationException

C1.Data.ExpressionException

C1.Data.InvalidDataOperationException

C1.Data.OperationFailureException

C1.Data.SchemaException

C1.Data.ConstraintException

C1.Data.C1DataRowCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.Data.C1DataTable ---- System.ComponentModel.IListSource

C1.Data.C1DataTableCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.Data.DataItem ---- System.ComponentModel.ICustomTypeDescriptor, System.ComponentModel.IDataErrorInfo, System.ComponentModel.IEditableObject

C1.Data.CompositeTableRow

C1.Data.ConstraintInfo

C1.Data.DataField

C1.Data.DataFieldCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.Data.FieldCalculationInfo

C1.Data.FilterCondition ---- System.Runtime.Serialization.ISerializable

System.Collections.Hashtable

System.Data.PropertyCollection

C1.Data.PropertyCollection ---- System.Runtime.Serialization.ISerializable

C1.Data.SessionCacheProperties

System.ValueType

System.Enum

C1.Data.CacheModeEnum

C1.Data.CacheStorageEnum

C1.Data.CommandTypeEnum

C1.Data.DataObjectsAssemblyFlags

C1.Data.DataRowActionEnum

C1.Data.DataRowStateEnum

C1.Data.DataRowVersionEnum

C1.Data.DataSetEventStatusEnum

C1.Data.DataViewRowStateEnum

C1.Data.ExecutionModeEnum

C1.Data.ListChangedFlags

C1.Data.OperationEnum

C1.Data.RowChangedTypeEnum

C1.Data.RowEventStatusEnum

C1.Data.RunsAtEnum

C1.Data.SqlResultStatusEnum

System.Delegate

System.MulticastDelegate

C1.Data.CurrentRowChangedEventHandler

C1.Data.DataSetEventHandler

C1.Data.FetchEventHandler

C1.Data.FieldChangeEventHandler

C1.Data.FillEventHandler

C1.Data.GenerateSqlEventHandler

C1.Data.GetListEventHandler

C1.Data.PositionChangeEventHandler

C1.Data.RowChangeEventHandler

C1.Data.RowUpdateEventHandler

See Also

C1.Data Namespace


C1.Data.SchemaObjects Hierarchy

C1.Data.SchemaObjects Hierarchy

System.Object

C1.Data.SchemaObjects.BaseTable

C1.Data.SchemaObjects.Table

C1.Data.SchemaObjects.CompositeTable

C1.Data.SchemaObjects.SimpleTable

C1.Data.SchemaObjects.DbTable

C1.Data.SchemaObjects.TableView

C1.Data.SchemaObjects.CompositeDefView

System.MarshalByRefObject

C1.Data.SchemaObjects.Connection ---- System.ICloneable, System.IDisposable

C1.Data.SchemaObjects.C1BorlandDPConnection

C1.Data.SchemaObjects.C1CustomConnection

C1.Data.SchemaObjects.C1MSOracleConnection

C1.Data.SchemaObjects.C1OleDbConnection

C1.Data.SchemaObjects.C1OracleConnection

C1.Data.SchemaObjects.C1SqlServerConnection

C1.Data.SchemaObjects.CacheProperties

C1.Data.SchemaObjects.ViewRelation

C1.Data.SchemaObjects.CompositeDefRelation

C1.Data.SchemaObjects.Relation

C1.Data.SchemaObjects.CompositeRelation

C1.Data.SchemaObjects.SimpleRelation

C1.Data.SchemaObjects.Diagram

C1.Data.SchemaObjects.CompositeTableDef

C1.Data.SchemaObjects.DataSetDef

C1.Data.SchemaObjects.Field

C1.Data.SchemaObjects.TableField

C1.Data.SchemaObjects.CompositeTableField

C1.Data.SchemaObjects.DbTableField

C1.Data.SchemaObjects.TableViewField

System.Collections.CollectionBase

C1.Data.SchemaObjects.ConnectionCollection

C1.Data.SchemaObjects.DataSetDefCollection

C1.Data.SchemaObjects.JoinConditionCollection

C1.Data.SchemaObjects.RelationCollection

C1.Data.SchemaObjects.TableCollection

C1.Data.SchemaObjects.TableFieldCollection

C1.Data.SchemaObjects.TableViewCollection

C1.Data.SchemaObjects.TableViewFieldCollection

C1.Data.SchemaObjects.ViewRelationCollection

C1.Data.SchemaObjects.CustomProviderInfo

C1.Data.SchemaObjects.FieldDefaults

C1.Data.SchemaObjects.JoinCondition

C1.Data.SchemaObjects.Schema ---- System.Runtime.Serialization.ISerializable

C1.Data.SchemaObjects.SqlDialectInfo

System.ValueType

System.Enum

C1.Data.SchemaObjects.AutoIncrementEnum

C1.Data.SchemaObjects.ConnectionTypeEnum

C1.Data.SchemaObjects.DataAccessModeEnum

C1.Data.SchemaObjects.DataModeEnum

C1.Data.SchemaObjects.FieldUpdateSetModeEnum

C1.Data.SchemaObjects.IdentityColumnRetrieveModeEnum

C1.Data.SchemaObjects.ReferentialIntegrityRuleEnum

C1.Data.SchemaObjects.RelationCardinalityEnum

C1.Data.SchemaObjects.SqlQuoteEnum

C1.Data.SchemaObjects.SqlSyntaxEnum

C1.Data.SchemaObjects.TableUpdateLocateModeEnum

C1.Data.SchemaObjects.TableUpdateRefreshModeEnum

C1.Data.SchemaObjects.YesNoDefaultEnum

See Also

C1.Data.SchemaObjects Namespace


C1ExpressView- C#

C#

C1ExpressView.RowFilter = “City = ‘London’”;


C1ExpressView- Delphi

Delphi

C1ExpressView.RowFilter := ‘City = ‘‘London’’’;


C1ExpressView- Visual Basic

Visual Basic

C1ExpressView.RowFilter = “City = ‘London’”


Data Binding- C#

C#

parentGrid1.DataMember = “_Customers”;

parentGrid1.DataSource = dataSet1;

childGrid1.DataMember = “_Customers.Customers-Orders”;

childGrid1.DataSource = dataSet1;


Data Binding- C#2

C#

C1DataTable dt = c1DataSet1.TableViews[“Customers”]

dataGrid1.DataSource = dt


Data Binding- C#3

C#

dataGrid1.DataSource = dataView1;


Data Binding- Delphi

Delphi

parentGrid1.DataMember := ‘_Customers’;

parentGrid1.DataSource := dataSet1;

childGrid1.DataMember := ‘_Customers.Customers - Orders';

childGrid1.DataSource := dataSet1;


Data Binding- Delphi2

Delphi

var

dt: C1DataTable;

begin

dt := c1DataSet1.TableViews[Customers];

dataGrid1.DataSource := dt;

end;


Data Binding- Delphi3

Delphi

DataGrid1.DataSource := DataView1;


Data Binding- Visual Basic

Visual Basic

ParentGrid1.DataMember = “_Customers”

ParentGrid1.DataSource = dataSet1

ChildGrid1.DataMember = “_Customers.Customers-Orders”

ChildGrid1.DataSource = DataSet1


Data Binding- Visual Basic2

Visual Basic

Dim Dt As C1DataTable

Dt = C1DataSet1.TableViews(“Customers”)

DataGrid1.DataSource = Dt


Data Binding- Visual Basic3

Visual Basic

DataGrid1.DataSource = DataView1


Untitled Document

Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


How to Access Table Data- C#

C#

C1DataRow row;

ProductsRow product = ProductsRow.Obj(row)


How to Access Table Data- Delphi

Delphi

var

product: ProductsRow;

row: C1DataRow;

begin

product := ProductsRow.Obj(row);

end;


How to Access Table Data- Visual Basic

Visual Basic

Dim row As C1DataRow

Dim product As ProductsRow

product = ProductsRow.Obj(row)


Key Assigned Automatically by Database - C#

C#

private void table_Orders_AfterUpdateRow(object sender, C1.Data.RowUpdateEventArgs e)

{

C1.Data.Connection connection = schemaDef1.Schema.Connections["Connect"]);

OleDbCommand command = new System.Data.OleDb.OleDbCommand (

"SELECT TOP 1 OrderID FROM Orders ORDER BY OrderID DESC", (OleDbConnection)connection.DbConnection);

command.Transaction = (System.Data.OleDb.OleDbTransaction)

connection.DbTransaction;

System.Data.OleDb.OleDbDataReader reader = command.ExecuteReader();

reader.Read();

e.Row["OrderID"] = reader["OrderID"];

reader.Close();

}


Key Assigned Automatically by Database - Delphi

Delphi

procedure Class1.table_Orders_AfterUpdateRow(sender: System.Object; e: C1.Data.RowUpdateEventArgs);

var

connection: C1.Data.Connection;

command: OleDbCommand;

reader: OleDbDataReader;

begin

connection := schemaDef1.Schema.Connections['Connect'];

command := System.Data.OleDb.OleDbCommand.Create(‘SELECT TOP 1 OrderID FROM Orders ORDER BY OrderID DESC’, OleDbConnection(connection.DbConnection));

command.Transaction := System.Data.OleDb.OleDbTransaction(connection.DbTransaction);

reader := command.ExecuteReader;

reader.Read;

e.Row[‘OrderID’] := reader[‘OrderID’];

reader.Close;

end;


Key Assigned Automatically by Database - Visual Basic

Visual Basic

Private Sub table_Orders_AfterUpdateRow(ByVal sender As Object, ByVal e As C1.Data.RowUpdateEventArgs) Handles table_Orders.AfterUpdateRow

Dim connection As C1.Data.Connection

Dim command As System.Data.OleDb.OleDbCommand

Dim reader As System.Data.OleDb.OleDbDataReader

connection = SchemaDef1.Schema.Connections("Connect")

command = New System.Data.OleDb.OleDbCommand( _

"SELECT TOP 1 OrderID FROM Orders ORDER BY OrderID DESC", _

CType(connection.DbConnection, System.Data.OleDb.OleDbConnection))

command.Transaction = CType(connection.DbTransaction, _

System.Data.OleDb.OleDbTransaction)

reader = command.ExecuteReader()

reader.Read()

e.Row("OrderID") = reader("OrderID")

reader.Close()

End Sub


Keys Assigned by Client- C#

C#

private void table_Customers_AfterAddNew(object sender, C1.Data.RowChangeEventArgs e)

{

DataTable.DataSet.PushExecutionMode(ExecutionModeEnum.Deferred);

e.Row["CustomerID"] = textBox1.Text;

e.Row.EndEdit();

e.DataTable.DataSet.PopExecutionMode();

}


Keys Assigned by Client- Delphi

Delphi

procedure Class1.table_Customers_AfterAddNew(sender: System.Object; e: C1.Data.RowChangeEventArgs);

begin

DataTable.DataSet.PushExecutionMode(ExecutionModeEnum.Deferred);

e.Row['CustomerID'] := textBox1.Text;

e.Row.EndEdit;

e.DataTable.DataSet.PopExecutionMode;

end;


Keys Assigned by Client- Visual Basic

Visual Basic

Private Sub table_Customers_AfterAddNew(ByVal sender As Object, ByVal e As C1.Data.RowChangeEventArgs) Handles TableLogic1.AfterAddNew

e.DataTable.DataSet.PushExecutionMode _

(C1.Data.ExecutionModeEnum.Deferred)

e.Row("CustomerID") = TextBox1.Text

e.Row.EndEdit()

e.DataTable.DataSet.PopExecutionMode()

End Sub


Master-Detail Relations- C#

C#

parentGrid1.DataMember = “_Customers”;

parentGrid1.DataSource = C1ExpressConnection1;

childGrid1.DataMember = “_Customers.Customers-Orders”;

childGrid1.DataSource = C1ExpressConnection1;


Master-Detail Relations- Delphi

Delphi

parentGrid1.DataMember := ‘_Customers’;

parentGrid1.DataSource := C1ExpressConnection1;

childGrid1.DataMember := ‘_Customers.Customers - Orders’;

childGrid1.DataSource := C1ExpressConnection1;


Master-Detail Relations- Visual Basic

Visual Basic

ParentGrid1.DataMember = “_Customers”

ParentGrid1.DataSource = C1ExpressConnection1

ChildGrid1.DataMember = “_Customers.Customers-Orders”

ChildGrid1.DataSource = C1ExpressConnection1


Namespaces - C#

C#

C1.Data.C1DataSet dataset;


Namespaces - C#2

C#

using C1DataItem = C1.Data.DataItem;

using MyDataItem = MyProject.DataItem;

C1DataItem c1;

MyDataItem c2;


Namespaces - C#3

C#

using C1.Data ;


Namespaces - Delphi

Delphi

dataset: C1.Data.C1DataSet;


Namespaces - Delphi2

Delphi

uses C1.Data, MyProject;

type TMyDataItem = C1.Data.DataItem;

TDataItem = MyProject.DataItem;

var

c1: TMyDataItem;

c2: TDataItem;


Namespaces - Delphi3

Delphi

uses C1.Data;


Namespaces - Visual Basic

Visual Basic

Dim dataset As C1.Data.C1DataSet


Namespaces - Visual Basic2

Visual Basic

Imports C1DataItem = C1.Data.DataItem

Imports MyDataItem = MyProject.DataItem

Dim c1 As C1DataItem

Dim c2 As MyDataItem


Namespaces - Visual Basic3

Visual Basic

imports C1.Data


Notes for Users of C1DataObjects Enterprise Edition- C#

C#

C1ExpressConnection.DataSet.Schema;


Notes for Users of C1DataObjects Enterprise Edition- C#2

C#

C1ExpressTable.ExpressConnection.DataSet.Schema;


Notes for Users of C1DataObjects Enterprise Edition- Delphi

Delphi

C1ExpressConnection.DataSet.Schema;


Notes for Users of C1DataObjects Enterprise Edition- Delphi2

Delphi

C1ExpressTable.ExpressConnection.DataSet.Schema;


Notes for Users of C1DataObjects Enterprise Edition- Visual Basic

Visual Basic

C1ExpressConnection.DataSet.Schema


Notes for Users of C1DataObjects Enterprise Edition- Visual Basic2

Visual Basic

C1ExpressTable.ExpressConnection.DataSet.Schema


Programmatic Access- C#

C#

C1DataRow row;

ProductsRow product = ProductsRow.Obj(row)


Programmatic Access- Delphi

Delphi

var

product: ProductsRow;

row: C1DataRow;

begin

product := ProductsRow.Obj(row);

end;


Programmatic Access- Visual Basic

Visual Basic

Dim row As C1DataRow

Dim product As ProductsRow

product = ProductsRow.Obj(row)


Programmatic Key Assignment- C#

C#

private void table_Orders_BeforeUpdateRow(object sender, C1.Data.RowUpdateEventArgs e)

{

e.Row["OrderID"] = AllocateNewRowID();

}


Programmatic Key Assignment- Delphi

Delphi

procedure Class1.table_Orders_BeforeUpdateRow(sender: System.Object; e: C1.Data.RowUpdateEventArgs);

begin

e.Row['OrderID'] := AllocateNewRowID;

end;


Programmatic Key Assignment- Visual Basic

Visual Basic

Private Sub table_Orders_BeforeUpdateRow(ByVal sender As Object, ByVal e As C1.Data.RowUpdateEventArgs) Handles table_Orders.BeforeUpdateRow

e.Row["OrderID"] = AllocateNewRowID();

End Sub


Security Considerations- C#

C#

System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("myusername", "mypassword", "mydomain");

c1DataSet1.Credentials = credentials


Security Considerations- Delphi

Delphi

var

credentials: System.Net.NetworkCredential;

begin

credentials := System.Net.NetworkCredential.Create('myusername', 'mypassword', 'mydomain');

c1DataSet1.Credentials := credentials;

end;


Security Considerations- Visual Basic

Visual Basic

Dim Credentials As New System.Net.NetworkCredential("myusername", "mypassword", "mydomain")

C1DataSet1.Credentials = Credentials


TBH - Avoiding a Memory Link - C#

C#

using ( MyForm f = new MyForm() );

{

f.ShowDialog();

}

OR

MyForm f = new MyForm();

using ( f )

{

f.ShowDialog();

}

f = null;


TBH - Avoiding a Memory Link - Delphi

Delphi

- not available -


TBH - Avoiding a Memory Link - Visual Basic

Visual Basic

Dim f As MyForm = New MyForm

Try

Finally

CType(f, IDisposable).Dispose()

End Try

f.ShowDialog

OR

Dim f As MyForm = New MyForm

Imports f

Try

f.ShowDialog

Finally

End Try

f = Nothing


Untitled Document

 E-mail sent to documentation@componentone.com is for documentation feedback only. We welcome any suggestions to help improve our documentation.


Tutorial 1 - Binding to a simple table - C#

C#

label1.Text = "Row count: " + c1ExpressTable1.DataTable.Rows.Count;


Tutorial 1 - Binding to a simple table - C#2

C#

c1ExpressTable1.ExpressConnection.Update();


Tutorial 1 - Binding to a simple table - C#3

C#

c1ExpressTable1.UpdateLeavingRow = checkBox1.Checked;


Tutorial 1 - Binding to a simple table - Delphi

Delphi

label1.Text :='Row count: ' + IntToStr(C1ExpressTable1.DataTable.Rows.Count);


Tutorial 1 - Binding to a simple table - Delphi2

Delphi

C1ExpressTable1.ExpressConnection.Update;


Tutorial 1 - Binding to a simple table - Delphi3

Delphi

C1ExpressTable1.UpdateLeavingRow := checkBox1.Checked;


Tutorial 1- Binding to a simple table - Visual Basic

Visual Basic

label1.Text = "Row count: " + C1ExpressTable1.DataTable.Rows.Count


Tutorial 1 - Binding to a simple table - Visual Basic2

Visual Basic

C1ExpressTable1.ExpressConnection.Update()


Tutorial 1 - Binding to a simple table - Visual Basic3

Visual Basic

C1ExpressTable1.UpdateLeavingRow = checkBox1.Checked


Tutorial 1 - Data Schema - C#

C#

C1.Data.SchemaObjects.DataSetDef dataSetDef = e.DataSet.Schema.DataSetDefs["ProductsOrders"];

e.Filter.Add(new C1.Data.FilterCondition(dataSetDef.TableViews
["ProductsOrderDetailsCust"], "[CategoryID] = 1"));

e.Filter.Add(new C1.Data.FilterCondition(dataSetDef.TableViews
["CustOrdersDetails"], "[CategoryID] = 1"));


Tutorial 1 - Data Schema - C#2

C#

c1DataSet1.Update();


Tutorial 1 - Data Schema - C#3

C#

internal void SetDataSet (C1.Data.C1DataSet dataSet)

{

dataGrid1.DataMember = "ProductsOrderDetailsCust";

dataGrid1.DataSource = dataSet;

dataGrid2.DataMember = "CustOrdersDetails";

dataGrid2.DataSource = dataSet;

}


Tutorial 1 - Data Schema - C#4

C#

Form2 form2 = new Form2();

form2.SetDataSet(c1DataSet2);

form2.ShowDialog(this);


Tutorial 1 - Data Schema - Delphi

Delphi

var

dataSetDef: C1.Data.SchemaObjects.DataSetDef;

begin

dataSetDef := e.DataSet.Schema.DataSetDefs['ProductsOrders'];

e.Filter.Add(C1.Data.FilterCondition.Create(dataSetDef.TableViews['ProductsOrderDetailsCust'], '[CategoryID] = 1'));

e.Filter.Add(C1.Data.FilterCondition.Create(dataSetDef.TableViews['CustOrdersDetails'], '[CategoryID] = 1'));

end;


Tutorial 1 - Data Schema - Delphi2

Delphi

C1DataSet1.Update;


Tutorial 1 - Data Schema - Delphi3

Delphi

procedure Class1.SetDataSet(dataSet: C1.Data.C1DataSet);

begin

dataGrid1.DataMember := 'ProductsOrderDetailsCust';

dataGrid1.DataSource := dataSet;

dataGrid2.DataMember := 'CustOrdersDetails';

dataGrid2.DataSource := dataSet;

end;


Tutorial 1 - Data Schema - Delphi4

Delphi

var

form2: Form2;

begin

form2 := Form2.Create;

form2.SetDataSet(c1DataSet2);

form2.ShowDialog(Self);

end;


Tutorial 1 - Data Schema - Visual Basic

Visual Basic

Dim dataSetDef As C1.Data.SchemaObjects.DataSetDef

dataSetDef = e.DataSet.Schema.DataSetDefs("ProductsOrders")

e.Filter.Add(New C1.Data.FilterCondition(dataSetDef.TableViews _
("ProductsOrderDetailsCust"), "[CategoryID] = 1"))

e.Filter.Add(New C1.Data.FilterCondition(dataSetDef.TableViews _
("CustOrdersDetails"), "[CategoryID] = 1"))


Tutorial 1 - Data Schema - Visual Basic2

Visual Basic

C1DataSet1.Update()


Tutorial 1 - Data Schema - Visual Basic3

Visual Basic

Friend Sub SetDataSet(ByVal dataSet As C1.Data.C1DataSet)

DataGrid1.DataMember = "ProductsOrderDetailsCust"

DataGrid1.DataSource = dataSet

DataGrid2.DataMember = "CustOrdersDetails"

DataGrid2.DataSource = dataSet

End Sub


Tutorial 1 - Data Schema - Visual Basic4

Visual Basic

Dim form2 As Form2

form2 = New Form2()

form2.SetDataSet(C1DataSet2)

form2.ShowDialog(Me)


Tutorial 2 - Business Logic - C#

C#

if (e.Field.Name == "CustomerID")

e.NewValue = ((string)e.NewValue).ToUpper();


Tutorial 2 - Business Logic - C#2

C#

if (e.Field.Name == "Quantity")

{

if ((short)e.NewValue < 1)

e.NewValue = (short)1;

}

else if (e.Field.Name == "Discount")

{

if ((float)e.NewValue < 0 || (float)e.NewValue > 1)

throw new ApplicationException("Discount must be between 0 and 1");

}


Tutorial 2 - Business Logic - C#3

C#

if (e.Field.Name == "Quantity")

{

Order_DetailsRow orderDetail = Order_DetailsRow.Obj(e.Row);

ProductsRow product = orderDetail.GetProductsRow();

if (product != null)

{

short unitsOrdered = (short)((short)e.NewValue -
(e.OldValue == Convert.DBNull ? (short)0 :
(short)e.OldValue));

product.UnitsInStock = (short)(product.UnitsInStock - unitsOrdered);

if (product.UnitsInStock < 0)

product.UnitsInStock = 0;

product.UnitsOnOrder += unitsOrdered;

}

}


Tutorial 2 - Business Logic - C#4

C#

if (e.DataTable.SchemaTable.Name == "CustOrdersDetails")

{

CustOrdersDetailsRow_tableView order = CustOrdersDetailsRow_tableView.Obj(e.Row);

if (order.IsShipNameNull())

order.ShipName = order.CompanyName;

if (order.IsShipAddressNull())

order.ShipAddress = order.Address;

if (order.IsShipCityNull())

order.ShipCity = order.City;

if (order.IsShipRegionNull())

order.ShipRegion = order.Region;

if (order.IsShipPostalCodeNull())

order.ShipPostalCode = order.PostalCode;

if (order.IsShipCountryNull())

order.ShipCountry = order.Country;

}


Tutorial 2 - Business Logic - C#5

C#

c1DataSet1.Update();


Tutorial 2 - Business Logic - C#6

C#

C1.Data.SchemaObjects.DataSetDef dataSetDef = e.DataSet.Schema.DataSetDefs["ProductsOrders"];

e.Filter.Add(new C1.Data.FilterCondition(dataSetDef.TableViews
["ProductsOrderDetailsCust"], "[CategoryID] = 1"));

e.Filter.Add(new C1.Data.FilterCondition(dataSetDef.TableViews
["CustOrdersDetails"], "[CategoryID] = 1"));


Tutorial 2 - Business Logic - Delphi

Delphi

if (e.Field.Name = 'CustomerID') then

e.NewValue := (string(e.NewValue)).ToUpper;


Tutorial 2 - Business Logic - Delphi2

Delphi

if (e.Field.Name = 'Quantity') then

begin

if (ShortInt(e.NewValue < 1)) then

e.NewValue := ShortInt(1);

end

else

if (e.Field.Name = 'Discount') then

if ((System.Single(e.NewValue) < 0) or (System.Single(e.NewValue > 1))) then

raise ApplicationException.Create('Discount must be between 0 and 1');


Tutorial 2 - Business Logic - Delphi3

Delphi

var
val1: SmallInt;

begin

if (e.Field.Name = 'Quantity') then

begin

orderDetail := Order_DetailsRow.Obj(e.Row);

product := orderDetail.GetProductsRow;

if (product <> nil) then

begin

val1 := 0;

if (e.OldValue <> Convert.DbNull) then

val1 := SmallInt(e.OldValue);

unitsOrdered := ShortInt(e.NewValue) – val1;

product.UnitsInStock := ShortInt(product.UnitsInStock - unitsOrdered);

if (product.UnitsInStock < 0) then

product.UnitsInStock := 0;

product.UnitsOnOrder := product.UnitsOnOrder + unitsOrdered;

end;

end;

end;


Tutorial 2 - Business Logic - Delphi4

Delphi

if (e.DataTable.SchemaTable.Name = 'CustOrdersDetails') then

begin

order := CustOrdersDetailsRow_tableView.Obj(e.Row);

if order.IsShipNameNull then

order.ShipName := order.CompanyName;

if order.IsShipAddressNull then

order.ShipAddress := order.Address;

if order.IsShipCityNull then

order.ShipCity := order.City;

if order.IsShipRegionNull then

order.ShipRegion := order.Region;

if order.IsShipPostalCodeNull then

order.ShipPostalCode := order.PostalCode;

if order.IsShipCountryNull then

order.ShipCountry := order.Country;

end;


Tutorial 2 - Business Logic - Delphi5

Delphi

C1DataSet1.Update;


Tutorial 2 - Business Logic - Delphi6

Delphi

var

dataSetDef: C1.Data.SchemaObjects.DataSetDef;

begin

dataSetDef := e.DataSet.Schema.DataSetDefs['ProductsOrders'];

e.Filter.Add(C1.Data.FilterCondition.Create(dataSetDef.TableViews['ProductsOrderDetailsCust'], '[CategoryID] = 1'));

e.Filter.Add(C1.Data.FilterCondition.Create(dataSetDef.TableViews['CustOrdersDetails'], '[CategoryID] = 1'));

end;


Tutorial 2 - Business Logic - Visual Basic

Visual Basic

If e.Field.Name = "CustomerID" Then

e.NewValue = CStr(e.NewValue).ToUpper()

End If


Tutorial 2 - Business Logic - Visual Basic2

Visual Basic

If e.Field.Name = "Quantity" Then

If (CShort(e.NewValue) < 1) Then

e.NewValue = CShort(1)

End If

ElseIf e.Field.Name = "Discount" Then

If CSng(e.NewValue) < 0 Or CSng(e.NewValue) > 1 Then

Throw New ApplicationException("Discount must be between 0 and 1")

End If

End If


Tutorial 2 - Business Logic - Visual Basic3

Visual Basic

If e.Field.Name = "Quantity" Then

Dim orderDetail As Order_DetailsRow, product As ProductsRow

Dim oldValue, unitsOrdered As Short

orderDetail = Order_DetailsRow.Obj(e.Row)

product = orderDetail.GetProductsRow()

If Not (product Is Nothing) Then

If e.OldValue Is Convert.DBNull Then

oldValue = CShort(0)

Else

oldValue = CShort(e.OldValue)

End If

unitsOrdered = CShort(CShort(e.NewValue) - CShort(oldValue))

End If

product.UnitsInStock = CShort(product.UnitsInStock - unitsOrdered)

If product.UnitsInStock < 0 Then

product.UnitsInStock = 0

End If

product.UnitsOnOrder = product.UnitsOnOrder + unitsOrdered

End If


Tutorial 2 - Business Logic - Visual Basic4

Visual Basic

If e.DataTable.SchemaTable.Name = "CustOrdersDetails" Then

Dim order As CustOrdersDetailsRow_tableView

order = CustOrdersDetailsRow_tableView.Obj(e.Row)

If order.IsShipNameNull() Then order.ShipName = order.CompanyName

If order.IsShipAddressNull() Then order.ShipAddress = order.Address

If order.IsShipCityNull() Then order.ShipCity = order.City

If order.IsShipRegionNull() Then order.ShipRegion = order.Region

If order.IsShipPostalCodeNull() Then order.ShipPostalCode = order.PostalCode

If order.IsShipCountryNull() Then order.ShipCountry = order.Country

End If


Tutorial 2 - Business Logic - Visual Basic5

Visual Basic

C1DataSet1.Update()


Tutorial 2 - Business Logic - Visual Basic6

Visual Basic

Dim dataSetDef As C1.Data.SchemaObjects.DataSetDef

dataSetDef = e.DataSet.Schema.DataSetDefs("ProductsOrders")

e.Filter.Add(New C1.Data.FilterCondition(dataSetDef.TableViews _
("ProductsOrderDetailsCust"), "[CategoryID] = 1"))

e.Filter.Add(New C1.Data.FilterCondition(dataSetDef.TableViews _
("CustOrdersDetails"), "[CategoryID] = 1"))


Tutorial 3 - Creating Distributed 3-Tier Applications - C#

C#

System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(new

System.Runtime.Remoting.Channels.Tcp.TcpChannel(8000));

System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType(

Type.GetType("Northwind.RemoteService, Northwind"), "ThreeTierServer.soap",

System.Runtime.Remoting.WellKnownObjectMode.Singleton);


Tutorial 3 - Creating Distributed 3-Tier Applications - Delphi

Delphi

System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.Tcp.TcpChannel.Create(8000));

System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType(&Type.GetType('Northwind.RemoteService, Northwind'), 'ThreeTierServer.soap', System.Runtime.Remoting.WellKnownObjectMode.Singleton);


Tutorial 3 - Creating Distributed 3-Tier Applications - Visual Basic

Visual Basic

System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel

_ (New System.Runtime.Remoting.Channels.Tcp.TcpChannel(8000)) _

System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownServiceType_

(Type.GetType("Northwind.RemoteService, Northwind"), "ThreeTierServer.soap", _

System.Runtime.Remoting.WellKnownObjectMode.Singleton)


Tutorial 4 - Using C1ExpressView Component - C#

C#

Form2 form = new Form2();

form.ShowDialog();


Tutorial 4 - Using C1ExpressView Component - Delphi

Delphi

var

form: Form2;

begin

form := Form2.Create;

form.ShowDialog;

end;


Tutorial 4 - Using C1ExpressView Component - Visual Basic

Visual Basic

Dim form As New Form2

form.ShowDialog()


Tutorial 4 - Virtual Mode - C#

C#

label1.Text = "Fetch complete. Record count: " +

c1DataTableSource1.DataTable.Rows.Count.ToString();


Tutorial 4 - Virtual Mode - C#2

C#

label2.Text = "Fetch complete. Record count: " +

c1DataTableSource2.DataTable.Rows.Count.ToString();


Tutorial 4 - Virtual Mode - C#3

C#

Form2 form2 = new Form2();

form2.ShowDialog(this);


Tutorial 4 - Virtual Mode - Delphi

Delphi

label1.Text := ('Fetch complete. Record count: ' + c1DataTableSource1.DataTable.Rows.Count.ToString);


Tutorial 4 - Virtual Mode - Delphi2

Delphi

Label2.Text :=('Fetch complete. Record count: ' + C1DataTableSource2.DataTable.Rows.Count.ToString);


Tutorial 4 - Virtual Mode - Delphi3

Delphi

var

form2: Form2;

begin

form2 := Form2.Create;

form2.ShowDialog(Self);

end;


Tutorial 4 - Virtual Mode - Visual Basic

Visual Basic

Label1.Text = "Fetch complete. Record count: " +

C1DataTableSource1.DataTable.Rows.Count.ToString()


Tutorial 4 - Virtual Mode - Visual Basic2

Visual Basic

Label2.Text = "Fetch complete. Record count: " +

C1DataTableSource2.DataTable.Rows.Count.ToString()


Tutorial 4 - Virtual Mode - Visual Basic3

Visual Basic

Dim form2 As Form2

form2 = New Form2()

form2.ShowDialog(Me)


Tutorial 5 - Customizing Data Behavior with Events - C#

C#

private void c1ExpressTable1_BeforeFieldChange

(object sender, C1.Data.FieldChangeEventArgs e)

{

if (e.Field.Name == "Quantity")

{

if ((short)e.NewValue < 1)

e.NewValue = (short)1;

}

else if (e.Field.Name == "Discount")

{

if ((float)e.NewValue < 0 || (float)e.NewValue > 1)

throw new ApplicationException("Discount must be between 0 and 1");

}

}

private void c1ExpressTable1_BeforeEndEdit

(object sender, C1.Data.RowChangeEventArgs e)

{

if ((short)e.Row["Quantity"] * (decimal)e.Row["UnitPrice"] > 100000)

throw new ApplicationException("Too expensive");

}


Tutorial 5 - Customizing Data Behavior with Events - Delphi

Delphi

procedure TWinForm.C1ExpressTable1_BeforeFieldChange(sender: System.Object; e: C1.Data.FieldChangeEventArgs);

begin

if e.Field.Name = 'Quantity' then

begin

if SmallInt(e.NewValue) < 1 then

e.NewValue := TObject(SmallInt(1));

end

else if e.Field.Name = 'Discount' then

if ((Single(e.NewValue) < 0) or (Single(e.NewValue) > 1)) then

raise System.ApplicationException.Create('Discount must be between 0 and 1');

end;

procedure TWinForm.C1ExpressTable1_BeforeEndEdit(sender: System.Object; e: C1.Data.RowChangeEventArgs);

var Q: SmallInt;

Up: System.Decimal;

V1, V2: System.Decimal;

begin

Q := SmallInt(e.Row['Quantity']);

Up := System.Decimal(e.Row['UnitPrice']);

V1 := Q * Up;

V2 := Double(100000.0);

if (V1 > V2) then

raise System.ApplicationException.Create('Too expensive');

end;


Tutorial 5 - Customizing Data Behavior with Events - Visual Basic

Visual Basic

Private Sub C1ExpressTable1_BeforeFieldChange _

(ByVal sender As Object, ByVal e As C1.Data.FieldChangeEventArgs) Handles _

C1ExpressTable1.BeforeFieldChange

If e.Field.Name = "Quantity" Then

If e.NewValue < 1 Then

e.NewValue = 1

End If

ElseIf e.Field.Name = "Discount" Then

If e.NewValue < 0 Or e.NewValue > 1 Then

Throw New ApplicationException("Discount must be between 0 and 1")

End If

End If

End Sub

Private Sub C1ExpressTable1_BeforeEndEdit _

(ByVal sender As Object, ByVal e As C1.Data.RowChangeEventArgs) Handles _

C1ExpressTable1.BeforeEndEdit

If e.Row("Quantity") * e.Row("UnitPrice") > 100000 Then

Throw New ApplicationException("Too expensive")

End If

End Sub


Using Typed Data Objects- C#

C#

DataRow row;

ProductsRow product = ProductsRow.Obj(row)


Using Typed Data Objects- Delphi

Delphi

var

product: ProductsRow;

row: DataRow;

begin

product := ProductsRow.Obj(row);

end;


Using Typed Data Objects- Visual Basic

Visual Basic

Dim row As DataRow

Dim product As ProductsRow

product = ProductsRow.Obj(row)