Microsoft.Sqlser Ver.Server


Chapter 19, "Data Access with .NET," discussed classes from the namespace System.Data.SqlClient. For adding functionality to the SQL Server 2005, the Microsoft.SqlServer.Server namespace has been defined, which includes classes to be used within SQL Server. Many of the System.Data.SqlClient classes can be used together with classes from the namespace Microsoft.SqlServer.Server, with the big difference that a connection is not newly initiated, but an already opened connection from the client is used instead.

The following table lists major classes from the Microsoft.SqlServer.Server namespace and their functionality.

Class

Description

SqlContext

Like an HTTP context, the SQL context is associated with the request of a client. With static members of the SqlContext class, SqlPipe, SqlTriggerContext, and WindowsIdentitiy can be accessed.

SqlPipe

With the SqlPipe class results or information can be sent to the client. This class offers the methods ExecuteAndSend(), Send(), and SendResultsRow(). The Send() method has different overloads to either send a SqlDataReader, SqlDataRecord, and string.

SqlTriggerContext

The SqlTriggerContext class is used within triggers.

You see these classes in action later in this chapter when writing stored procedures and user-defined functions is discussed, but first, the following section looks into creating user-defined types with C#.




Professional C# 2005
Pro Visual C++ 2005 for C# Developers
ISBN: 1590596080
EAN: 2147483647
Year: 2005
Pages: 351
Authors: Dean C. Wills

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net