StanleyGu's Blog
.NET Consultant C# ASP.NET SQL Server Silverlight
-
Solution 6 : Kill a Non-Clustered Process during Two-Node Cluster Failover
Using Visual Studio 2008 and C#, I developed a windows service A and deployed it to two nodes of a windows server 2008 failover cluster. The service A is part of the failover cluster service, which means, when failover occurs at node1, the cluster service will failover the windows service A from node 1 to node 2.
-
Tip 16 : Open Multiple Documents within Single Application Instance Using C#
1. Using Microsoft Word 2007 as an example, you can open test1.docx and test2.docx at same time. The two documents are opened within single instance of the word application. World application supports command line argument of passing multiple documents.
-
Tip 15 : Deploy ASP.NET 3.5 Application to Windows Server 2008 R2 and IIS 7.5
You have ASP.NET 3.5 web application deployed to windows server 2008 R2 and IIS7.5. The physical location of the application is C:\MyWeb. You receive errors when you use IIS Manager to browse the application. The following is the check list that can help you prevent the errors from occurring.
-
Tip 14 : Solve SmtpClient issues of delayed email and high CPU usage
1. It is quite straightforward using SmtpClient class to send out an email
-
Tip 13 : Kill a process using C#, from local to remote
1. My first choice is always to try System.Diagnostics to kill a process
-
Tip 12 : Common T-SQL Escape Scenarios: Percent (%), Underscore (_)
Scenario 1 : You have a Purchase table with field named DiscountRate. The DiscountRate values can be true percentage such as "2.5%", "5.0%", or can be other values such as "N/A", "Fixed Rate", etc. You want all the records with true percentage.
-
Tip 11 : Group By Date for DateTime Type Field
You have a Purchase table with fields of ID, PurchaseAmount and PurchaseDate. The PurchaseDate field is DateTime type that includes Date and Time information. You want daily total purchase amount.
-
Architect 3 : Building Data Access Layer Using Microsoft Enterprise Library 4.1
You have a Customer table with three fields: ID, LastName and FirstName. You are building a data access layer to retrieve all the records from the Customer table and return the result as a collection of Customer objects. You want implement it using Microsoft Enterprise Library.
-
Solution 5 : Implementing Optional Parameters in T-SQL Stored Procedures
You have a stored procedure GetCustomers with two parameters: LastName, FirstName. The stored procedure returns all the records matching the values of the parameters. You want the parameters be optional, which means skipping the parameter if you do not pass a value.
-
Tip 10 : Returning the first part of a string with delimiter
You have a string delimited by underscore such as 1stPart_2ndPart_3rdPart and want to return the first part of the string only.