Is it possible in vb.net to bind a control with a data source other than a database? I dought it's possible but I would like to be able to bind text boxes to variables :p
Printable View
Is it possible in vb.net to bind a control with a data source other than a database? I dought it's possible but I would like to be able to bind text boxes to variables :p
You can bind to any object that implements IList or an interface that derives from IList. An example is the Arraylist which you can bind to.
VB Code:
Dim itms() As String = {"Edneeis", "Cander", "MartinLiss", "Serge"} Dim al As New ArrayList(itms) ComboBox1.DataSource = al 'if binding to a class you have to set the property to bind to 'ComboBox1.DisplayMember="MyProperty"
Ah very nice.. thanks Edneeis..