G
Guest
Can someone please tell me why I keep getting the following error! And how do
I resolve the problem???
Thanks
System.NullReferenceException: Object reference not set to an instance of an
object.
Dim src As DirectorySearcher = New
DirectorySearcher("(&(objectCategory=Person)(objectClass=user))")
createTable()
src.SearchRoot = de
src.SearchScope = SearchScope.Subtree
For Each res As SearchResult In src.FindAll
Dim topRow As DataRow = ds.Tables("users").NewRow
topRow("Name") = res.Properties("sn")(0)
ds.Tables("users").Rows.Add(topRow)
Next
DataGrid1.DataSource = ds.Tables("users")
DataGrid1.DataBind()
I resolve the problem???
Thanks
System.NullReferenceException: Object reference not set to an instance of an
object.
Dim src As DirectorySearcher = New
DirectorySearcher("(&(objectCategory=Person)(objectClass=user))")
createTable()
src.SearchRoot = de
src.SearchScope = SearchScope.Subtree
For Each res As SearchResult In src.FindAll
Dim topRow As DataRow = ds.Tables("users").NewRow
topRow("Name") = res.Properties("sn")(0)
ds.Tables("users").Rows.Add(topRow)
Next
DataGrid1.DataSource = ds.Tables("users")
DataGrid1.DataBind()