Tuesday, March 23, 2010

WampServer 2.0 Port Configuration

Now that you have WampServer 2.0 installed, you'll want to use it along side with other servers such as IIS. This is easily done by changing the port that WampServer 2.0 listens to. I suggest changing the port from 80 to 81.

Use Notepad or WordPad to open the files below.

  1. Open the httpd.conf file for the Apache server. On my machine, it's located here:

    C:\wamp\bin\apache\apache2.2.6\conf\httpd.conf
    • Do a search for "Listen 80" and replace it with "Listen 81".
    • Save and close the file.

  2. Open the wampmanager.tpl file. On my machine, it's located here:

    C:\wamp\wampmanager.tpl
    • Do a search for "http://localhost/" and replace it with "http://localhost:81/" (There are three total).
    • Do a search for "${w_testPort80}" and replace it with "${w_testPort81}".
    • Save and close the file.

  3. Open the testPort.php file. On my machine, it's located here:

    C:\wamp\scripts\testPort.php
    • Do a search for "80" and replace it with "81" (There are three total).
    • Save and close the file.

  4. Open the english.lang file. On my machine, it's located here:

    C:\wamp\lang\english.lang
    • Do a search for "$w_testPort80 = 'Test Port 80';" and replace it with "$w_testPort81 = 'Test Port 81';".
    • Save and close the file.

  5. Right click on the WampServer icon and click on "Exit".

  6. Restart your WampServer.

Friday, March 12, 2010

SQL Server 2005 - Get Size of Databases

EXEC DATABASE.dbo.sp_spaceused

EXEC DATABASE.dbo.sp_spaceused 'TABLE_NAME'

EXEC DATABASE.dbo.sp_spaceused '?'

Wednesday, February 24, 2010

.NET Framework Value Types and Reference Types

Value Types:
The .NET Framework includes a large number of built-in types that you can use directly or use to build your own custom types.

Value types directly contain their data, offering excellent performance. However, value types are limited to types that store very small pieces of data. In the .NET Framework, all value types are 16 bytes or shorter.

You can create user-defined types that store multiple values and methods. In object-oriented development environments, a large portion of your application logic will be stored in user-defined types.

Enumerations improve code readability by providing symbols for a set of values.

Reference Types:
Reference types contain the address of data rather than the actual data.

When you copy a value type, a second copy of the value is created. When you copy a reference type, only the pointer is copied. Therefore, if you copy a reference type and then modify the copy, both the copy and the original variables are changed.

The .NET Framework includes a large number of built-in reference types that you can use directly or use to build your own custom types.

Strings are immutable; use the StringBuilder class to create a string dynamically.

Use streams to read from and write to files, memory, and the network.

Use the Catch clause within Try blocks to filter exceptions by type. Close and dispose of nonmemory resources in the Finally clause of a Try block.

Friday, February 12, 2010

VS2008 Win Form - Calling Crystal report

Dim objRPT As New rptmatchstats

Dim objfrmRPTViewer As New frmreportviewer

'Note: The form has to be shown first, other wise report parameters are prompted
objfrmRPTViewer.CRPTViewer.Visible = False
objfrmRPTViewer.MdiParent = Me.MdiParent
objfrmRPTViewer.WindowState = FormWindowState.Maximized
objfrmRPTViewer.Show()

objRPT.PrintOptions.PaperSize = CrystalDecisions.[Shared].PaperSize.PaperLetter

oConn.applyLogonInfo(objRPT)

'Set Parameters
oConn.assignParameterValueToReport(objRPT, "@id", 10)

objfrmRPTViewer.CRPTViewer.ReportSource = objRPT

objfrmRPTViewer.CRPTViewer.ParameterFieldInfo.Clear()

objfrmRPTViewer.CRPTViewer.ParameterFieldInfo = objRPT.ParameterFields

objfrmRPTViewer.CRPTViewer.Visible = True