Blog from a software professional, Passionate to work in latest cutting edge technologies in order to get better results in business.
Monday, May 18, 2009
New release of the Ajax Control Toolkit
New version of Ajax tool kit (May 2009 release) is now available...
Download link
Regards
Fauzi
Wednesday, May 13, 2009
Unable to start debugging on the web server. The web server is not configured correctly...
When you build a web solution in Visual studio, if the following error message is shown:
"Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information."
There can be two reasons...
A) The directory where the web application stays may not be configured as web application.
Steps to Solve:
1. Right click the project folder & Click properties.
2. Select "Web Sharing" tab.
3. Choose the option "Share this folder" radio button & Edit Alias window will pop-up, Press OK and build the application.
B) The Frame work version may not be the appropriate one.
Steps to Solve:
1. Right click the project folder from IIS (Run>inetmgr), Click properties
2. Select ASP.NET tab & select the appropriate ASP.NET Version from combo box.
3. Press OK & build the application again.
Hope it is helpful...
Regards
Fauzi
Tuesday, May 12, 2009
Where is the debugger or host Application Running? - Adobe Flash Player 9
Hi Folks,
Where is the debugger or host Application Running?
I got this message box repeatedly many times when ever a flash component is there in the web page i browse which is annoying for any user...
The solution is we need to just install the patch file which can be downloaded from macromedia site. Following are the links to download...
For Firefox: flashplayer_9_plugin_debug
For IE : flashplayer_9_ax_debug
Hope it helps
Best Regards
Fauzi ~4Z
How to delete all records from all tables from Database
Following is the SQL query used to delete all records from all tables from Database.
This is useful during development scenarios where you need to get rid of all the dummy records and insert a fresh data.
SQL Query: Appropriate comments are provided to explain its operation
/* The Following set of queries is used to delete all records from all tables from your database */
/* Disables Referential integrity */
/*---------------------------------*/
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
GO
/* Delete records from tables */
/*----------------------------*/
EXEC sp_MSForEachTable '
IF OBJECTPROPERTY(object_id(''?''), ''TableHasForeignRef'') = 1
DELETE FROM ?
else
TRUNCATE TABLE ?
'
GO
/* Enables Referential integrity */
/*-------------------------------*/
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
GO
/*Query ot be used if you would like to reseed all table*/
/*------------------------------------------------------*/
EXEC sp_MSForEachTable '
IF OBJECTPROPERTY(object_id(''?''), ''TableHasIdentity'') = 1
DBCC CHECKIDENT (''?'', RESEED, 0)
'
GO
Hope its Helpful
Regards
Fauzi
How to get current project path in C#
Syntax: HttpContext.Current.Request.PhysicalApplicationPath
Example: StreamReader(HttpContext.Current.Request.PhysicalApplicationPath + @"\DataBase\Fauzi_db.sql");
Tuesday, May 5, 2009
Read Resource file: Resource.resx dynamically thourgh C#
Dear Reader,
Following is a sample method to read a Resource file in your web application which resides in the location "App_GlobalResources\Resource.resx". The assembly references needed are
using System.Collections;
using System.Resources;
Is case if there is a message shown when solution is built
"The type or namespace name 'ResXResourceReader' does
not exist in the class or namespace 'System.Resources' (are you missing an
assembly reference?)"
Please refer ResXResourceReader missing an assembly reference
Source code:
public void ReadResourceresx()
{
//Creating a hashtable to store string in resource files
Hashtable resourceStringsHashTable = new Hashtable();
//Provide relative path of Resource file
string strResourceFilelocation = HttpContext.Current.Request.PhysicalApplicationPath.ToString() +
@"\App_GlobalResources\Resource.resx";
//Creating object for Class: ResXResourceReader
System.Resources.ResXResourceReader objResXResourceReader = null;
try
{
objResXResourceReader = new ResXResourceReader(strResourceFilelocation);
//Defines a DictonartEntry Key/Value to Set or retriev values
foreach (DictionaryEntry resourceString in objResXResourceReader)
{
if (!resourceStringsHashTable.Contains(resourceString.Key.ToString()))
{
//Adding values to HashTable one by one in a loop
resourceStringsHashTable.Add(resourceString.Key.ToString(), resourceString.Value);
}
}
}
finally
{
//Closing the created object
objResXResourceReader.Close();
}
}
Hope it helps :)
Regards
Fauzi
ResXResourceReader missing an assembly reference
In my web application when I try to read a Resource file (App_GlobalResources/Resource.resx) dynamically through C# code, I get the following message when the solution is built even though the assembly reference "using System.Resources;" is already added.
"The type or namespace name 'ResXResourceReader' does
not exist in the class or namespace 'System.Resources' (are you missing an
assembly reference?)"
The solution is we need to add a dll reference of System.Windows.Forms.dll to the application.
Hope it helps :)
Regards
Fauzi