listBox 怎么帮定数据?
listBox 怎么帮定数据?
请据体给个详细代码可以吗?
先谢谢了~
[解决办法]
Public Shared Function HtmlSelectBind(ByVal hs As HtmlSelect, ByVal dt As DataTable, ByVal st As String, ByVal sv As String)
hs.DataSource = dt.DefaultView
hs.DataTextField = st
hs.DataValueField = sv
Try
hs.DataBind()
Return 1
Catch ex As Exception
Return 0
End Try
End Function
End Class
然后绑定时候直接调用这方法
[解决办法]
listbox1.DataBindings.Add(dr( "id "))