Guys i want to populate a tree list view with nodes using the data from my database table (sql server) by looping it can anybody can give some idea. I don’t know where to start my coding.
im using this code to get data and connect to the database. and the treelist view is at the winform.
SqlConnection cn = new SqlConnection();
SqlCommand cmd4 = new SqlCommand();
con.OpenConnections();
cmd4.Connection = cn;
cmd4.CommandType = CommandType.Text;
cn.ConnectionString = con.connections1;
cmd4.CommandText = "Select cmodname from modules";
don’t know what to use next. reader or datatable?
Should be something like this:
You need to make checks for null’s and stuff you don’t want to appear.