Galileo Computing < openbook > Galileo Computing - Professionelle Bücher. Auch für Einsteiger.
Professionelle Bücher. Auch für Einsteiger.

Inhaltsverzeichnis
1 Einführung
2 Grundlagen der Sprachsyntax
3 Klassendesign
4 Weitere Datentypen
5 Multithreading
6 Collections und LINQ
7 Eingabe und Ausgabe
8 Anwendungen: Struktur und Installation
9 Code erstellen und debuggen
10 Einige Basisklassen
11 Windows-Anwendungen erstellen
12 Die wichtigsten Steuerelemente
13 Tastatur- und Mausereignisse
14 MDI-Anwendungen
15 Grafiken mit GDI+
16 Drucken
17 Entwickeln von Steuerelementen
18 Programmiertechniken
19 WPF – Grundlagen
20 Layoutcontainer
21 WPF-Steuerelemente
22 Konzepte von WPF
23 Datenbankverbindung mit ADO.NET
24 Datenbankabfragen mit ADO.NET
25 DataAdapter
26 Offline mit DataSet
27 Datenbanken aktualisieren
28 Stark typisierte DataSets
A Anhang: Einige Übersichten
Stichwort

Download:
- ZIP, ca. 12,3 MB
Buch bestellen
Ihre Meinung?

Spacer
<< zurück
Visual Basic 2008 von Andreas Kuehnel, Stephan Leibbrandt
Das umfassende Handbuch
Buch: Visual Basic 2008

Visual Basic 2008
3., aktualisierte und erweiterte Auflage, geb., mit DVD
1.323 S., 49,90 Euro
Galileo Computing
ISBN 978-3-8362-1171-0
Pfeil A Anhang: Einige Übersichten
Pfeil A.1 Erweiterungsmethoden
Pfeil A.2 Generische Typen
Pfeil A.3 Typisiertes DataSet


Galileo Computing - Zum Seitenanfang

A.3 Typisiertes DataSet topZur vorigen Überschrift

Das unten abgedruckte stark typisierte DataSet beschreibt einen Ausschnitt aus der Northwind-Datenbank. Aus der Tabelle Products sind die Spalten ProductID, ProductName, CategoryID und UnitPrice vertreten; aus Categories sind es CategoryID und CategoryName. Um das Listing abzukürzen, wurden einige Namensräume importiert und ein paar Schlüsselwörter abgekürzt. Das Listing hat nicht an allen Stellen dieselbe Reihenfolge wie die vom Designer des Visual Studios erzeugte Datei.


Zeichen Bedeutung

+

Public

#

Protected

=

Friend

-

Private

*

Overridable

&

Overloads

O

Overrides

S

Shadows

P

Partial

%

Shared


Imports System.Data 
Imports System.Runtime.Serialization 
Imports System.Xml 
Imports System.Xml.Schema 
Imports System.Collections 
Imports System.Collections.Generic 
Imports System.ComponentModel

Option Strict Off 
Option Explicit On

