Wei Keong's profileDoubliewkayBlogLists Tools Help

Blog


    June 01

    .NET application cannot connect to a remote SQL Server 2008?

    Having some problems connecting .NET Windows application or Web application to a remote SQL Server 2008 on a Windows Server 2008?
    Here are some troubleshooting guides:
    1. Run SQL Server Configuration Manager. Expand SQL Server Network Configuration and select Protocols for MSSQLSERVER. Make sure Named Pipes and TCP/IP are enabled.
    2. Run Windows Firewall. Click on "Allow a program through Windows Firewall". Check if port 1433 is allowed. If not, then click on "Add port...". Add the following details; Name = Port 1433 - SQL Server 2008, Port = 1433, Protocol = TCP.
    3. If you are also accessing SQL Server Reporting Services reports, check if port 80 is allowed. If not, then click on "Add port...". Add the following details; Name = Port 80 - HTTP, Port = 80, Protocol = TCP.

    Cannot install Hyper-V Integration Services?

    First, check the Device Manager of the Hyper-V virtual machine.
    Is there any warning or problems with the Virtual Machine Bus?

    Basically, the HAL detection when Integration Services Installed is not working properly
    So here are the steps to resolve it.
    1) run msconfig
    2) go into Advanced Boot options
    3.) Click Detect HAL
    4) Reboot
     
    Check the Device Manager again. The Virtual Machine Bus device should be resolved.
    Finally, install the Hyper-V Integration Services.

    Install Loopback Adapter in Windows 7

    Are you having problem adding a Loopback Adapter in Windows 7?
    The "Add a device" can't find any suitable hardware?
     
    1) Type "hdwwiz.exe" in the Run command.
    2) Click Next.
    3) Then select the "Advanced" option.
    4) Select "Network Adapter".
    5) Choose "Microsoft" and "Microsoft Loopback Adapter"
     
    And you have just installed the adapter.

    Cannot ping a Windows Server 2008?

    If you are unable to ping a freshly built Windows Server 2008, though you confirmed the IP address of the server.
    The reason is because by default, the Windows Server 2008 Firewall is configured to disallow the "File and Printer Sharing" feature.
    Hence, this blocks the ICMP Echo Request packets used by the PING command.
     
    Enabling the "File and Printer Sharing" in the Windows Server 2008 Firewall, will enable you to ping the server from remote machines.
     
    May 17

    Changing the location of OST file - Outlook 2007

    Recently, I received a new replacement laptop from Dell (Latitude D620 to Latitude E6400).
    So this time, I was setting up dual boot with Windows 2008 R2 RC and Windows 7 RC (both are x64 OS).
     
    And I wanted to have a localised OST file to be shared between the two OS. You can easily do that with PST files, but OST file is a bit tricky.
    OST file is basically a local Offline Folders file (.ost) when you work offline with Outlook or use Cached Exchange Mode with Microsoft Exchange Server.
    The offline folder file has an .ost extension.
     

    To change the location of the offline files are saved:

    1. Make sure you have Exited Outlook.
    2. Click Start, and then click Control Panel.
    3. Double-click Mail, and then click E-mail Accounts.
    4. Click View or change existing e-mail accounts, and then click Next.
    5. Select the Microsoft Exchange Server account, and then click Change.
    6. Clear the Use Cached Exchange Mode check box.
    7. Click More Settings.
    8. Click the Advanced tab.
    9. Click Offline Folder File Settings.
    10. Click Disable Offline Use, and then click Yes in the dialog box that appears.
    11. Click Offline Folder File Settings.
    12. Click Browse, go to the location where you want to save your .ost file, and then click Open.
    13. Click OK.
    14. Select the Use Cached Exchange Mode check box.
    15. Click Next, and then click Finish.
    April 17

    P1 W1MAX speed at Kota Kemuning!!!

    I recently subscribed to the P1 W1MAX Wiggy plan.
    And pretty happy with the speed at 6 Mbps.
     
     
    March 16

    Snorkelling + Photography

    We went to Redang Island from the 6-8 March 2009 for a brief getaway. 
    For this particular trip, I bought the DiCAPac DSLRpack.
     
    Here are some of the underwater photos using the pack.
     
    March 15

    Microsoft Future Pro Photographer Contest

    The Microsoft Future Pro Photographers Photography Contest is the most lucrative contest of its kind and provides a unique opportunity for college and university student photographers from around the world to showcase their artistic talent and photographic style.

    Microsoft is committed to carrying the art of digital photography forward by encouraging new and emerging talent at the student level to learn, utilize, and implement state-of-the-art equipment, software, and techniques to produce the finest images possible.
    http://prophoto.microsoft.avitivacorp.com/Site.aspx

    Microsoft Future Pro Photographer Contest

    Microsoft Professional Photography Website

    You can view some great galleries as well as download fantastic new tools.
    http://www.microsoft.com/prophoto/default.aspx

    Pro Photo Home

    March 13

    To list all processes running in SQL Server

    SELECT
    [Database]=DB_NAME(dbid),
    spid, last_batch,
    status,
    hostname,
    loginame
    FROM sys.sysprocesses
    WHERE dbid = DB_ID('master');
     
    You can replace the master with the database name or remove the WHERE clause to get all processes.
    March 10

    MERGE T-SQL in SQL Server 2008

    SQL Server 2008 introduces MERGE, a new keyword which performs INSERT, UPDATE and DELETE operations at one go. With SQL Server 2008, you can perform the above operation as simple as the following code.

    CREATE PROC dbo.usp_MergeSQL
    (
         @pID INT OUTPUT,
         @pName VARCHAR(80)
    )
    AS
    BEGIN
         SET NOCOUNT ON;
         MERGE dbo.Table1 t
         USING (SELECT @pName
                ) p(Name)
         ON t.Name = @pName
     
         WHEN NOT MATCHED THEN
         INSERT (Name)
         VALUES (@pName)
     
         WHEN MATCHED THEN
         UPDATE SET @pID = ID;
     
         SET @pID = COALESCE(SCOPE_IDENTITY(),@pID);
     
    END
    RETURN
     

     

    March 05

    Shutterstock

    For the keen photographers out there,

    Have you heard of Shutterstock? It is an exciting program that can turn your photos into cash!
    ShutterStock will sell your photos and pay you for each one that's downloaded!

    Sign up for free at http://submit.shutterstock.com and start to make $$$ from your photos!

    Submit Photos to ShutterStock and make $$$!

    Check out My Gallery Here

    Download unlimited stock photos!

    February 19

    I've changed my lens collection!!!

    I've sold off the Tokina 11-16mm F2.8 to my cousin and bought the Canon 10-22mm from Vincent.
    Vincent is going on full frame!!!
     
    Hopefully get to play with his Canon 5D soon.
    January 20

    Disabling the Next button in the Wizard Control of ASP.NET 2.0

    You can programmatically enable and disable the Next button (also works for the other buttons; Previous, Finish) in the Wizard control of ASP.NET 2.0.
     

    Button btnNext = (Button)Wizard1.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton");

    if (btnNext != null)

    {

       btnNext.Enabled = false;

    }

     

    The above code only works for the StartNavigationTemplate.
    For the StepNavigationTemplate, change the StartNavigationTemplateContainerID to StepNavigationTemplateContainerID and the StartNextButton to StepNextButton.
    August 24

    VSTO 2005 for Visual Studio 2005

    Do you have missing VSTO 2005 project templates in Visual Studio 2005?
     
    I realized that I had missing VSTO Excel Workbook as well as VSTO Excel Template project when I need to build it for Excel 2003.
    So I download the latest VSTO 2005 SE from MSDN and install it.
     
    What I get is only the new VSTO Excel Add-In project templates by installing the VSTO 2005 SE.
    I am still missing the VSTO Excel Workbook and VSTO Excel Template project templates.
     
    So I went search around and found the solution!!!
     
    Close the Visual Studio, if you have it opened. 
    Open a new Visual Studio 2005 Command Prompt. 
    Type devenv /installvstemplates
    Press the Enter key and wait for the templates installation.
     
    August 18

    What i heard today...

    When you pray and ask something from God,
    God don't give the "Thing" to you.
     
    What u get is the "OPPORTUNITY" to get the "Thing" that u pray for.
     
    You will still need to work on the "OPPORTUNITY"!!!
    July 11

    Testing Moon shot

    On the way home, I noticed that it is quite a clear sky today.
    So very tempted to test out the 70-200mm lens.
     
    So this is my first moon shot!!!
    It is a 100% cropped photo.
    Moon
     
    July 08

    I've completed my lens collection!!!

    Today, I bought the Canon EF 70-200mm F2.8 IS USM.
    It is a very heavy piece of glass and metal. This coming weekend, will be going holiday with family to Chiang Mai.
    So hopefully, will try out the new lens!!!
    After Chiang Mai, it will be DC, NY and Seattle trip coming up in end of July.
     
    So, now I got the Tokina 11-16mm F2.8, Canon 17-40mm F4.0 and lastly the Canon 70-200mm F2.8 IS.
    Wow...for the first time, I got all constant aperture lens!!!