Error while trying to run project: Unable to start debugging on the web server

Comments Off

Open your Internet Information Services manager and from the [your machine]/Web Sites/ Default Web Site node select the virtual folder which stores your project. Right Click and select Properties to select the ASP.NET tab page. Make sure the correct version ASP.NET Version is selected.

I have VS.NET 2003 and 2005 beta 1 running side-by-side on my box and noticed ASP.NET Version 2.0 is targeted by default, even for VS.NET 2003 projects.

Creating a Stored Procedure – MySQL 5.0

Comments Off

DELIMITER$$
   CREATE PROCEDURE testing(IN ID INT)
     BEGIN
        SELECT COUNT(*) AS numrows FROM clients.clients_domain;
     END$$
DELIMITER;

The “DELIMITER $$” statement causes MySQL to use two dollar signs ($$) as it’s end-of-line delimiter, instead of a semi-colon (;). This will allow any SQL between the BEGIN and END to have a semi-colon at the end of the line, without causing MySQL to think the query is done. The END statement needs the two dollar signs after it so MySQL knows the query is done and ready to be executed.

Change datagrid cell properties using ASP.NET C#

Comments Off

public void dgBoundItems(object sender, DataGridItemEventArgs e)
{
    foreach(TableCell cell in e.Item.Cells)
    {
        ///e.Item.DataSetIndex = row
        ///e.Item.Cells.GetCellIndex(cell) = column
        if (e.Item.Cells.GetCellIndex(cell) == 2 && e.Item.DataSetIndex > 0)
        {
            ///If the salary is less than 5000 the color must be red.
            if (Convert.ToInt32(cell.Text.Trim()) < 5000)
            {
                cell.ForeColor = Color.Red;
            }
        }
    }
}