SqlCredential 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
SqlCredential 提供了一种更安全的方法,用于使用 SQL Server 身份验证指定登录尝试的密码。
SqlCredential 由用户 ID 和将用于 SQL Server 身份验证的密码组成。 SqlCredential 对象中的密码类型为 SecureString。
无法继承 SqlCredential。
Windows 身份验证(Integrated Security = true)仍然是登录到 SQL Server 数据库的最安全方法。
public ref class SqlCredential sealed
	public sealed class SqlCredential
	type SqlCredential = class
	Public NotInheritable Class SqlCredential
		- 继承
 - 
				SqlCredential
 
注解
警告
Microsoft不建议直接提供用户名和密码,因为它是不安全模式。 如果可能,请使用更安全的身份验证流,例如 Azure 资源的托管标识,或 SQL Server 的 Windows 身份验证。
构造函数
| SqlCredential(String, SecureString) | 
		 创建类型为 SqlCredential的对象。  | 
        	
属性
| Password | 
		 获取 SqlCredential 对象的密码组件。  | 
        	
| UserId | 
		 获取 SqlCredential 对象的用户 ID 组件。  | 
        	
方法
| Equals(Object) | 
		 确定指定的对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
		 用作默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
		 获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
		 创建当前 Object的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 返回一个表示当前对象的字符串。 (继承自 Object) |