如何清除上一次记录

flyfly2008 2005-06-15 01:30:44
Private Sub txtfgIN_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtfgIN.KeyDown
If e.KeyCode = Keys.Enter Then
address()
cbxaddress.Focus()
cbxaddress.SelectAll()

End If
End Sub

Private Sub address()
dim sql as string
sql="select address from orderaddress"
Dim cmd As New SqlCommand(sql, GtsCn)
Dim readcustomer As SqlDataReader = cmd.ExecuteReader
While readcustomer.Read
Me.cbxaddress.Items.Add(readcustomer(0))
End While
readcustomer.Close()
End Sub

每次敲回车,就出再上次出现的记当和本次的记录和在一起出现,能不能把上次的清空
希望高手指点


...全文
67 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
dingjuntm 2005-06-16
  • 打赏
  • 举报
回复
cbxaddress.item.clear
lihaisf 2005-06-15
  • 打赏
  • 举报
回复
cbxaddress.clear
ferrari1231 2005-06-15
  • 打赏
  • 举报
回复
用clear就可以拉
huangjianyou 2005-06-15
  • 打赏
  • 举报
回复
不明你的意思,如果记录太多就用在拿数据时用where筛选掉就行了。

^_^

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