+P Class NWDataSet : Inherits DataSet

  +  Sub New() 
  #  Sub New(info As SerializationInfo, context As StreamingContext) 
  #O Sub InitializeDerivedDataSet() 
  =& Sub InitVars() 
  =& Sub InitVars(initTable As Boolean) 
  +O Function Clone() As DataSet

  +  ReadOnly Property Products() As ProductsDataTable 
  +  ReadOnly Property Categories() As CategoriesDataTable 
  +S ReadOnly Property Tables() As DataTableCollection 
  +S ReadOnly Property Relations() As DataRelationCollection

  +O Property SchemaSerializationMode() As SchemaSerializationMode 
  #O Function ShouldSerializeTables() As Boolean 
  #O Function ShouldSerializeRelations() As Boolean 
  #O Sub ReadXmlSerializable(reader As XmlReader) 
  #O Function GetSchemaSerializable() As XmlSchema

  +  Shared Function GetTypedDataSetSchema(xs As XmlSchemaSet) _ 
     As XmlSchemaComplexType

  +  Delegate Sub ProductsRowChangeEventHandler _ 
     (sender As Object, e As ProductsRowChangeEvent) 
  +  Delegate Sub CategoriesRowChangeEventHandler _ 
     (sender As Object, e As CategoriesRowChangeEvent)

  +P Class ProductsDataTable : Inherits TypedTableBase(Of ProductsRow)

    +  Sub New() 
    =  Sub New(table As DataTable) 
    #  Sub New(info As SerializationInfo, context As StreamingContext) 
    #O Function CreateInstance() As DataTable 
    =  Sub InitVars() 
    +O Function Clone() As DataTable

    +  ReadOnly Property ProductIDColumn() As DataColumn 
    +  ReadOnly Property ProductNameColumn() As DataColumn 
    +  ReadOnly Property CategoryIDColumn() As DataColumn 
    +  ReadOnly Property UnitPriceColumn() As DataColumn 
    +  ReadOnly Property Count() As Integer 
    +  Default ReadOnly Property Item(index As Integer) As ProductsRow

    +  Event ProductsRowChanging As ProductsRowChangeEventHandler 
    +  Event ProductsRowChanged As ProductsRowChangeEventHandler 
    +  Event ProductsRowDeleting As ProductsRowChangeEventHandler 
    +  Event ProductsRowDeleted As ProductsRowChangeEventHandler 
    #O Sub OnRowChanged(e As DataRowChangeEventArgs) 
    #O Sub OnRowChanging(e As DataRowChangeEventArgs) 
    #O Sub OnRowDeleted(e As DataRowChangeEventArgs) 
    #O Sub OnRowDeleting(e As DataRowChangeEventArgs)

    #O Function GetRowType() As Type 
    +  Function NewProductsRow() As ProductsRow 
    +& Sub AddProductsRow(row As ProductsRow) 
    +& Function AddProductsRow(ProductName As String, _ 
         parentCategoriesRowByFK_Products_Categories1 As CategoriesRow, _ 
         UnitPrice As Decimal) As ProductsRow 
    +  Function FindByProductID(ProductID As Integer) As ProductsRow 
    #O Function NewRowFromBuilder(builder As DataRowBuilder) As DataRow 
    +  Sub RemoveProductsRow(row As ProductsRow)

    +  Shared Function GetTypedTableSchema(xs As XmlSchemaSet) _ 
         As XmlSchemaComplexType

  End Class

  +P Class CategoriesDataTable : Inherits TypedTableBase(Of CategoriesRow)

    +  Sub New() 
    =  Sub New(table As DataTable) 
    #  Sub New(info As SerializationInfo, context As StreamingContext) 
    #O Function CreateInstance() As DataTable 
    =  Sub InitVars() 
    +O Function Clone() As DataTable

    +  ReadOnly Property CategoryIDColumn() As DataColumn 
    +  ReadOnly Property CategoryNameColumn() As DataColumn 
    +  ReadOnly Property Count() As Integer 
    +  Default ReadOnly Property Item(index As Integer) As CategoriesRow

    +  Event CategoriesRowChanging As CategoriesRowChangeEventHandler 
    +  Event CategoriesRowChanged As CategoriesRowChangeEventHandler 
    +  Event CategoriesRowDeleting As CategoriesRowChangeEventHandler 
    +  Event CategoriesRowDeleted As CategoriesRowChangeEventHandler 
    #O Sub OnRowChanged(e As DataRowChangeEventArgs) 
    #O Sub OnRowChanging(e As DataRowChangeEventArgs) 
    #O Sub OnRowDeleted(e As DataRowChangeEventArgs) 
    #O Sub OnRowDeleting(e As DataRowChangeEventArgs)

    #O Function GetRowType() As Type 
    +  Function NewCategoriesRow() As CategoriesRow 
    +& Sub AddCategoriesRow(row As CategoriesRow) 
    +& Function AddCategoriesRow(CategoryName As String) As CategoriesRow 
    +  Function FindByCategoryID(CategoryID As Integer) As CategoriesRow 
    #O Function NewRowFromBuilder(builder As DataRowBuilder) As DataRow 
    +  Sub RemoveCategoriesRow(row As CategoriesRow)

    +  Shared Function GetTypedTableSchema(xs As XmlSchemaSet) _ 
         As XmlSchemaComplexType 
  End Class

  +P Class ProductsRow : Inherits DataRow 
    = Sub New(rb As DataRowBuilder) 
    + Property ProductID() As Integer 
    + Property ProductName() As String 
    + Property CategoryID() As Integer 
    + Property UnitPrice() As Decimal 
    + Property CategoriesRow() As CategoriesRow 
    + Function IsCategoryIDNull() As Boolean 
    + Sub SetCategoryIDNull() 
    + Function IsUnitPriceNull() As Boolean 
    + Sub SetUnitPriceNull() 
  End Class

  +P Class CategoriesRow : Inherits DataRow 
    = Sub New(rb As DataRowBuilder) 
    + Property CategoryID() As Integer 
    + Property CategoryName() As String 
    + Function GetProductsRows() As ProductsRow() 
  End Class

  + Class ProductsRowChangeEvent : Inherits EventArgs 
    + Sub New(row As ProductsRow, action As DataRowAction) 
    + ReadOnly Property Row() As ProductsRow 
    + ReadOnly Property Action() As DataRowAction 
  End Class

  + Class CategoriesRowChangeEvent : Inherits EventArgs 
    + Sub New(row As CategoriesRow, action As DataRowAction) 
    + ReadOnly Property Row() As CategoriesRow 
    + ReadOnly Property Action() As DataRowAction 
  End Class

