Subscription.SetFieldValue Method
Sets the value of a field in the subscription record.
命名空间: Microsoft.SqlServer.NotificationServices
程序集: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
语法
声明
Public Sub SetFieldValue ( _
fieldName As String, _
newValue As Object _
)
public void SetFieldValue (
string fieldName,
Object newValue
)
public:
virtual void SetFieldValue (
String^ fieldName,
Object^ newValue
) sealed
public final void SetFieldValue (
String fieldName,
Object newValue
)
public final function SetFieldValue (
fieldName : String,
newValue : Object
)
参数
- fieldName
The name of the subscription field for which you want the value set.
- newValue
The value to which you want the subscription field set.
备注
This method is provided for COM interoperability, to allow callers from unmanaged code to set field values for a subscription record. Managed callers do not use this method.
示例
The following example shows how to use the SetFieldValue method in unmanaged Microsoft Visual Basic Scripting Edition (VBScript) code to set the value of a subscription field:
Dim myInstance, myApplication, mySubscription
const instanceName = "MyInstanceName"
const applicationName = "MyApplicationName"
const subscriptionClassName = "MySubscriptionClassName"
const subscriptionFieldName = "MySubscriptionFieldName"
'Create & initialize an NSInstance object.
set myInstance = WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSInstance")
myInstance.Initialize instanceName
'Create & initialize an NSApplication object.
set myApplication = WScript.CreateObject("Microsoft.SqlServer.NotificationServices.NSApplication")
myApplication.Initialize (myInstance), applicationName
'Create & initialize a Subscription object.
set mySubscription = WScript.CreateObject("Microsoft.SqlServer.NotificationServices.Subscription")
mySubscription.Initialize (myApplication), subscriptionClassName
'Set the field value.
mySubscription.SetFieldValue subscriptionFieldName, "Test"
线程安全
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
平台
开发平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
目标平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
请参阅
参考
Subscription Class
Subscription Members
Microsoft.SqlServer.NotificationServices Namespace