{"id":66,"date":"2007-07-26T07:12:17","date_gmt":"2007-07-26T07:12:17","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?page_id=66"},"modified":"2007-07-26T07:25:16","modified_gmt":"2007-07-26T07:25:16","slug":"miisapp-pendingexportsvb","status":"publish","type":"page","link":"https:\/\/www.wapshere.com\/missmiis\/code-snippets\/miisapp-pendingexportsvb","title":{"rendered":"MiisApp: PendingExports.vb"},"content":{"rendered":"<p>Imports System.Data.SqlClient<\/p>\n<p>Public Class PendingExports<br \/>\nInherits System.Windows.Forms.Form<\/p>\n<p>Public MA As String<\/p>\n<p>Const DISABLES = &#8220;jobRunnerDISABLES&#8221;<br \/>\nConst DB_CONNECTION_STRING As String = &#8220;Database=MIISData;Data Source=MIISSERVER;Integrated Security=TRUE;;&#8221;<br \/>\nConst MIISDB_CONNECTION_STRING As String = &#8220;Database=MicrosoftIdentityIntegrationServer;Data Source=MIISSERVER;Integrated Security=TRUE;;&#8221;<br \/>\nDim sqlQueryConnection As New SqlConnection(DB_CONNECTION_STRING)<br \/>\nDim sqlMIISConnection As New SqlConnection(MIISDB_CONNECTION_STRING)<\/p>\n<p>#Region &#8221; Windows Form Designer generated code &#8221;<\/p>\n<p>Public Sub New()<br \/>\n\u00c2\u00a0 MyBase.New()<\/p>\n<p>&#8216;This call is required by the Windows Form Designer.<br \/>\n\u00c2\u00a0 InitializeComponent()<\/p>\n<p>&#8216;Add any initialization after the InitializeComponent() call<\/p>\n<p>End Sub<\/p>\n<p>&#8216;Form overrides dispose to clean up the component list.<br \/>\n\u00c2\u00a0 Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br \/>\n\u00c2\u00a0 If disposing Then<br \/>\n\u00c2\u00a0 If Not (components Is Nothing) Then<br \/>\n\u00c2\u00a0 components.Dispose()<br \/>\n\u00c2\u00a0 End If<br \/>\n\u00c2\u00a0 End If<br \/>\n\u00c2\u00a0 MyBase.Dispose(disposing)<br \/>\n\u00c2\u00a0 End Sub<\/p>\n<p>&#8216;Required by the Windows Form Designer<br \/>\n\u00c2\u00a0 Private components As System.ComponentModel.IContainer<\/p>\n<p>&#8216;NOTE: The following procedure is required by the Windows Form Designer<br \/>\n\u00c2\u00a0 &#8216;It can be modified using the Windows Form Designer.<br \/>\n\u00c2\u00a0 &#8216;Do not modify it using the code editor.<br \/>\n\u00c2\u00a0 Friend WithEvents Txt_PendingExports As System.Windows.Forms.TextBox<br \/>\n\u00c2\u00a0 <system.diagnostics.debuggerstepthrough()><\/system.diagnostics.debuggerstepthrough()>Private Sub InitializeComponent()<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports = New System.Windows.Forms.TextBox<br \/>\n\u00c2\u00a0 Me.SuspendLayout()<br \/>\n\u00c2\u00a0 &#8216;<br \/>\n\u00c2\u00a0 &#8216;Txt_PendingExports<br \/>\n\u00c2\u00a0 &#8216;<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.Location = New System.Drawing.Point(0, 0)<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.Multiline = True<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.Name = &#8220;Txt_PendingExports&#8221;<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.ReadOnly = True<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.ScrollBars = System.Windows.Forms.ScrollBars.Vertical<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.Size = New System.Drawing.Size(296, 272)<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.TabIndex = 0<br \/>\n\u00c2\u00a0 Me.Txt_PendingExports.Text = &#8220;&#8221;<br \/>\n\u00c2\u00a0 &#8216;<br \/>\n\u00c2\u00a0 &#8216;PendingExports<br \/>\n\u00c2\u00a0 &#8216;<br \/>\n\u00c2\u00a0 Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)<br \/>\n\u00c2\u00a0 Me.ClientSize = New System.Drawing.Size(292, 273)<br \/>\n\u00c2\u00a0 Me.Controls.Add(Me.Txt_PendingExports)<br \/>\n\u00c2\u00a0 Me.Name = &#8220;PendingExports&#8221;<br \/>\n\u00c2\u00a0 Me.Text = &#8220;Pending Exports&#8221;<br \/>\n\u00c2\u00a0 Me.ResumeLayout(False)<\/p>\n<p>End Sub<\/p>\n<p>#End Region<\/p>\n<p>Private Sub PendingExports_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br \/>\nDisplayPendingExports(MA)<br \/>\nEnd Sub<\/p>\n<p>Public Sub DisplayPendingExports(ByVal MA As String)<br \/>\nDim sqlqueryString As String<br \/>\nDim rowReader As SqlDataReader<br \/>\nsqlMIISConnection.Open()<\/p>\n<p>&#8216;ADD<br \/>\nsqlqueryString = &#8220;select rdn from dbo.mms_connectorspace cs &#8221; &amp; _<br \/>\n&#8220;join dbo.mms_management_agent ma &#8221; &amp; _<br \/>\n&#8220;on cs.ma_id=ma.ma_id &#8221; &amp; _<br \/>\n&#8220;where ma.ma_name='&#8221; &amp; MA &amp; &#8220;&#8216; and cs.export_operation = 1&#8221;<\/p>\n<p>Dim sqlAddQuery As New SqlCommand(sqlqueryString, sqlMIISConnection)<br \/>\nrowReader = sqlAddQuery.ExecuteReader<br \/>\nWhile rowReader.Read()<br \/>\nMe.Txt_PendingExports.AppendText(&#8220;add &#8221; &amp; rowReader.GetString(0) &amp; vbCrLf)<br \/>\nEnd While<br \/>\nrowReader.Close()<\/p>\n<p>&#8216;UPDATE<br \/>\nsqlqueryString = &#8220;select rdn from dbo.mms_connectorspace cs &#8221; &amp; _<br \/>\n&#8220;join dbo.mms_management_agent ma &#8221; &amp; _<br \/>\n&#8220;on cs.ma_id=ma.ma_id &#8221; &amp; _<br \/>\n&#8220;where ma.ma_name='&#8221; &amp; MA &amp; &#8220;&#8216; and cs.export_operation = 2&#8221;<\/p>\n<p>Dim sqlUpdateQuery As New SqlCommand(sqlqueryString, sqlMIISConnection)<br \/>\nrowReader = sqlUpdateQuery.ExecuteReader<br \/>\nWhile rowReader.Read()<br \/>\nMe.Txt_PendingExports.AppendText(&#8220;update &#8221; &amp; rowReader.GetString(0) &amp; vbCrLf)<br \/>\nEnd While<br \/>\nrowReader.Close()<\/p>\n<p>&#8216;DELETE<br \/>\nsqlqueryString = &#8220;select rdn from dbo.mms_connectorspace cs &#8221; &amp; _<br \/>\n&#8220;join dbo.mms_management_agent ma &#8221; &amp; _<br \/>\n&#8220;on cs.ma_id=ma.ma_id &#8221; &amp; _<br \/>\n&#8220;where ma.ma_name='&#8221; &amp; MA &amp; &#8220;&#8216; and cs.export_operation = 4&#8221;<\/p>\n<p>Dim sqlDeleteQuery As New SqlCommand(sqlqueryString, sqlMIISConnection)<br \/>\nrowReader = sqlDeleteQuery.ExecuteReader<br \/>\nWhile rowReader.Read()<br \/>\nMe.Txt_PendingExports.AppendText(&#8220;delete &#8221; &amp; rowReader.GetString(0) &amp; vbCrLf)<br \/>\nEnd While<br \/>\nrowReader.Close()<\/p>\n<p>sqlMIISConnection.Close()<br \/>\nEnd Sub<\/p>\n<p>End Class<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imports System.Data.SqlClient Public Class PendingExports Inherits System.Windows.Forms.Form Public MA As String Const DISABLES = &#8220;jobRunnerDISABLES&#8221; Const DB_CONNECTION_STRING As String = &#8220;Database=MIISData;Data Source=MIISSERVER;Integrated Security=TRUE;;&#8221; Const MIISDB_CONNECTION_STRING As String = &#8220;Database=MicrosoftIdentityIntegrationServer;Data Source=MIISSERVER;Integrated Security=TRUE;;&#8221; Dim sqlQueryConnection As New SqlConnection(DB_CONNECTION_STRING) Dim sqlMIISConnection As New SqlConnection(MIISDB_CONNECTION_STRING) #Region &#8221; Windows Form Designer generated code &#8221; Public Sub New() \u00c2\u00a0 MyBase.New() &#8216;This&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":30,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-66","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/Pkp1o-14","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":0,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages\/66\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/pages\/30"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}