指定连接到 SQL Server Compact 3.5 服务器代理时使用的 Microsoft Internet 信息服务 (IIS) 密码。
命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 System.Data.SqlServerCe.dll 中)
语法
声明
Public Property InternetPassword As String
Get
Set
用法
Dim instance As SqlCeRemoteDataAccess
Dim value As String
value = instance.InternetPassword
instance.InternetPassword = value
public string InternetPassword { get; set; }
public:
property String^ InternetPassword {
String^ get ();
void set (String^ value);
}
member InternetPassword : string with get, set
function get InternetPassword () : String
function set InternetPassword (value : String)
属性值
类型:System. . :: . .String
连接到 SQL Server Compact 3.5 服务器代理时使用的 IIS 密码字符串。默认为没有密码。
注释
如果将 SQL Server Compact 3.5 服务器代理配置为使用基本身份验证或集成 Windows 身份验证,则需要 InternetPassword 属性。在使用集成 Windows 身份验证时,不通过网络传递 InternetPassword。
在使用基本身份验证时,应将 IIS 配置为使用 SSL 或专用通信技术(Private Communication Technology 即 PCT)加密,以确保用户密码安全。如果不使用 SSL 或 PCT 加密,则基本身份验证将在网络中以明文形式传输密码。这样做很不安全;因此,极力建议您在使用基本身份验证时始终利用 SSL 或 PCT 加密确保密码安全。
示例
下面的示例演示如何设置 SqlCeRemoteDataAccess 对象的 InternetPassword 属性。
' Connection String to the SQL Server
'
Dim rdaOleDbConnectString As String = "Data Source=MySqlServer;Initial Catalog=AdventureWorks; " & _
"User Id=username;Password = <password>"
' Initialize RDA Object
'
Dim rda As SqlCeRemoteDataAccess = Nothing
Try
' Try the Pull Operation
'
rda = New SqlCeRemoteDataAccess( _
"https://www.adventure-works.com/sqlmobile/sqlcesa35.dll", _
"MyLogin", _
"<password>", _
"Data Source=MyDatabase.sdf")
rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString, _
RdaTrackOption.TrackingOnWithIndexes, "ErrorTable")
' or, try one of these overloads:
' rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString, _
' RdaTrackOption.TrackingOnWithIndexes)
'
' rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString)
Catch
' Handle errors here
'
Finally
' Dispose of the RDA object
'
rda.Dispose()
End Try
// Connection String to the SQL Server
//
string rdaOleDbConnectString = "Data Source=MySqlServer;Initial Catalog=AdventureWorks; " +
"User Id=username;Password = <password>";
// Initialize RDA Object
//
SqlCeRemoteDataAccess rda = null;
try
{
// Try the Pull Operation
//
rda = new SqlCeRemoteDataAccess(
"https://www.adventure-works.com/sqlmobile/sqlcesa35.dll",
"MyLogin",
"<password>",
"Data Source=MyDatabase.sdf");
rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString,
RdaTrackOption.TrackingOnWithIndexes, "ErrorTable");
// or, try one of these overloads:
//
// rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString,
// RdaTrackOption.TrackingOnWithIndexes);
//
// rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString);
}
catch (SqlCeException)
{
// Handle errors here
//
}
finally
{
// Dispose of the RDA object
//
rda.Dispose();
}