摘要:
Listing 1 – Simple WebForm used for the Test First Name Last Name We will create a database named DummyDB and a table with the n... 阅读全文
摘要:
System.Diagnostics.Stopwatch is a replacement for what most people probably do to identify the time spent on excecuting a method. The process usually goes something like: create a DateTime.Now value a... 阅读全文
摘要:
Method 1. Open .js file in Visual Studio and insert breakpoint at the line you want to debug. Open Attach to Process dialog window (menu item Debug | Attach to Process...) and attach to Internet Explo... 阅读全文
摘要:
Avoid using database-specific tokens with stored procedure parameter names. ADO.NET classes for specific providers include code to adjust parameter names as required. This will ease migration existi... 阅读全文
摘要:
In order to improve Web Site Project build times keep number of files in your /app_code directory small. If you end up having a lot of class files within this directory, move them into separate class ... 阅读全文
摘要:
On-demand web-site compilation mode means that when you edit page and then hit F5 (run with debugging) or Ctrl-F5 (run without debugging) the solution will compile all of the class library projects, t... 阅读全文
摘要:
String concatenation is not a secure approach as clever person can execute unwanted SQL statement by some tricks (SQL injection attack). Use parameters if possible. Bad code: SqlCommand command =... 阅读全文
摘要:
Getting the virtual paths local to server is pretty straight forward most of the time; just use Page.ResolveURL("~/whatever"). But what if you're in the BLL part of your app? Seeing as the Page.Resolv... 阅读全文
摘要:
The Compare method compares strings in a local-aware fashion, so it has to convert the Unicode code of each character into a numeric value that reflects its position in the current culture's alphabet.... 阅读全文
摘要:
You can specify a breakpoint condition which will be evaluated when a breakpoint is reached. The debugger will break only if the condition is satisfied. To specify a condition: In a source window... 阅读全文
摘要:
Take for example of foreach loop, just press 2 tabs after typing "fore"... that's it you got the code snippet as mentioned below: Other useful code snippets are: for - for loop while - for ... 阅读全文
摘要:
If your catch block do nothing with caught exception you may declare block argument without name (to avoid warning message "CS0168: The variable 'ex' is declared but never used"): try { ... 阅读全文
摘要:
How to do this across the entire site: If you would like to apply this behavior to your entire site simply modify the entry of your section in your web.config file like so: 阅读全文
摘要:
Verbatim string literal does not require the use of escape characters to define special characters. Instead, any information in the source code, including new lines, is included in the string. To defi... 阅读全文
摘要:
Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1using System; 2using System.Data; 3using System.Data.SqlClient; 4using System.Configurat... 阅读全文
摘要:
Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> This is a message that should always stay visible... 阅读全文