SqlDependency.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Type Name="SqlDependency" FullName="System.Data.SqlClient.SqlDependency">
  3. <TypeSignature Language="C#" Value="public sealed class SqlDependency" />
  4. <AssemblyInfo>
  5. <AssemblyName>System.Data</AssemblyName>
  6. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  7. </AssemblyInfo>
  8. <Base>
  9. <BaseTypeName>System.Object</BaseTypeName>
  10. </Base>
  11. <Interfaces />
  12. <Docs>
  13. <remarks>
  14. <attribution license="cc4" from="Microsoft" modified="false" />
  15. <para>
  16. <see cref="T:System.Data.SqlClient.SqlDependency" /> is ideal for caching scenarios, where your ASP.NET application or middle-tier service needs to keep certain information cached in memory. <see cref="T:System.Data.SqlClient.SqlDependency" /> allows you to receive notifications when the original data in the database changes so that the cache can be refreshed.</para>
  17. <para>To set up a dependency, you need to associate a <see cref="T:System.Data.SqlClient.SqlDependency" /> object to one or more <see cref="T:System.Data.SqlClient.SqlCommand" /> objects. To receive notifications, you need to subscribe to the <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" /> event. For more information about the requirements for creating queries for notifications, see "Creating a Query for Notification" in SQL Server Books Online.</para>
  18. <block subset="none" type="note">
  19. <para>
  20. <see cref="T:System.Data.SqlClient.SqlDependency" /> was designed to be used in ASP.NET or middle-tier services where there is a relatively small number of servers having dependencies active against the database. It was not designed for use in client applications, where hundreds or thousands of client computers would have <see cref="T:System.Data.SqlClient.SqlDependency" /> objects set up for a single database server. If you are developing an application where you need reliable sub-second notifications when data changes, review the sections Planning an Efficient Query Notifications Strategy and Alternatives to Query Notifications in the <see cref="http://go.microsoft.com/fwlink/?LinkId=211984">Planning for Notifications</see> topic in SQL Server Books Online.</para>
  21. </block>
  22. <para>For more information, see <format type="text/html"><a href="0f0ba1a1-3180-4af8-87f7-c795dc8f8f55">Using Query Notifications</a></format> and "Building Notification Solutions" in SQL Server Books Online.</para>
  23. <block subset="none" type="note">
  24. <para>The <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" /> event may be generated on a different thread from the thread that initiated command execution. </para>
  25. </block>
  26. <para>Query notifications are supported only for SELECT statements that meet a list of specific requirements. The following table provides links to the Service Broker and Query Notifications documentation in SQL Server Books Online. </para>
  27. <para>SQL Server Books Online</para>
  28. <list type="bullet">
  29. <item>
  30. <para>
  31. <see cref="http://msdn.microsoft.com/library/ms181122.aspx">Creating a Query for Notification</see>
  32. </para>
  33. </item>
  34. <item>
  35. <para>
  36. <see cref="http://msdn.microsoft.com/library/ms166059.aspx">Security Considerations for Service Broker</see>
  37. </para>
  38. </item>
  39. <item>
  40. <para>
  41. <see cref="http://msdn.microsoft.com/library/bb522911.aspx">Security and Protection (Service Broker)</see>
  42. </para>
  43. </item>
  44. <item>
  45. <para>
  46. <see cref="http://msdn.microsoft.com/library/ms172604.aspx">Security Considerations for Notifications Services</see>
  47. </para>
  48. </item>
  49. <item>
  50. <para>
  51. <see cref="http://msdn.microsoft.com/library/ms188311.aspx">Query Notification Permissions</see>
  52. </para>
  53. </item>
  54. <item>
  55. <para>
  56. <see cref="http://msdn.microsoft.com/library/ms166028.aspx">International Considerations for Service Broker</see>
  57. </para>
  58. </item>
  59. <item>
  60. <para>
  61. <see cref="http://msdn.microsoft.com/library/bb522899.aspx">Solution Design Considerations (Service Broker)</see>
  62. </para>
  63. </item>
  64. <item>
  65. <para>
  66. <see cref="http://msdn.microsoft.com/library/ms166100.aspx">Service Broker Developer InfoCenter</see>
  67. </para>
  68. </item>
  69. <item>
  70. <para>
  71. <see cref="http://msdn.microsoft.com/library/bb522908.aspx">Developer's Guide (Service Broker)</see>
  72. </para>
  73. </item>
  74. </list>
  75. </remarks>
  76. <summary>
  77. <attribution license="cc4" from="Microsoft" modified="false" />
  78. <para>The <see cref="T:System.Data.SqlClient.SqlDependency" /> object represents a query notification dependency between an application and an instance of SQL Server. An application can create a <see cref="T:System.Data.SqlClient.SqlDependency" /> object and register to receive notifications via the <see cref="T:System.Data.SqlClient.OnChangeEventHandler" /> event handler.</para>
  79. </summary>
  80. </Docs>
  81. <Members>
  82. <Member MemberName=".ctor">
  83. <MemberSignature Language="C#" Value="public SqlDependency ();" />
  84. <MemberType>Constructor</MemberType>
  85. <AssemblyInfo>
  86. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  87. </AssemblyInfo>
  88. <Parameters />
  89. <Docs>
  90. <remarks>
  91. <attribution license="cc4" from="Microsoft" modified="false" />
  92. <para>The constructor initializes the <see cref="T:System.Data.SqlClient.SqlDependency" /> object using the default Service Broker service name and time-out. At some point after construction, you must use the <see cref="M:System.Data.SqlClient.SqlDependency.AddCommandDependency(System.Data.SqlClient.SqlCommand)" /> method to associate one or more commands to this <see cref="T:System.Data.SqlClient.SqlDependency" /> object.</para>
  93. <para>Query notifications are supported only for SELECT statements that meet a list of specific requirements. The following table provides links to the Service Broker and Query Notifications documentation in SQL Server Books Online. </para>
  94. <para>SQL Server Books Online</para>
  95. <list type="bullet">
  96. <item>
  97. <para>
  98. <see cref="http://msdn.microsoft.com/library/ms181122.aspx">Creating a Query for Notification</see>
  99. </para>
  100. </item>
  101. <item>
  102. <para>
  103. <see cref="http://msdn.microsoft.com/library/ms166059.aspx">Security Considerations for Service Broker</see>
  104. </para>
  105. </item>
  106. <item>
  107. <para>
  108. <see cref="http://msdn.microsoft.com/library/bb522911.aspx">Security and Protection (Service Broker)</see>
  109. </para>
  110. </item>
  111. <item>
  112. <para>
  113. <see cref="http://msdn.microsoft.com/library/ms172604.aspx">Security Considerations for Notifications Services</see>
  114. </para>
  115. </item>
  116. <item>
  117. <para>
  118. <see cref="http://msdn.microsoft.com/library/ms188311.aspx">Query Notification Permissions</see>
  119. </para>
  120. </item>
  121. <item>
  122. <para>
  123. <see cref="http://msdn.microsoft.com/library/ms166028.aspx">International Considerations for Service Broker</see>
  124. </para>
  125. </item>
  126. <item>
  127. <para>
  128. <see cref="http://msdn.microsoft.com/library/bb522899.aspx">Solution Design Considerations (Service Broker)</see>
  129. </para>
  130. </item>
  131. <item>
  132. <para>
  133. <see cref="http://msdn.microsoft.com/library/ms166100.aspx">Service Broker Developer InfoCenter</see>
  134. </para>
  135. </item>
  136. <item>
  137. <para>
  138. <see cref="http://msdn.microsoft.com/library/bb522908.aspx">Developer's Guide (Service Broker)</see>
  139. </para>
  140. </item>
  141. </list>
  142. </remarks>
  143. <summary>
  144. <attribution license="cc4" from="Microsoft" modified="false" />
  145. <para>Creates a new instance of the <see cref="T:System.Data.SqlClient.SqlDependency" /> class with the default settings.</para>
  146. </summary>
  147. </Docs>
  148. </Member>
  149. <Member MemberName=".ctor">
  150. <MemberSignature Language="C#" Value="public SqlDependency (System.Data.SqlClient.SqlCommand command);" />
  151. <MemberType>Constructor</MemberType>
  152. <AssemblyInfo>
  153. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  154. </AssemblyInfo>
  155. <Parameters>
  156. <Parameter Name="command" Type="System.Data.SqlClient.SqlCommand" />
  157. </Parameters>
  158. <Docs>
  159. <remarks>
  160. <attribution license="cc4" from="Microsoft" modified="false" />
  161. <para>Internally, this constructor creates an instance of the <see cref="T:System.Data.Sql.SqlNotificationRequest" /> class, and binds it to a <see cref="T:System.Data.SqlClient.SqlCommand" /> object.</para>
  162. <para>Query notifications are supported only for SELECT statements that meet a list of specific requirements. The following table provides links to the Service Broker and Query Notifications documentation in SQL Server Books Online. </para>
  163. <para>SQL Server Books Online</para>
  164. <list type="bullet">
  165. <item>
  166. <para>
  167. <see cref="http://msdn.microsoft.com/library/ms181122.aspx">Creating a Query for Notification</see>
  168. </para>
  169. </item>
  170. <item>
  171. <para>
  172. <see cref="http://msdn.microsoft.com/library/ms166059.aspx">Security Considerations for Service Broker</see>
  173. </para>
  174. </item>
  175. <item>
  176. <para>
  177. <see cref="http://msdn.microsoft.com/library/bb522911.aspx">Security and Protection (Service Broker)</see>
  178. </para>
  179. </item>
  180. <item>
  181. <para>
  182. <see cref="http://msdn.microsoft.com/library/ms172604.aspx">Security Considerations for Notifications Services</see>
  183. </para>
  184. </item>
  185. <item>
  186. <para>
  187. <see cref="http://msdn.microsoft.com/library/ms188311.aspx">Query Notification Permissions</see>
  188. </para>
  189. </item>
  190. <item>
  191. <para>
  192. <see cref="http://msdn.microsoft.com/library/ms166028.aspx">International Considerations for Service Broker</see>
  193. </para>
  194. </item>
  195. <item>
  196. <para>
  197. <see cref="http://msdn.microsoft.com/library/bb522899.aspx">Solution Design Considerations (Service Broker)</see>
  198. </para>
  199. </item>
  200. <item>
  201. <para>
  202. <see cref="http://msdn.microsoft.com/library/ms166100.aspx">Service Broker Developer InfoCenter</see>
  203. </para>
  204. </item>
  205. <item>
  206. <para>
  207. <see cref="http://msdn.microsoft.com/library/bb522908.aspx">Developer's Guide (Service Broker)</see>
  208. </para>
  209. </item>
  210. </list>
  211. </remarks>
  212. <summary>
  213. <attribution license="cc4" from="Microsoft" modified="false" />
  214. <para>Creates a new instance of the <see cref="T:System.Data.SqlClient.SqlDependency" /> class and associates it with the <see cref="T:System.Data.SqlClient.SqlCommand" /> parameter.</para>
  215. </summary>
  216. <param name="command">
  217. <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Data.SqlClient.SqlCommand" /> object to associate with this <see cref="T:System.Data.SqlClient.SqlDependency" /> object. The constructor will set up a <see cref="T:System.Data.Sql.SqlNotificationRequest" /> object and bind it to the command. </param>
  218. </Docs>
  219. </Member>
  220. <Member MemberName=".ctor">
  221. <MemberSignature Language="C#" Value="public SqlDependency (System.Data.SqlClient.SqlCommand command, string options, int timeout);" />
  222. <MemberType>Constructor</MemberType>
  223. <AssemblyInfo>
  224. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  225. </AssemblyInfo>
  226. <Parameters>
  227. <Parameter Name="command" Type="System.Data.SqlClient.SqlCommand" />
  228. <Parameter Name="options" Type="System.String" />
  229. <Parameter Name="timeout" Type="System.Int32" />
  230. </Parameters>
  231. <Docs>
  232. <remarks>
  233. <attribution license="cc4" from="Microsoft" modified="false" />
  234. <para>Query notifications are supported only for SELECT statements that meet a list of specific requirements. The following table provides links to the Service Broker and Query Notifications documentation in SQL Server Books Online. </para>
  235. <para>SQL Server Books Online</para>
  236. <list type="bullet">
  237. <item>
  238. <para>
  239. <see cref="http://msdn.microsoft.com/library/ms181122.aspx">Creating a Query for Notification</see>
  240. </para>
  241. </item>
  242. <item>
  243. <para>
  244. <see cref="http://msdn.microsoft.com/library/ms166059.aspx">Security Considerations for Service Broker</see>
  245. </para>
  246. </item>
  247. <item>
  248. <para>
  249. <see cref="http://msdn.microsoft.com/library/bb522911.aspx">Security and Protection (Service Broker)</see>
  250. </para>
  251. </item>
  252. <item>
  253. <para>
  254. <see cref="http://msdn.microsoft.com/library/ms172604.aspx">Security Considerations for Notifications Services</see>
  255. </para>
  256. </item>
  257. <item>
  258. <para>
  259. <see cref="http://msdn.microsoft.com/library/ms188311.aspx">Query Notification Permissions</see>
  260. </para>
  261. </item>
  262. <item>
  263. <para>
  264. <see cref="http://msdn.microsoft.com/library/ms166028.aspx">International Considerations for Service Broker</see>
  265. </para>
  266. </item>
  267. <item>
  268. <para>
  269. <see cref="http://msdn.microsoft.com/library/bb522899.aspx">Solution Design Considerations (Service Broker)</see>
  270. </para>
  271. </item>
  272. <item>
  273. <para>
  274. <see cref="http://msdn.microsoft.com/library/ms166100.aspx">Service Broker Developer InfoCenter</see>
  275. </para>
  276. </item>
  277. <item>
  278. <para>
  279. <see cref="http://msdn.microsoft.com/library/bb522908.aspx">Developer's Guide (Service Broker)</see>
  280. </para>
  281. </item>
  282. </list>
  283. </remarks>
  284. <summary>
  285. <attribution license="cc4" from="Microsoft" modified="false" />
  286. <para>Creates a new instance of the <see cref="T:System.Data.SqlClient.SqlDependency" /> class, associates it with the <see cref="T:System.Data.SqlClient.SqlCommand" /> parameter, and specifies notification options and a time-out value.</para>
  287. </summary>
  288. <param name="command">
  289. <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Data.SqlClient.SqlCommand" /> object to associate with this <see cref="T:System.Data.SqlClient.SqlDependency" /> object. The constructor sets up a <see cref="T:System.Data.Sql.SqlNotificationRequest" /> object and bind it to the command.</param>
  290. <param name="options">
  291. <attribution license="cc4" from="Microsoft" modified="false" />The notification request options to be used by this dependency. <paramref name="null" /> to use the default service. </param>
  292. <param name="timeout">
  293. <attribution license="cc4" from="Microsoft" modified="false" />The time-out for this notification in seconds. The default is 0, indicating that the server's time-out should be used.</param>
  294. </Docs>
  295. </Member>
  296. <Member MemberName="AddCommandDependency">
  297. <MemberSignature Language="C#" Value="public void AddCommandDependency (System.Data.SqlClient.SqlCommand command);" />
  298. <MemberType>Method</MemberType>
  299. <AssemblyInfo>
  300. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  301. </AssemblyInfo>
  302. <ReturnValue>
  303. <ReturnType>System.Void</ReturnType>
  304. </ReturnValue>
  305. <Parameters>
  306. <Parameter Name="command" Type="System.Data.SqlClient.SqlCommand" />
  307. </Parameters>
  308. <Docs>
  309. <remarks>
  310. <attribution license="cc4" from="Microsoft" modified="false" />
  311. <para>Query notifications are supported only for SELECT statements that meet a list of specific requirements. The following table provides links to the Service Broker and Query Notifications documentation in SQL Server Books Online. </para>
  312. <para>SQL Server Books Online</para>
  313. <list type="bullet">
  314. <item>
  315. <para>
  316. <see cref="http://msdn.microsoft.com/library/ms181122.aspx">Creating a Query for Notification</see>
  317. </para>
  318. </item>
  319. <item>
  320. <para>
  321. <see cref="http://msdn.microsoft.com/library/ms166059.aspx">Security Considerations for Service Broker</see>
  322. </para>
  323. </item>
  324. <item>
  325. <para>
  326. <see cref="http://msdn.microsoft.com/library/bb522911.aspx">Security and Protection (Service Broker)</see>
  327. </para>
  328. </item>
  329. <item>
  330. <para>
  331. <see cref="http://msdn.microsoft.com/library/ms172604.aspx">Security Considerations for Notifications Services</see>
  332. </para>
  333. </item>
  334. <item>
  335. <para>
  336. <see cref="http://msdn.microsoft.com/library/ms188311.aspx">Query Notification Permissions</see>
  337. </para>
  338. </item>
  339. <item>
  340. <para>
  341. <see cref="http://msdn.microsoft.com/library/ms166028.aspx">International Considerations for Service Broker</see>
  342. </para>
  343. </item>
  344. <item>
  345. <para>
  346. <see cref="http://msdn.microsoft.com/library/bb522899.aspx">Solution Design Considerations (Service Broker)</see>
  347. </para>
  348. </item>
  349. <item>
  350. <para>
  351. <see cref="http://msdn.microsoft.com/library/ms166100.aspx">Service Broker Developer InfoCenter</see>
  352. </para>
  353. </item>
  354. <item>
  355. <para>
  356. <see cref="http://msdn.microsoft.com/library/bb522908.aspx">Developer's Guide (Service Broker)</see>
  357. </para>
  358. </item>
  359. </list>
  360. </remarks>
  361. <summary>
  362. <attribution license="cc4" from="Microsoft" modified="false" />
  363. <para>Associates a <see cref="T:System.Data.SqlClient.SqlCommand" /> object with this <see cref="T:System.Data.SqlClient.SqlDependency" /> instance.</para>
  364. </summary>
  365. <param name="command">
  366. <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Data.SqlClient.SqlCommand" /> object containing a statement that is valid for notifications. </param>
  367. </Docs>
  368. </Member>
  369. <Member MemberName="HasChanges">
  370. <MemberSignature Language="C#" Value="public bool HasChanges { get; }" />
  371. <MemberType>Property</MemberType>
  372. <AssemblyInfo>
  373. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  374. </AssemblyInfo>
  375. <ReturnValue>
  376. <ReturnType>System.Boolean</ReturnType>
  377. </ReturnValue>
  378. <Docs>
  379. <value>To be added.</value>
  380. <remarks>
  381. <attribution license="cc4" from="Microsoft" modified="false" />
  382. <para>If you are not using the <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" /> event, you can check the <see cref="P:System.Data.SqlClient.SqlDependency.HasChanges" /> property to determine if the query results have changed.</para>
  383. <para>The <see cref="P:System.Data.SqlClient.SqlDependency.HasChanges" /> property does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate a change event.</para>
  384. </remarks>
  385. <summary>
  386. <attribution license="cc4" from="Microsoft" modified="false" />
  387. <para>Gets a value that indicates whether one of the result sets associated with the dependency has changed.</para>
  388. </summary>
  389. </Docs>
  390. </Member>
  391. <Member MemberName="Id">
  392. <MemberSignature Language="C#" Value="public string Id { get; }" />
  393. <MemberType>Property</MemberType>
  394. <AssemblyInfo>
  395. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  396. </AssemblyInfo>
  397. <ReturnValue>
  398. <ReturnType>System.String</ReturnType>
  399. </ReturnValue>
  400. <Docs>
  401. <value>To be added.</value>
  402. <remarks>
  403. <attribution license="cc4" from="Microsoft" modified="false" />
  404. <para>The <see cref="P:System.Data.SqlClient.SqlDependency.Id" /> property is used to uniquely identify a given <see cref="T:System.Data.SqlClient.SqlDependency" /> instance.</para>
  405. </remarks>
  406. <summary>
  407. <attribution license="cc4" from="Microsoft" modified="false" />
  408. <para>Gets a value that uniquely identifies this instance of the <see cref="T:System.Data.SqlClient.SqlDependency" /> class.</para>
  409. </summary>
  410. </Docs>
  411. </Member>
  412. <Member MemberName="OnChange">
  413. <MemberSignature Language="C#" Value="public event System.Data.SqlClient.OnChangeEventHandler OnChange;" />
  414. <MemberType>Event</MemberType>
  415. <AssemblyInfo>
  416. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  417. </AssemblyInfo>
  418. <ReturnValue>
  419. <ReturnType>System.Data.SqlClient.OnChangeEventHandler</ReturnType>
  420. </ReturnValue>
  421. <Docs>
  422. <remarks>
  423. <attribution license="cc4" from="Microsoft" modified="false" />
  424. <para>
  425. <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" /> occurs when the results for the associated command change. If you are not using <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" />, you can check the <see cref="P:System.Data.SqlClient.SqlDependency.HasChanges" /> property to determine whether the query results have changed.</para>
  426. <para>The <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" /> event does not necessarily imply a change in the data. Other circumstances, such as time-out expired and failure to set the notification request, also generate <see cref="E:System.Data.SqlClient.SqlDependency.OnChange" />.</para>
  427. </remarks>
  428. <summary>
  429. <attribution license="cc4" from="Microsoft" modified="false" />
  430. <para>Occurs when a notification is received for any of the commands associated with this <see cref="T:System.Data.SqlClient.SqlDependency" /> object.</para>
  431. </summary>
  432. </Docs>
  433. </Member>
  434. <Member MemberName="Start">
  435. <MemberSignature Language="C#" Value="public static bool Start (string connectionString);" />
  436. <MemberType>Method</MemberType>
  437. <AssemblyInfo>
  438. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  439. </AssemblyInfo>
  440. <ReturnValue>
  441. <ReturnType>System.Boolean</ReturnType>
  442. </ReturnValue>
  443. <Parameters>
  444. <Parameter Name="connectionString" Type="System.String" />
  445. </Parameters>
  446. <Docs>
  447. <remarks>
  448. <attribution license="cc4" from="Microsoft" modified="false" />
  449. <para>This method starts the listener for the <see cref="T:System.AppDomain" /> for receiving dependency notifications from the instance of ssNoVersion specified by the <paramref name="connectionString" /> parameter. This method may be called more than once with different connection strings for multiple servers.</para>
  450. <para>For additional remarks, see <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" />.</para>
  451. </remarks>
  452. <summary>
  453. <attribution license="cc4" from="Microsoft" modified="false" />
  454. <para>Starts the listener for receiving dependency change notifications from the instance of SQL Server specified by the connection string.</para>
  455. </summary>
  456. <returns>
  457. <attribution license="cc4" from="Microsoft" modified="false" />
  458. <para>true if the listener initialized successfully; false if a compatible listener already exists.</para>
  459. </returns>
  460. <param name="connectionString">
  461. <attribution license="cc4" from="Microsoft" modified="false" />The connection string for the instance of ssNoVersion from which to obtain change notifications.</param>
  462. </Docs>
  463. </Member>
  464. <Member MemberName="Start">
  465. <MemberSignature Language="C#" Value="public static bool Start (string connectionString, string queue);" />
  466. <MemberType>Method</MemberType>
  467. <AssemblyInfo>
  468. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  469. </AssemblyInfo>
  470. <ReturnValue>
  471. <ReturnType>System.Boolean</ReturnType>
  472. </ReturnValue>
  473. <Parameters>
  474. <Parameter Name="connectionString" Type="System.String" />
  475. <Parameter Name="queue" Type="System.String" />
  476. </Parameters>
  477. <Docs>
  478. <remarks>
  479. <attribution license="cc4" from="Microsoft" modified="false" />
  480. <para>This method starts the listener for the <see cref="T:System.AppDomain" /> for receiving dependency notifications from the instance of SQL Server specified by the <paramref name="connectionString" /> parameter. This method may be called more than once with different connection strings for multiple servers.</para>
  481. <para>If no queue name is specified, <see cref="T:System.Data.SqlClient.SqlDependency" /> creates a temporary queue and service in the server that is used for the entire process, even if the process involves more than one <see cref="T:System.AppDomain" />. The queue and service are automatically removed upon application shutdown.</para>
  482. <para>For additional remarks, see <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" />.</para>
  483. </remarks>
  484. <summary>
  485. <attribution license="cc4" from="Microsoft" modified="false" />
  486. <para>Starts the listener for receiving dependency change notifications from the instance of SQL Server specified by the connection string using the specified SQL Server Service Broker queue.</para>
  487. </summary>
  488. <returns>
  489. <attribution license="cc4" from="Microsoft" modified="false" />
  490. <para>true if the listener initialized successfully; false if a compatible listener already exists.</para>
  491. </returns>
  492. <param name="connectionString">
  493. <attribution license="cc4" from="Microsoft" modified="false" />The connection string for the instance of SQL Server from which to obtain change notifications.</param>
  494. <param name="queue">
  495. <attribution license="cc4" from="Microsoft" modified="false" />An existing SQL Server Service Broker queue to be used. If null, the default queue is used.</param>
  496. </Docs>
  497. </Member>
  498. <Member MemberName="Stop">
  499. <MemberSignature Language="C#" Value="public static bool Stop (string connectionString);" />
  500. <MemberType>Method</MemberType>
  501. <AssemblyInfo>
  502. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  503. </AssemblyInfo>
  504. <ReturnValue>
  505. <ReturnType>System.Boolean</ReturnType>
  506. </ReturnValue>
  507. <Parameters>
  508. <Parameter Name="connectionString" Type="System.String" />
  509. </Parameters>
  510. <Docs>
  511. <remarks>
  512. <attribution license="cc4" from="Microsoft" modified="false" />
  513. <para>The <see cref="Overload:System.Data.SqlClient.SqlDependency.Stop" /> method must be called for each <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" /> call. A given listener only shuts down fully when it receives the same number of <see cref="Overload:System.Data.SqlClient.SqlDependency.Stop" /> requests as <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" /> requests.</para>
  514. </remarks>
  515. <summary>
  516. <attribution license="cc4" from="Microsoft" modified="false" />
  517. <para>Stops a listener for a connection specified in a previous <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" /> call.</para>
  518. </summary>
  519. <returns>
  520. <attribution license="cc4" from="Microsoft" modified="false" />
  521. <para>true if the listener was completely stopped; false if the <see cref="T:System.AppDomain" /> was unbound from the listener, but there are is at least one other <see cref="T:System.AppDomain" /> using the same listener.</para>
  522. </returns>
  523. <param name="connectionString">
  524. <attribution license="cc4" from="Microsoft" modified="false" />Connection string for the instance of SQL Server that was used in a previous <see cref="M:System.Data.SqlClient.SqlDependency.Start(System.String)" /> call.</param>
  525. </Docs>
  526. </Member>
  527. <Member MemberName="Stop">
  528. <MemberSignature Language="C#" Value="public static bool Stop (string connectionString, string queue);" />
  529. <MemberType>Method</MemberType>
  530. <AssemblyInfo>
  531. <AssemblyVersion>2.0.0.0</AssemblyVersion>
  532. </AssemblyInfo>
  533. <ReturnValue>
  534. <ReturnType>System.Boolean</ReturnType>
  535. </ReturnValue>
  536. <Parameters>
  537. <Parameter Name="connectionString" Type="System.String" />
  538. <Parameter Name="queue" Type="System.String" />
  539. </Parameters>
  540. <Docs>
  541. <remarks>
  542. <attribution license="cc4" from="Microsoft" modified="false" />
  543. <para>The <see cref="Overload:System.Data.SqlClient.SqlDependency.Stop" /> method must be called for each <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" /> call. A given listener only shuts down fully when it receives the same number of <see cref="Overload:System.Data.SqlClient.SqlDependency.Stop" /> requests as <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" /> requests.</para>
  544. </remarks>
  545. <summary>
  546. <attribution license="cc4" from="Microsoft" modified="false" />
  547. <para>Stops a listener for a connection specified in a previous <see cref="Overload:System.Data.SqlClient.SqlDependency.Start" /> call.</para>
  548. </summary>
  549. <returns>
  550. <attribution license="cc4" from="Microsoft" modified="false" />
  551. <para>true if the listener was completely stopped; false if the <see cref="T:System.AppDomain" /> was unbound from the listener, but there is at least one other <see cref="T:System.AppDomain" /> using the same listener.</para>
  552. </returns>
  553. <param name="connectionString">
  554. <attribution license="cc4" from="Microsoft" modified="false" />Connection string for the instance of SQL Server that was used in a previous <see cref="M:System.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</param>
  555. <param name="queue">
  556. <attribution license="cc4" from="Microsoft" modified="false" />The SQL Server Service Broker queue that was used in a previous <see cref="M:System.Data.SqlClient.SqlDependency.Start(System.String,System.String)" /> call.</param>
  557. </Docs>
  558. </Member>
  559. </Members>
  560. </Type>