Monday, February 14, 2011

Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


So.. I decided to play around with AJAX...just because I run 2 years behind everyone else in the world... anyways.. the very first compile, I get this error...


Server Error in '/Ajax' Application.

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: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 30:    
Line 31:      
Line 32:        
Line 33:      
Line 34:    

Source File: ***\Visual Studio 2010\Projects\Ajax\web.config    Line: 32

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: User = ***
LOG: DisplayName = System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///***/Visual Studio 2010/Projects/Ajax/
LOG: Initial PrivatePath = ***\Visual Studio 2010\Projects\Ajax\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: ***\Visual Studio 2010\Projects\Ajax\web.config
LOG: Using machine configuration file from ***\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions/System.Web.Extensions.DLL.
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///***/Temporary ASP.NET Files/ajax/10e788b7/30cb6ce9/System.Web.Extensions/System.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions.EXE.
LOG: Attempting download of new URL file:///***/Visual Studio 2010/Projects/Ajax/bin/System.Web.Extensions/System.Web.Extensions.EXE.

And began the painful process of debugging and screaming and kicking...

DOH !!

I did not install the AJAX extension

I need to install ASP.NET 2.0 AJAX Extensions 1.0

Once I did that... all was well in my world once more...

Wednesday, February 9, 2011

Format phone number in sql server 2008

Sometimes it is desperately required to format the phone number before displaying them in your website. In this ms sql server tutorial we will learn how to format the phone number in mssql server query.

Actually we want to convert telephone number like this 6092758415 into (609) 275-8415. Let’s have a look over how to do this, for example we have a column user_phone in our database table users, let’s look how to format the telephone number in mssql server query. It's easy and better to perform formatting of phone numbers in sql.

select case when len(ltrim(rtrim(User_Phone)))='10' then '('+SUBSTRING(User_Phone,1,3)+')'+' '+SUBSTRING(User_Phone,4,3)+'-'+SUBSTRING(User_Phone,7,4) when len(ltrim(rtrim(User_Phone)))='' then ' ' end AS User_Phone from users

Now phone number field will show data in this format (###) ###-####

nawaz dobandi


वो अपने घर की खिड़की से झाकता कम है
तालूकात अभी भी है रापता कम है 
फ़िज़ूल तेज़ हवाओं को दोष देता है 
तुझे दिया जलने का होसला कम है 
में तेरे लिए जान दे देता ऐ दोस्त 
मगर मेरी जान का मुआफ्ज़ा कम है 


अगर बिकने पे आ जाओ तो घट जाते है दाम अक्सर 
न बिकने का इरादा हो तो कीमत और बढती है