摘要: 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... 阅读全文
posted @ 2008-01-15 16:52 josephshi 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 16:37 josephshi 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 16:27 josephshi 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 16:26 josephshi 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 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 ... 阅读全文
posted @ 2008-01-15 16:20 josephshi 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 16:14 josephshi 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 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 =... 阅读全文
posted @ 2008-01-15 16:10 josephshi 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 15:59 josephshi 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 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.... 阅读全文
posted @ 2008-01-15 15:52 josephshi 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 15:48 josephshi 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 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 ... 阅读全文
posted @ 2008-01-15 15:44 josephshi 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 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 { ... 阅读全文
posted @ 2008-01-15 15:38 josephshi 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 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: 阅读全文
posted @ 2008-01-15 15:36 josephshi 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2008-01-15 15:34 josephshi 阅读(269) 评论(0) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1using System; 2using System.Data; 3using System.Data.SqlClient; 4using System.Configurat... 阅读全文
posted @ 2008-01-15 10:10 josephshi 阅读(1116) 评论(1) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> This is a message that should always stay visible... 阅读全文
posted @ 2008-01-15 10:07 josephshi 阅读(194) 评论(0) 推荐(0) 编辑