Monthly Archives: November 2015

How to troubleshoot PHP critical code using die()

If you are complex issue in PHP and you do not have debugger install or do not want to use debugger, there is an easy way to troubleshoot your code.

Place die(); function right at the point where you want to troublesheet/example values. The program will stop at that point and you see your values.

Example of Using Die

You have a query that is returning unsuspected result. There is no way you can debug the code directly or you can’t output the content because the page redirects. In this case use die();

The execution will stop at this point and you can examine your query.

connection string to local aspnetdb.mdf

This is connection string to your local database in visual studio

Note that this .mdf file does not have a database inside. It is simply data inside the mdf file. Copy the above connection as it is in web.config file.

Install Ajax in Visual Studio 2008

Visual Studio 2008 still rocks which comes bundled with Crystal Reports and Site Configuration if you really want to build an application with roles. Visual Studio 2015 is out and Visual Studio 2013 is commonly used every but both do not have Crystal Reports and they do not come with site configuration.

It is hard to find AjaxToolKit for Visual Studio 2008 so I will provide the links here and provide a quick tutorial so it goes smoothly for you.

  1. Download Ajax for Visual studio 2008 from Codeplex. This will download AjaxControlToolkit-Framework3.5
  2. Unzip it. I had to build this locally to create AjaxControlToolkit.DLL. You can download this DLL AjaxControlToolkitif it works for you. All you need is this DLL.
  3. Create a folder in the project “Ajax”, copy this DLL there
  4. Right click “Standar Toolbox” header and click “Add Tab”. Name this Ajax Controls.
  5. Right click on the new tab, click “Choose items” then Click browse button, and point to your local Ajax folder. Select the AjaxControlToolkit.DLL. Click OK. All controls should be added!

To test your code, create default.asp page and copy and past the following. This should popup the following Ajax Calender dialog.

Hope this tutorial helps someone.

Open Database File in Visual Studio

database not opening in visual studio
I could not open database files that were crated in Visual Studio 2008 after I created roles in the application. The App_Data file does not expand as it should bee. There is no other option in menu available to review the data.

The solution is, go to “Server Explorer” TAB. If not not already seen, enable it from view menu. Click the Add database icon. The following dialog will popup. Select “the database file option”
connect data file

In Solution explorer, right click on the App_Data folder and select open in Explorer. Copy the path and past it the previous step after you press ok and then browse button.

This should connect your local files in Visual Studio. Right click on the table and select “show table data”

Show Table Data

Network Access Message: The website cannot be found

Network Access Message: The website cannot be found

If you get this error in IIS, “Network Access Message: The website cannot be found”, the error could be misleading. The print print of the error says

Error Code 11004: Host not found
Background: This error indicates that the gateway could not find the IP address of the website you are trying to access, possibly due to lack of information in the DNS server.
Date: 11/17/2015 8:31:55 AM [GMT]
Server: nserver
Source: DNS error

This problem could simply be because you are using proxy server and your site is not available because it does not exist on proxy server. To fix this issue in FireFox, go to options > Advance > Network > setting and include your site name (in my case test) in the “Do not use proxy for and you problem should go away!

proxy Settings

Install Ajax Toolkit/toolbox in Visual Studio 2013

PM console
This is a two step process.

  1. Download Ajax Toolkit
  2. Add Ajax Controls to Toolbox

Install ASP Ajax Toolkit

In Visual Studio 2013, go to tools > Library Package Manager > Package Manager Console and issue the following command in the white area

PM > Install-Package AjaxControlToolkit

Give it a minute or two, this will install AjaxControlToolKit into your current project.You should be able to see AjaxControlToolKit under reference in your project. I would advise to create a project rather than website so every thing is smooth.

Add Ajax Controls

At this point you have Ajax installed in your project but you do not see Ajax Controls in your toolbox. To fix that, right click on the Standard Toolbox and click Add. Give a name such as “Ajax Controls”. Right click on “Ajax Controls” and select choose items.

To find the path of the ajaxcontrols toolkit, click on reference and select AjaxControlToolkit, select properties. Note down the path and copy it. In the previous step, select browse and past this url. It will load all ajax controls. Make sure to select OK at the end.

Now all controls should appear in the “Ajax Controls” toolbox.


It is possible that not all controls are loaded in the ajaxtoolbox. In my case TabContainer was there but TabPanel was not there. TabPanel was actuall accessible in code and was working find but was not visible in the toolbox. To test your ajax, you can simply copy and past the following. Three TABS should show on the page.


Header Template



Windows 7 Service Pack 1 Download

Download Windows 7 Service Pack 1 directly from Microsoft. Here is the link

Once you click the red “Download button”, you will see a bunch of downlaod files with checkbox next to it. Select

windows6.1-KB976932-X64.exe (903.2 MB)

for Windows 7 64 bit and you should all set!

Install HP 1010 printer on windows 7 without drivers

HP 1010 Printer is not install able in Windows 7 because it is old and is not supported any more. The drivers that may be there also do not work. Fortunately, you can install HP 1010 in Windows 7 without any drivers. Follow these steps.

1. Go to control Panel, Printers and then Add Printer
2. Select “Add Local”
3. In the port select Use “DOT4_001 (Generic IEEE xxxxx) click next
4. In this dialog, select HP and then scroll down to where you see “HP Laserjet 3055 PCL5”.
5. Click next and install the driver. Print out the test page.

You do not need to download any drivers for it. If you do not see this printer, click update drivers in Step 4 to update printers drivers from Windows.