typed bindingsource?

thejeraldo

Well-known member
Joined
Jun 9, 2009
Messages
70
Location
Philippines
Programming Experience
1-3
is there such thing as a typed binding source. a binding source is generated through wizard and i wonder how is it done if we just type them. i dont use wizards but i need to put data into a databound treeview. the treeview has this properties: datasource, datamembers, groupingmembers and valuemember. how do i set this by typing a code? thanks.
 
is there such thing as a typed binding source. a binding source is generated through wizard and i wonder how is it done if we just type them.
No, it is just a regular BindingSource component that has the properties Name, DataSource and DataMember set. You can do the same by adding a BS to form and set the same properties in Designer, or in code if need be.
 
thanks for the response johnH. but here is what i kinda mean:

VB.NET:
con.ConnectionString = "Provider=SQLNCLI;Server=mycom\SQLEXPRESS;Database=mydb;Initial Catalog=mydb;Integrated Security=SSPI;"
con.Open()

sql = "SELECT * FROM tblusers"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "users") 'Fill the DataSet

now what i want to know is. if i put a bindingsource control from the toolbox then what should i put in the datasource? thanks.

will it be:
bindingsource1.datasource = da '??? here is what i dont know what to put in.. thanks.
 
oh well i got it now.. i set it like this
BindingSource1.DataSource = ds.Tables("users")
and the data appeared on my treeview. just one thing to ask. i can view data in my treeview. but how come i can only set 1 displaymember and cant set a value member??
 

Latest posts

Back
Top