Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Get ou list
  2. List<string> lst = db.sda(sql).Rows.OfType<DataRow>().Select(dr => dr.Field<string>("txt")).ToList()
  3.  
  4. string OU = string.Empty;
  5. List<string> lst = new List<string>();
  6.  
  7. foreach (string ou in Web.Info.Ldap.ouList)
  8. {
  9. lst.Add("OU=" + ou); // 6th revision .... this works, but wasn't as good as I thought it should be
  10. lst.Add(string.Format("OU={0}", ou)); // 7th revision .... this works as well, but I thought it could be done better, which is why I am here.
  11. }
  12. OU = string.Join(",", lst); // born of 6th revision, used in 7th also
  13.  
  14. DC = string.Join(",", lst);
  15.  
  16. string container = string.Join(",", OU, DC);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement