|

Get latest date record - SQL query

To return the latest record (one record only) from data base table where one of the fields is in Date/Time format:SELECT TOP 1 * FROM table_name ORDER BY date_time_column_name DESCNotes:* for ORACLE instead of TOP 1,  ROWNUM shall be used* the query may return NULL value - suitable exception handling must be providedProgramming in C# using data binding and data viewDataView dv = new DataView(DataSet_name.table_name);string sort = "Date_column_name DESC";dv.Sort = sort;DateTime rdt;if (dv.Count > 0) rdt = Convert.ToDateTime(dv[0]["Date_column_name"]);Do not forget to fill the corresponding table adapters before creating data view.TableAdapter.Fill(DataSet_name.table_nam

| |

C# Is the Logged User a member of specific Windows Domain Group?

C# code:using System.DirectoryServices.AccountManagement;string userName = SystemInformation.UserName; string UDN = SystemInformation.UserDomainName;string domainUser = UDN + "\\" + userName;PrincipalContext pc = new PrincipalContext(ContextType.Domain);UserPrincipal user = UserPrincipal.FindByIdentity(pc, IdentityType.SamAccountName, domainUser);GroupPrincipal group = GroupPrincipal.FindByIdentity(pc, "Domain_Group_Name");bool is_member = user.IsMemberOf(group);

| |

C# How to Modify DataSet Connection Strings at Runtime?

Detailed instructions by Paul Keister in his excellent articleAdaptive Connection Strings for Windows Forms Applicationsin briefthe connection string property is set read only in the Settings.Designer.cs class:public string MyAppConnectionString { get { return ((string)(this["MyAppConnectionString"])); } }However, all application settings are accessible in read/write mode by using the indexer directly.  The following code demonstrates how to modify the connection string using this approach://change the application connection stringProperties.Settings.Default["MyAppConnectionString"] = strCnString;//debug:verify that this really did work Console.WriteLine(Properties.Settin

|

Anti virus scanning exclusion lists

General Exclusions for All Windows PlatformsPagefile.sys*.pst%systemroot%\System32\Spool (replace %systemroot% with actual directory)%systemroot%\SoftwareDistribution\Datastore (replace %systemroot% with actual directory)%allusersprofile%\NTUser.pol%systemroot%\system32\GroupPolicy\registry.polMicrosoft Active Directory Domain Controller: \ WINNT \ SYSVOL: \ WINNT \ NTDS: \ WINNT \ ntfrs: \ WINNT \ system32 \ dhcp: \ WINNT \ system32 \ dnsMicrosoft IIS ServerWeb Server log files should be excluded from scanning. By default, IIS logs are saved in: \ WINNT \ system32 \ LogFiles: \ WINNT \ system32 \ IIS Temporary Compressed FilesMicrosoft SQL ServerBecause scanning may hinder performance, larg

|

Number of virtual processors in Hyper-V Guest Operating Systems

Article on Microsoft Tech Net with the latest information for the supported number of virtual processors and integration services when running different guest operating systems (virtual machines) on Windows Server 2008 R2 Hyper-vhttp://technet.microsoft.com/en-us/library/cc794868(WS.10).aspxQuick dataWindows Server 2008 (all versions, including R2 and SP1) - 1,2,3 or 4 Virtual processors (vCPU)Windows Server 2003 (all versions, inluding R2) - 1 or 2 virtual processorsWindows 2000 Server with Service Pack 4 - only one (1) virtual processorWindows 7 all versions including SP1 - 1,2,3 or 4 virtual processorsWindows Vista - 1 or 2 vCPUsWindows XP SP3 - 1 or 2 vCPUsWindows XP SP2 - 1 vCPU on

|

Hyper-Threading and Virtualization

To enable or to disable hyper-threading on virtualization hosts?There are many articles, documents and discussions in Internet and there is no definitive answer about the hyper-threading usage in virtualized environment.About Hyper-ThreadingA processor architecture feature that allows a single processor to execute multiple independent threads simultaneously. Hyper-threading was added to Intel's Xeon and Pentium® 4 processors. Intel uses the term “package” to refer to the entire chip, and “logical processor” to refer to each hardware thread. Also called symmetric multithreading (SMT).To me the following HP document gives most complete description and recomendations to help taking th

|

Implementing RemoteFX on HP ProLiant

Quick check list and brief instructions on hyper-V RemoteFX set upRemoteFX requirement:Processors must support Second-Level Address Translation (SLAT). Intel-based processors, Extended Page Tables (EPT) == SLAT. AMD-based processors, Nested Page Tables (NPT) == SLAT.At least one