DatabaseMapping 类

The DatabaseMapping object represents a SQL Server database mapping.

继承层次结构

System.Object
  Microsoft.SqlServer.Management.Smo.DatabaseMapping

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
Public NotInheritable Class DatabaseMapping
用法
Dim instance As DatabaseMapping
public sealed class DatabaseMapping
public ref class DatabaseMapping sealed
[<SealedAttribute>]
type DatabaseMapping =  class end
public final class DatabaseMapping

DatabaseMapping 类型公开以下成员。

构造函数

  名称 说明
公共方法 DatabaseMapping Initializes a new instance of the DatabaseMapping class for the specified login, database, and user.

页首

属性

  名称 说明
公共属性 DBName Gets the name of the database in which the login is mapped to the database user.
公共属性 LoginName Gets the name of the login that is mapped to the user in the database.
公共属性 UserName Gets the database user that is mapped to the login in the database.

页首

方法

  名称 说明
公共方法 Equals (从 Object 继承。)
公共方法 GetHashCode (从 Object 继承。)
公共方法 GetType (从 Object 继承。)
公共方法 ToString Returns a string that represents the DatabaseMapping object. (覆盖 Object.ToString()。)

页首

注释

A login allows access to SQL Server, though it does not allocate permissions at a database level. Each login requires mapping to a database user within each database. The information about each mapping is stored in the DatabaseMapping object. Every login has a database mapping for each database that it can access.

Thread Safety

此类型的任何公共静态(Microsoft Visual Basic 中的 Shared)成员在多线程操作中是安全的。但不保证所有实例成员都是线程安全的。

示例

管理用户、角色和登录名

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.SqlServer.Management.Smo 命名空间

其他资源

主体(数据库引擎)