End Class

Namespace NWDataSetTableAdapters

  +P Class ProductsTableAdapter : Inherits Component

    +   Sub New() 
    +   Property ClearBeforeFill() As Boolean 
    +&* Function Fill(dataTable As NWDataSet.ProductsDataTable) As Integer 
    +&* Function GetData() As NWDataSet.ProductsDataTable

    #=  ReadOnly Property Adapter() As SqlClient.SqlDataAdapter 
    =   Property Connection() As SqlClient.SqlConnection 
    =   Property Transaction() As SqlClient.SqlTransaction 
    #   ReadOnly Property CommandCollection() As SqlClient.SqlCommand()

    +&* Function Update(dataTable As NWDataSet.ProductsDataTable) As Integer 
    +&* Function Update(dataSet As NWDataSet) As Integer 
    +&* Function Update(dataRow As DataRow) As Integer 
    +&* Function Update(dataRows() As DataRow) As Integer 
    +&* Function Update(ProductName As String, CategoryID As Integer?, _ 
          UnitPrice As Decimal?, Original_ProductID As Integer, _ 
          Original_ProductName As String, Original_CategoryID As Integer?, _ 
          Original_UnitPrice As GDecimal?, ProductID As Integer) As Integer 
    +&* Function Update(ProductName As String, CategoryID As Integer?, _ 
          UnitPrice As Decimal?, Original_ProductID As Integer, _ 
          Original_ProductName As String, Original_CategoryID As Integer?, _ 
          Original_UnitPrice As Decimal?) As Integer

    +&* Function Insert(ProductName As String, CategoryID As Integer?, _ 
          UnitPrice As Decimal?) As Integer 
    +&* Function Delete(Original_ProductID As Integer, _ 
          Original_ProductName As String, Original_CategoryID As Integer?, _ 
          Original_UnitPrice As Decimal?) As Integer

  End Class

  +P Class CategoriesTableAdapter : Inherits Component

    +   Sub New() 
    +   Property ClearBeforeFill() As Boolean 
    +&* Function Fill(dataTable As NWDataSet.CategoriesDataTable) As Integer 
    +&* Function GetData() As NWDataSet.CategoriesDataTable

    #=  ReadOnly Property Adapter() As SqlClient.SqlDataAdapter 
    =   Property Connection() As SqlClient.SqlConnection 
    =   Property Transaction() As SqlClient.SqlTransaction 
    #   ReadOnly Property CommandCollection() As SqlClient.SqlCommand()

    +&* Function Update(dataTable As NWDataSet.CategoriesDataTable) As Integer 
    +&* Function Update(dataSet As NWDataSet) As Integer 
    +&* Function Update(dataRow As DataRow) As Integer 
    +&* Function Update(dataRows() As DataRow) As Integer 
    +&* Function Update(CategoryName As String, _ 
          Original_CategoryID As Integer, Original_CategoryName As String, _ 
          CategoryID As Integer) As Integer 
    +&* Function Update(CategoryName As String, _ 
          Original_CategoryID As Integer, Original_CategoryName As String) _ 
          As Integer

    +&* Function Insert(CategoryName As String) As Integer 
    +&* Function Delete(Original_CategoryID As Integer, _ 
          Original_CategoryName As String) As Integer

  End Class

  +P Class TableAdapterManager : Inherits Component

    +  Property ProductsTableAdapter() As ProductsTableAdapter 
    +  Property CategoriesTableAdapter() As CategoriesTableAdapter 
    +  ReadOnly Property TableAdapterInstanceCount() As Integer

    +  Property Connection() As IDbConnection 
    #* Function MatchTableAdapterConnection _ 
         (inputConnection As IDbConnection) As Boolean

    +  Property UpdateOrder() As UpdateOrderOption 
    +  Enum UpdateOrderOption 
    +  Property BackupDataSetBeforeUpdate() As Boolean 
    +* Function UpdateAll(dataSet As NWDataSet) As Integer 
    #* Sub SortSelfReferenceRows(rows() As DataRow, _ 
         relation As DataRelation, childFirst As Boolean)

  End Class

