

Page.RaisePostBackEvent(NameValueCollection postData) +36 Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 HR_StaffCV_FindADdetails.btnSubmit_Click(Object sender, EventArgs e) in d:\KH-INTRA-DEV3\HR\StaffCV\:25 Must be non-negative and less than the size of the collection. [ArgumentOutOfRangeException: Index was out of range. Line 23: DirectoryEntry dsresult = sresult.GetDirectoryEntry() Please review the stack trace for more information about the error and where it originated in the code.Įxception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.ĭescription: An unhandled exception occurred during the execution of the current web request. I have followed the steps as decribed above. I received the following error message after keying in username and click Submit. LblName.Text = dresult.Properties("displayName").Value.ToString() Session("UserName") = Mid(, 15, nLen)Ĭonnection = ConfigurationManager.ConnectionStrings("ADConnection").ToString()ĭssearch = New (connection)ĭssearch.Filter = "(sAMAccountName=" + Session("UserName") + ")" In the Master page of my site I used this code:ĭim dssearch As ĭim sresult As ĭim dresult As I have found a way to use this to automatically pull user information from the logged in user.


UPDATE ACTIVE DIRECTORY FROM VB NET 2010 SOURCE CODE CODE
Thanks very much for this post! Though your code is C based and I'm working in VB, I was able to piece together this code and get it working in my application.
