您好,我在Visual Studio 2013中有一个数据库管理程序,我想使用一个组合框作为交换机来加载一个数据库或另一个根据决定......我设法做了切换但是我有从VS 2013编辑数据库时出现的几个问题:
以下是编辑添加和删除按钮的代码,我缺少什么?
=write growth * -//depot/new_team/.../*.c
以下是我在组合框中进行切换的方法:
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
If ComboBox1.SelectedIndex = -1 Then
MsgBox("Please specify a category first.", MsgBoxStyle.Information)
ComboBox1.Focus()
End If
Me.Validate()
Me.ContactsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Database_de_EmpleadosDataSet)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'category err
If ComboBox1.SelectedIndex = -1 Then
MsgBox("Please specify a category first.", MsgBoxStyle.Information)
ComboBox1.Focus()
End If
'codes for add a new field
ContactsBindingSource.AddNew()
'ContactsBindingSource1.AddNew()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'code for err category
If ComboBox1.SelectedIndex = -1 Then
MsgBox("Please specify a category first.", MsgBoxStyle.Information)
ComboBox1.Focus()
End If
'code for removing field/row
ContactsBindingSource.RemoveCurrent()
ContactsBindingSource1.RemoveCurrent()
End Sub
我错过了什么? :S