WCF POX, JSON and SOAP Coexist
Sometimes, we want to make a service available in different protocols so that clients could have an option to choose one of their favorite methods to consume the web services. Here we are going to talk about how to make one WCF service available in POX(Plain Old XML as XML for short), JSON and SOAP [...]
Windows Firewall opens a range of ports for Passive FTP server
Windows Firewall opens a range of ports for Passive FTP server, you can not add a range on the UI easily, but you can do it in the command line like below. Run the command in the command prompt, e.g. high port range is from 41000 to 41100 FOR /L %P IN (41000,1,41100) DO netsh [...]
SQL server 2008 SP1 Restart computer checks failed
I was trying to install Biztalk server 2010 beta which requires SQL server 2008 SP1. At beginning of installing SQL server 2008 SP1, it says Restart computer required. It looks something has not been reset or cleared properly. After searching around, I realised that this could be caused by that some pending operations hasn’t been [...]
VirtualPathProvider not working for static files under IIS 6
If you have come across embedding the css, javascript and aspx into a separate dll as resources and the website will resolve them by read out from resources by using the custom VirtualPathProvider. One of the ASP.NET plugin architectures used this method and it works quite well. During the development with visual studio built-in development server, everything [...]
HTML generations, the way of the future web development.
1991 HTML 1994 HTML 2 1996 CSS 1 + JavaScript 1997 HTML 4 1998 CSS 2 2000 XHTML 1 2002 Tableless Web Design 2005 AJAX 2009 HTML 5 Some highlights from google Chrom HTML , (yes only some points). Some of them were actually presented in google gears. Web SQL Database You can create tables and CRUD the data. Web Worker Multiple threaded [...]
system.web HttpContextBase can not be found
Not only you need to reference System.Web but also reference System.Web.Abstractions
iphone xcode: keyboard can not be dismissed
Firstly, have you saved the interface builder explicitely after making changes for UITextFeild connection? Secondly, check if you have set the delegate of e.g. UITextField’s delegate attribute to the class containing the implementation of UITextFieldDelegate protocol. which will look like – (BOOL)textFieldShouldReturn:(UITextField *)theTextField { if (theTextField == textField) { [...]
Random scripts
SQL transaction try catch template BEGIN TRY BEGIN TRAN – sql goes here COMMIT END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity ,ERROR_STATE() AS ErrorState ,ERROR_PROCEDURE() AS ErrorProcedure ,ERROR_LINE() AS ErrorLine ,ERROR_MESSAGE() AS ErrorMessage ROLLBACK END CATCH Very nice blog around WCF security http://www.leastprivilege.com Search object name within SQL database SELECT name [...]
MSSQL : List all tables with size and row count
It comes to be very handy while analyzing the database tables. Here is a quick and dirty script lists all the tables and their rows counts, data size. DECLARE @table table(Id int IDENTITY(1,1) , Name varchar(256)) INSERT INTO @table SELECT b.name + ‘.’+ a.name FROM sys.tables a INNER JOIN sys.schemas b ON a.schema_id = b.schema_id [...]
A simplest/dumbest CSharp IDE
The tiny WPF app (14k) has a textbox allows the input of the C# code, it compiles the code and execute the code after press F5 key. Here is what it looks like. No surprise. The main part which compiles the code at runtime is using CSharpCodeProvider from Microsoft.CSharp namespace. static CompilerResults Build(string code, IEnumerable<string> [...]
VS 2008 Project: Group/nest source code files
Like windows form project, the design code and source code are grouped together for the ease of code management. You can group any related files in to one expendable tree view. Before grouping After grouping That’s pretty handy aye! Unfortunately, there is no UI to do this. The only way I’ve found is to modify [...]
C# Find All Derived Types From Assembly
I was always wondering if there is any method to find all derived types for the given type within an assembly. It would be handy to just pass either a class or an interface type and it will return me all its subs. I’ve come out with a method does that. It finds all the [...]
