Sometimes we might need to reverse string letters order. unfortunately, String class in .Net Framework up to version 3.5 doesn’t have a Reverse Method. here I will try to add Reverse Extension Method to String class.
The idea behind string reverse is converting the string to an array of chars and then apply Array.Reverse() method and again convert the array of chars to string. see code
public string ReverseString(string originalString)
{
char[] strArray = originalString.ToCharArray();
Array.Reverse(strArray);
string strReversed = new string(strArray);
return strReversed;
}
For simplicity, StringHelper class is created to provide string.Reverse method as
Extension Method
public static class StringHelper
{
public static string ReverseString(string originalString)
{
char[] strArray = originalString.ToCharArray();
Array.Reverse(strArray);
string strReversed = new string(strArray);
return strReversed;
}
public static string Reverse(this string originalString)
{
char[] strArray = originalString.ToCharArray();
Array.Reverse(strArray);
string strReversed = new string(strArray);
return strReversed;
}
}
Easy to use
string str = "abcdef";
string ReversedStr = str.Reverse();
Happy Coding…
Retweet
Hi Guys, I have been to Saudi Arabia last few days. it was very good trip to Islamic Holy Places.
Here are some photos I captured during my trip.

Kaaba

Kaaba

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Prophet's Mosque

Quba Mosque

Al-Baqi' cemetery

Mount Uhud

Mount Uhud

Monkeys live in Mountains!
Two days back, a colleague of mine asked How can he retrieve all rows which have similar employee names.
The situation, there are two tables/Excel sheets he has got from two different sources for the same set of employees. he needs to extract some information from both. the employee name column is the key to identity each one of these employees. the challenge here, employee name is not exactly the same in the two files.
The first solution jumped on the table is similar names. SQL Server provides us with some functions which will help us to achieve this task such as SOUNDEX() and DIFFERENCE().
Here is an example, assume there is a table like below



This table contains some of my friends’ names. as this table shows I have 5 friends share similar names with “Mhmd” letters but with different form for each one of them.
Now I want to write T-SQL query which should give me all friends whose name sounds similar “Mhmd”.
I wrote this query
SELECT FriendFisrtName, FriendLastName
FROM MyFriends
WHERE SOUNDEX('Mhmd') = SOUNDEX(FriendFisrtName)
And I got this result set

Hope this helps…
Retweet
First off, good night or it might be good morning in the other side of the world. however, I am here to share my presentation about SQL Server Reporting Services (SSRS) with you/DEVelopers.
It was a quick overview to clarify and simplify the concepts under the Reporting Generation Tools and did some practices using MS SSRS.
Session Slides are shared through SlideSahre
The HotKey shortcuts make it faster and easier to navigate through the applications and functions.
Windows 7 has some new handy hotkeys including the following:
-
Win+Home: Clear all but the active window
-
Win+Space: All windows become transparent so you can see through to the desktop
-
Win+Up arrow: Maximize the active window
-
Win+Down arrow: Minimize the active window or restore the window if it’s maximized
-
Win+Left/Right arrows: Dock the active window to each side of the monitor
-
Win+Shift+Left/Right arrows: If you’ve got dual monitors, this will move the active window to the adjacent monitor
-
Win+T: Shift focus to and scroll through items on the taskbar
-
Win+P: Adjust presentation settings for your display
-
Win+(+/-): Zoom in/out
-
Shift+Click a taskbar item: Open a new instance of that particular application
Retweet
Hi friends,
As Windows 7 promised more security and control over your machine. Windows 7 introduced AppLocker. AppLocker is an administration tool included with Windows 7 which enables you to control which applications you want to run in your desktop.

Michael Pietroforte’s article is a good place to start with AppLocker.
also this video from Microsoft TechNet.
Hey guys,
I’d like to share my T-SQL session I’ve presented since few last months.
I tried my best to cover the most important concepts and fundamentals related to SQL Programming and Database Design best practices. it’s a good place to be if you need quick start.
Slides are shared through SlideShare.
Yes, it was so excited to Karting. I (left side) and my affable friend Eyad have enjoyed new experience

Do you agree that ASP.NET Application’s web.config became very big and hard to read?
ASP.NET Team Development also agreed on that and introduce some enhancements to make web.config content simple and easy to read.
ASP.NET Platform configurations based on two config files, First one is machine.config which contains common configuration data like define available configSections to be used in this version of framework and other global elements such as processModel.
You can find machine.config for framework 2.0,3.0 and 3.5 through C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG. you should notice that all these frameworks working under the CLR v2.0.50727 which means they use the same machine.config
web.config is the second file you need to properly configure your ASP.NET application. web.config should contain only application specific information. because of mentioned-above frameworks upgrade the framework Class Library and introduce new services which working under the same CLR. these new services and libraries should be configured and registered in web.config such as Ajax, routing, and integration with IIS 7.
In Framework 4, we have new CLR and new machine.config, so all common configuration data have been moved to the new machine.config and made web.config simple and clear.
In ASP.NET 4, web.config might be empty or contain very few lines

ASP.NET 4 Web.Config Minification


Retweet
Welcome to my Web Log. I just wanted to write my first post and start blogging!
This blog would be my gate to share and discuss ideas, thoughts and information about Web Development, especially ASP.NET and Microsoft based technologies.
Ahmed Elbaz
Happy Programming…