End Namespace



Ihr Kommentar

Wie hat Ihnen das <openbook> gefallen? Wir freuen uns immer über Ihre freundlichen und kritischen Rückmeldungen.






<< zurück
  Zum Katalog
Zum Katalog: Visual Basic 2008







Visual Basic 2008
Jetzt bestellen


 Ihre Meinung?
Wie hat Ihnen das <openbook> gefallen?
Ihre Meinung

 Tipp
Zum Katalog: Coding for Fun





 Coding for Fun


 Buchempfehlungen
Zum Katalog: Einstieg in Visual Basic 2008





 Einstieg in
 Visual Basic 2008


Zum Katalog: Einstieg in Visual C# 2008





 Einstieg in
 Visual C# 2008


Zum Katalog: Windows Presentation Foundation





 Windows Presentation
 Foundation


Zum Katalog: Einstieg in Visual C++ 2008





 Einstieg in
 Visual C++ 2008


Zum Katalog: Visual C# 2008





 Visual C# 2008


Zum Katalog: Videotraining - Visual C# 2008





 Videotraining -
 Visual C# 2008


Zum Katalog: Einstieg in PHP





 Einstieg in PHP


Zum Katalog: IT-Handbuch für Fachinformatiker





 IT-Handbuch für
 Fachinformatiker


 Shopping
Versandkostenfrei bestellen in Deutschland und Österreich
InfoInfo




Copyright © Galileo Press 2009
Für Ihren privaten Gebrauch dürfen Sie die Online-Version natürlich ausdrucken. Ansonsten unterliegt das <openbook> denselben Bestimmungen, wie die gebundene Ausgabe: Das Werk einschließlich aller seiner Teile ist urheberrechtlich geschützt. Alle Rechte vorbehalten einschließlich der Vervielfältigung, Übersetzung, Mikroverfilmung sowie Einspeicherung und Verarbeitung in elektronischen Systemen.


[Galileo Computing]

Galileo Press, Rheinwerkallee 4, 53227 Bonn, Tel.: 0228.42150.0, Fax 0228.42150.77, info@galileo-press.de