你有什麽方法讀出來得,就用什麽.databind(),之前先清空一下,就搞定了
Private Sub FindFormInit()
Adodc1.ConnectionString = connstring
'combo1设置-----------------------------------
strsql = "select 略。。。。"
Adodc1.RecordSource = strsql
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
Combo1(0).AddItem Adodc1.Recordset.Fields(0)
Combo1(12).AddItem Adodc1.Recordset.Fields(0)
Adodc1.Recordset.MoveNext
Loop
Else
' MsgBox "", vbCritical
End If
(中间还有很多。。省略了吧。。。)
strsql = "select 略。。。"
Adodc1.RecordSource = strsql
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
Combo1(1).AddItem Adodc1.Recordset.Fields(0)
Combo1(13).AddItem Adodc1.Recordset.Fields(0)
Adodc1.Recordset.MoveNext
Loop
Else
' MsgBox "", vbCritical
Exit sub
End If
End sub
'添加按钮设置-----------------------------------
Adodc1.ConnectionString = connstring
strsql = "SELECT 略。。。"
Adodc1.RecordSource = strsql
Adodc1.Refresh
Adodc1.Recordset.AddNew
For i = 0 To 10
Adodc1.Recordset.Fields(i) = Text1(i).Text
Next i
Adodc1.Recordset.Update
'我是这样更新的:(其实就是把下拉菜单代码又写了一遍。。。OTZ......)
Adodc1.ConnectionString = connstring
strsql = "select 略。。。"
Adodc1.RecordSource = strsql
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
Combo1(0).AddItem Adodc1.Recordset.Fields(0)
Combo1(12).AddItem Adodc1.Recordset.Fields(0)
Adodc1.Recordset.MoveNext
Loop
Else
' MsgBox "", vbCritical
End If
'后面的。。。略了吧。。。
End sub
有combo1.clear吗?
啊,大哥。。原来是这样的啊,可以了。。。没有出现n多个相同dd了。。。。
我~~~爱你~~~~啊~~~~~~~~~
出现重复可能是你form_load ()里没有判断
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
coon = New OleDbConnection(ConfigurationSettings.AppSettings("DSN"))
If Not IsPostBack Then
Call binddata()
End If
End Sub
然后进行绑定就OK了