Posts

Showing posts from January, 2012

Fetching logins from various sources - Active Directory, WIndows local logins and SQL Logins

Image
At times there is need to get the list of logins from active directory, windows local logins or sql logins.Microsoft has done very good job of providing namespaces to fetch login info from various sources.Small example attached shows you how to use the namespace and gives some insight about the namespace, hope this helps someone out there.

Active Directory Users:


Windows Logins:

SQL logins:

Private Sub GetUser(ByVal sr As SearchResult, ByVal d As Domain, ByVal domainName As String, ByRef groupMembers As SortedList(Of String, CustomLoginNode))

If sr.Properties(LDAP_PROPERTY_USER_NAME) Is Nothing Then Return

Dim adn As New CustomLoginNode
Dim Searcher As DirectorySearcher
Dim Result As SearchResult
Dim UserEntry As DirectoryEntry

If sr.Properties(LDAP_PROPERTY_USER_NAME) IsNot Nothing Then
''this doamin name is PME , d.name = pme.local
adn.DomainName = domainName
adn.UserName = sr.Properties(LDAP_PROPERTY_USER_NAME)(0).ToString()
adn.UserNameWithDomainName = adn.DomainName + &qu…

Crystal Report Build Errors in Visual Studio

If a machine has two versions of Crystal reports installed, visual studio somehow sometimes picks the older version and you endup with the following errors.

error BC30456: 'ReuseParameterValuesOnRefresh' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'.

error BC30456: 'ShowParameterPanelButton' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'.

error BC30455: Argument not specified for parameter 'endPageN' of 'Public Overridable Sub PrintToPrinter(nCopies As Integer, collated As Boolean, startPageN As Integer, endPageN As Integer)'.

error BC30311: Value of type 'System.Drawing.Printing.PrinterSettings' cannot be converted to 'Integer'.

error BC30311: Value of type 'System.Drawing.Printing.PageSettings' cannot be converted to 'Boolean'.

error BC30455: Argument not specified for parameter 'endPageN' of 'Public Overridable Sub PrintToPrinter(nCopies As…