0
我正在使用SQL DataAdapter(sqlDa),並在點擊checkbox事件時sqlDa應該運行更新命令。VB.Net SQL DataAdapter在第一次運行時不更新
該代碼被調用,但更新事件實際上並沒有觸發,我不確定原因。
我已經通過加強和沒有錯誤, 我已經運行SQL事件探查器,它表明沒有SQL事件發射 本來沒有初始化程序那麼創建一個結合事件上我一起工作的複選框
所以,我有點難倒,需要一些幫助。
我一起工作的代碼是
Public Sub New()
InitializeComponent()
End Sub
Private Sub boundCheckBox_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles boundCheckBox.CheckedChanged
ControlSettingsBindingSource.EndEdit()
Me.ControlSettingsTableAdapter.Update(Me.BoundTestDataSet.controlSettings)
Call diagnosticCheck(boundCheckBox.Checked) ' this is for diagnostic purposes only
End Sub
Public Overloads Overridable Function Update(ByVal dataTable As boundTestDataSet.controlSettingsDataTable) As Integer
Return Me.Adapter.Update(dataTable)
End Function
在初始化這是我與
'boundCheckBox
'
Me.boundCheckBox.AutoSize = True
Me.boundCheckBox.DataBindings.Add(New System.Windows.Forms.Binding("Checked", Me.ControlSettingsBindingSource, "checkBoxSetting", True))
Me.boundCheckBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.boundCheckBox.Location = New System.Drawing.Point(10, 62)
Me.boundCheckBox.Margin = New System.Windows.Forms.Padding(4, 3, 4, 3)
Me.boundCheckBox.Name = "boundCheckBox"
Me.boundCheckBox.Size = New System.Drawing.Size(590, 40)
Me.boundCheckBox.TabIndex = 0
Me.boundCheckBox.Text = "CheckBox Bound To 'checkBoxSetting'"
Me.boundCheckBox.UseVisualStyleBackColor = True
'
任何工作控制和所有幫助非常感謝
西蒙