Categories
ASP.NET 1.1 Visual Studio 2003

Debug vs Release Build

During implementation stage, what we normally do is we build (or compile) it as usual and then copy and paste the dll file from local to development server for testing.

And after the testing is succesfully, we moved the dll from development server to staging server for testing again and then to production server.

Everything seems fine but one thing I didn’t realize (or easily forget to do) is there is a release build. The difference between the two:

  • debug build consists of debugging information in Microsoft format and no optimization, which means the dll file size is larger.
  • release build does not consist debugging information in Microsoft format but got optimization, which means the dll file size is smaller. Thus, better performance.
  • I tried. Using debug build, my dll file size is 48 KB, while using release build it is just 44 KB. Not big difference, but imagine if you have many dlls, it counts a lot.

    In conclusion, we should use debug build during our local development while release build during implementation.

    Categories
    ASP.NET 1.1 SQL / Stored Procedures VB.NET

    Inline/Dynamic SQL vs Stored Procedures (Just 5 short summarized points)

    After reading some articles and discussions on this topic, my conclusion is:

  • It is a myth to use all inline/dynamic SQL for all the queries in the application.
  • It is a myth to use all Stored Procedure for all the queries in the application.
  • Use Stored Procedure when the query is very complicated, easily will need changes and with many business logics. Reason is easier maintenance. Business logic easily change. Changes in Stored Procedure does not required re-compile of code.
  • Use Stored Procedure when the query will take long time to complete it. Reason is better performance.
  • Other that the two situations above, use inline/dynamic SQL in the code, but it needs to be a parametrized SQL. (classic ASP doesn’t have this but ASP.NET)
  • References

  • http://codebetter.com/blogs/eric.wise/archive/2006/05/24/145393.aspx
  • http://weblogs.asp.net/fbouma/archive/2003/11/18/38178.aspx
  • http://weblogs.asp.net/aaguiar/archive/2006/06/22/Stored-Procs-vs-Dynamic-SQL.aspx
  • http://weblogs.asp.net/fbouma/archive/2003/05/14/7008.aspx
  • http://www.theserverside.net/news/thread.tss?thread_id=31953
  • http://www.codinghorror.com/blog/archives/000292.html
  • http://www.codinghorror.com/blog/archives/000117.html
  • Categories
    ASP.NET 1.1 VB.NET

    Organize your code with Region

    When you have many related functions, you can consider to group them together using Region.

    Example, if you have four functions which are related to Paging, you can just add a region like below (ASP.NET 1.1, VB.NET syntax):

    #Region "Paging"

    Public Property CurrentPage() As Integer
    ' Your code here ...
    End Property

    Private Sub ImgBtnPrevBottom_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImgBtnPrevBottom.Click
    ' Your code here ...
    End Sub

    Private Sub ImgBtnNextBottom_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImgBtnNextBottom.Click
    ' Your code here ...
    End Sub

    Private Sub ItemsGet()
    ' Your code here ...
    End Sub

    #End Region


    Now, go to your Visual Studio 2003. Click Edit > Outlining > Collapse to Definitions, you will see the below:

    Print Screen - Region

    It is very simple to do, yet useful.

    Categories
    SQL / Stored Procedures

    Best interactive website to learn SQL

    Today, my senior recommended me a website to learn sql, http://sqlzoo.net/

    This is much better than famous w3schools and better than other interactive SQL sites like http://sqlcourse2.com/groupby.html and http://www.xlinesoft.com/articles/interactive_sql_tutorial/index.htm.

    The reason is because you can actually type those query yourself to do those exercises and the result will appear on your right side. If the answer is incorrect, it will gently let you know and answer was provided as well. It is very interactive.

    I tried almost all of the tutorial today and learnt much.

    Another thing awesome of this learning site is you can compare all major databases’ syntax as well. Example, What is the syntax to view structure of table?. Default is Oracle. But if you want to view SQL Server, you can just click on SQL Server’s tab.