TechTalk Genome v4.2

GenomeDataSource Class

Represents a Genome Set or a persistent object to data bound controls.

For a list of all members of this type, see GenomeDataSource Members.

System.Object
   Control
      DataSourceControl
         GenomeDataSource

[ToolboxBitmap]
[ParseChildren(ChildControlType="System.Web.UI.Control", ChildrenAsProperties="True", )]
[DisplayName(DisplayName="Genome Data Source")]
[Description(Description="Connects to a Genome persistent result set.")]
[PersistChildren(Persist="False", UsesCustomPersistence="False")]
[Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="TechTalk.Genome.Extensions.Web.UI.Design.GenomeDataSourceDesigner, TechTalk.Genome.Extensions.Web, Version=4.2.4.4, Culture=neutral, PublicKeyToken=21d2f016240c8d3d")]
[Bindable(Bindable="False", Direction="OneWay")]
[NonVisualControl(IsNonVisual="True")]
[ControlBuilder(BuilderType="System.Web.UI.DataSourceControlBuilder")]
[Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="System.Web.UI.Design.DataSourceDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[DesignerSerializer(SerializerTypeName="Microsoft.VisualStudio.Web.WebForms.ControlCodeDomSerializer, Microsoft.VisualStudio.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", SerializerBaseTypeName="System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItem(ToolboxItemType="System.Web.UI.Design.WebControlToolboxItem", ToolboxItemTypeName="System.Web.UI.Design.WebControlToolboxItem, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[DefaultProperty(Name="ID")]
[DesignerCategory(Category="Code")]
[Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="System.Web.UI.Design.ControlDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItemFilter(FilterString="System.Web.UI", FilterType="Require")]
[Themeable(Themeable="False")]
public class GenomeDataSource : DataSourceControl, IGenomeDataSource, IPersistentDataSource

Remarks

The GenomeDataSource is an ASP.NET data source control that represents a Genome Set or a persistent object to data-bound controls. You can use the GenomeDataSource control in conjunction with a data-bound control to display, edit, and sort data on a Web page with little or no code.

When using GenomeDataSource, operations such as paging and sorting are optimised by using the power of the underlying database server. This server-side optimisation makes it possible to efficiently bind a large Set of objects to a pageable data-bound control, as GenomeDataSource can load just the necessary page of objects into memory.

Similarly to ObjectDataSource, GenomeDataSource uses reflection to call a user-defined method when it has to retrieve data.

Example

                    
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebTest._Default" %>
<%@ Register Assembly="TechTalk.Genome.Extensions.Web" Namespace="TechTalk.Genome.Extensions.Web.UI"
    TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>GenomeDataSource - Sample</title>
</head>
<body>
    <form id="form1" runat="server">
        <cc1:genomedatasource 
            id="GenomeDataSource1" runat="server" 
            DataSourceProviderMemberName="GetAllEmployees" 
            DataSourceProviderTypeName="WebTest.DataSourceProvider" 
            ElementTypeName="Northwind.Business.Employee" 
            DataDomainRole="northwind" 
            AutoCommit="True"/>
    
        <asp:GridView ID="GridView1" runat="server" 
            AutoGenerateColumns="False" 
            DataSourceID="GenomeDataSource1" 
            AllowPaging="True" 
            AllowSorting="true">
            <Columns>
                <asp:BoundField DataField="TitleOfCourtesy" HeaderText="TitleOfCourtesy" SortExpression="TitleOfCourtesy" />
                <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                <asp:BoundField DataField="Extension" HeaderText="Extension" SortExpression="Extension" />
                <asp:BoundField DataField="EmployeeId" HeaderText="EmployeeId" ReadOnly="True" SortExpression="EmployeeId" InsertVisible="False" />
                <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
                <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" SortExpression="PostalCode" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="PhotoPath" HeaderText="PhotoPath" SortExpression="PhotoPath" />
                <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                <asp:BoundField DataField="Region" HeaderText="Region" SortExpression="Region" />
                <asp:BoundField DataField="HomePhone" HeaderText="HomePhone" SortExpression="HomePhone" />
            </Columns>
        </asp:GridView>

Requirements

Namespace: TechTalk.Genome.Extensions.Web.UI

Assembly: TechTalk.Genome.Extensions.Web (in TechTalk.Genome.Extensions.Web.dll)

Version: 4.2.4.4

Editions: Professional, Evaluation, Express

See Also

GenomeDataSource Members | TechTalk.Genome.Extensions.Web.UI Namespace