PHP Test Configuration Page

by Nathan 22. February 2009 11:56

To test if PHP is setup correctly on your web server, or to check your PHP Configuration.

You just need to add the below code to your a .php file:

<?php phpinfo(); ?>

Tags:

PHP

Windows XP Vista stuck in safe mode

by Nathan 17. February 2009 17:25

When you computer is stuck in safe mode everytime you reboot, even if you check run normal configuration.

There is a little System Configuration Utility in windows you can use to turn this off. 

If you go to Start -> Run

then type msconfig

then press OK

  You will need to make sure you have Normal Startup Selected.

     

Tags: ,

Windows

Inheritance issues in web.config

by Nathan 17. February 2009 17:14

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The entry 'ScriptModule' has already been added.

Source Error:

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


This happens when the config for a virtual directory is already defined in the root web application


There are two ways you can fix this:

<remove name="ScriptModule" />

Alternatively you can stop the  the web.config inheritance to the the virtual directory.
by adding this to the parent web.config

    <location path="." inheritInChildApplications="false">
    <system.web>
    ...
    </system.web>
    </location>


--------------------------

I also came upon this problem when trying to fix this issue:

Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.

which led me to realise there were .NET 3.5 references in the parent application's web.config

I tried to remove this using:

    <location path="." inheritInChildApplications="false">
    <system.web>
    ...
    </system.web>
    </location>

the problem actually occured due to the 3.5 reference in the <configSections>

Tags:

ASP.NET

ASP Connection Strings

by Nathan 9. February 2009 14:26

This is an example of a connection string for ASP (JScript and VBScript)

var connString = "Provider=sqloledb; Network Library=DBMSSOCN; Data Source=10.1.1.1;User ID=exampleUser; Password=examplePassword;Connection Timeout=90;Application Name=MyApplication;"

 

I came across the following errors in my ASP Code when my connection string was not setup correctly.

 

Microsoft OLE DB Provider for SQL Server error '80040e4d'

Invalid authorization specification

The problem was my original connection string did not have the userid and password credentials

 

Invalid connection string attribute

Invalid Data in either Password and/or Username or Initial Catalog etc

Tags: , , ,

ASP

Get Column Names for Table in MSSQL

by Nathan 3. February 2009 17:26

To get the column names of a table in MSSQL 

SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = 'TableName'

This is basically the MSSQL equivalent for The MySQL Command DESCRIBE TableName which displays the table details

 

I often use this so i can copy and paste into another query etc.

SELECT Column_Name + ',' FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = 'TableName'

then i have the commas for use in any INSERT or SELECT etc Smile

 

Tags:

SQL

Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen