ADO.NET Data Provider Users Guide for Microsoft Windows Company
Total Page:16
File Type:pdf, Size:1020Kb
PUBLIC SDK for SAP Adaptive Server Enterprise 16.0 SP03 PL07 Document Version: 1.0 – 2019-06-06 ADO.NET Data Provider Users Guide for Microsoft Windows company. All rights reserved. All rights company. affiliate THE BEST RUN 2019 SAP SE or an SAP SE or an SAP SAP 2019 © Content 1 SAP Adaptive Server Enterprise ADO.NET Data Provider..............................11 1.1 Requirements to Deploy SAP Adaptive Server Enterprise ADO.NET Data Provider...............11 System Requirements...................................................... 12 SAP Adaptive Server Enterprise ADO.NET Data Provider Assembly Deployment into Global Assembly Cache.......................................................... 12 1.2 Updating to a Newer Version of ADO.NET Data Provider................................. 17 Common Language Runtime..................................................17 Deploy Updates to the Data Provider............................................19 1.3 Sample Projects.............................................................19 2 Sample Applications.........................................................21 2.1 Tutorial: Use Simple Code Sample................................................ 21 Running Simple Code Sample in Visual Studio .NET................................. 22 Running Simple Sample Project without Visual Studio................................23 Understand Simple Sample Project.............................................23 2.2 Tutorial: Use Table Viewer Code Sample............................................26 Running Table Viewer Code Sample in Visual Studio .NET............................. 27 Running Table Viewer Sample Project without Visual Studio............................28 Understand Table Viewer Sample Project.........................................29 2.3 Tutorial: Use Advanced Code Sample..............................................32 Running Advanced Code Sample in Visual Studio .NET...............................33 Running Advanced Sample Project without Visual Studio..............................34 Understand Advanced Sample Project...........................................35 3 Develop Applications........................................................39 3.1 Using Data Provider in a Visual Studio .NET Project....................................39 Adding a Reference to SAP Adaptive Server Enterprise ADO.NET Data Provider in a Visual Studio .NET Project........................................................40 Referencing the SAP Adaptive Server Enterprise ADO.NET Data Provider Classes in Code...... 40 3.2 Connecting to an Adaptive Server Database......................................... 41 Connection Pooling........................................................43 Check the Connection State..................................................44 Character Set............................................................45 3.3 DDEX Provider for SAP Adaptive Server Enterprise.................................... 45 Connecting to SAP Adaptive Server Enterprise.....................................46 Viewing Adaptive Server Objects...............................................47 Supported Adaptive Server Objects.............................................47 ADO.NET Data Provider Users Guide for Microsoft Windows 2 PUBLIC Content Enhanced DDEX Provider for Adaptive Server......................................49 SAP Adaptive Server Enterprise ADO.NET Data Provider Support for SSIS.................50 3.4 Ways to Access and Manipulate Data..............................................56 Use AseCommand to Retrieve and Manipulate Data................................. 57 Use AseDataAdapter to Access and Manipulate Data.................................71 Obtaining Primary Key Values.................................................88 BLOBs Handling.......................................................... 93 Obtaining Time Values......................................................96 Converting a Time Value Using the GetDateTime Method............................. 96 3.5 Stored Procedures...........................................................97 Executing a Stored Procedure.................................................98 3.6 Alternate Way to Call a Stored Procedure.......................................... 100 3.7 Transaction Processing.......................................................100 Isolation Level Setup for Transactions...........................................101 Support for Transact-SQL Queries with COMPUTE clause............................ 103 3.8 Error Handling............................................................. 104 3.9 Performance Consideration....................................................106 DbType.String vs. DbType.AnsiString...........................................106 4 SAP Adaptive Server Enterprise Advanced Features................................107 4.1 Supported SAP Adaptive Server Enterprise Cluster Edition features........................107 Login Redirection.........................................................108 Connection Migration......................................................108 Connection Failover.......................................................108 4.2 Distributed Transactions......................................................109 Programming Using Enterprise Services.........................................110 4.3 Directory Services...........................................................111 LDAP as a Directory Service..................................................112 Using Directory Services....................................................112 4.4 Microsecond Granularity for Time Data............................................113 4.5 Password Encryption.........................................................114 Enabling Password Encryption................................................114 4.6 Password Expiration Handling...................................................115 4.7 Securely Automate Database Administration Tasks Using Secure User Store..................115 How Does the aseuserstore Utility Work?........................................ 116 Enabling Secure User Store for ADO.NET Client....................................116 Examples of Creating User Keys for ADO.NET Clients................................117 4.8 Secure Sockets Layer (SSL) ....................................................117 SSL in Adaptive Server Enterprise ADO.NET Data Provider............................119 Validate the Server by its Certificate............................................119 Enabling SSL Connections.................................................. 120 4.9 Failover in a High-Availability System..............................................120 ADO.NET Data Provider Users Guide for Microsoft Windows Content PUBLIC 3 4.10 Kerberos Authentication...................................................... 122 Kerberos Process Overview..................................................122 Kerberos Requirements.................................................... 123 Enabling Kerberos Authentication.............................................123 Obtaining an Initial Ticket From the Key Distribution Center...........................124 4.11 SECURECONNECTIONSTRING Property...........................................125 4.12 Multiversion Concurrency Control................................................125 Connection Support in Multiversion Concurrency Control............................ 126 ADO.NET Support for Multiversion Concurrency Control .............................127 4.13 On-demand Command Encryption for SAP ASE Clients................................ 128 ADO.NET Client and On-demand Command Encryption..............................128 5 Supported Microsoft ADO.NET 3.5 and 4.0 Features................................131 5.1 Microsoft Enterprise Library Database Access Application Block for SAP Adaptive Server Enterprise.................................................................131 5.2 Microsoft ADO.NET Entity Framework and LINQ......................................133 6 SAP Adaptive Server Enterprise ADO.NET Data Provider API Reference.................134 6.1 AseBulkCopy Class..........................................................135 AseBulkCopy Constructors..................................................136 Close Method............................................................137 Dispose Method..........................................................137 Finalize Method..........................................................138 WriteToServer Method.....................................................138 BatchSize Property........................................................139 BulkCopyTimeout Property..................................................139 ColumnMappings Property..................................................140 DestinationTableName Property.............................................. 140 NotifyAfter Property.......................................................141 AseRowsCopied Event......................................................141 6.2 AseBulkCopyColumnMapping Class.............................................. 141 AseBulkCopyColumnMapping Constructors......................................142 Equals Method...........................................................143 DestinationColumn Property.................................................143 DestinationOrdinal Property................................................. 144 SourceColumn Property....................................................144