Hi, I am trying to do this using C#:
but it is giving an error saying: "The best overloaded method match for 'System.Web.UI.WebControls.ListItem.ListItem(string, string)' has some invalid arguments"
I have also tried:
but it says: "cannot convert type object to string"
I retrieved the object type using GetType() and it says it is a System.String!!!
Any ideas why this is not working???
Code:
myDropDownList.Items.Add(new ListItem(res.Properties["Name"][0],res.Properties["samaccountname"][0]));
but it is giving an error saying: "The best overloaded method match for 'System.Web.UI.WebControls.ListItem.ListItem(string, string)' has some invalid arguments"
I have also tried:
Code:
string a = res.Properties["Name"][0];
but it says: "cannot convert type object to string"
I retrieved the object type using GetType() and it says it is a System.String!!!
Any ideas why this is not working???