Blogger Tips And Tricks:- Opening each link from your new Blogger blog in a new window
If you want your visitors to stay for long on your blog and they should not navigate from your blog even if they are clicking any external links from your blog then this small trick is what you all need.
Opening the links in a new window will allow your visitors to return to your blog once they have read the information in the external link which you provided on your blog.Sometimes readers just simply forget your blogs name while they navigate through and then just don’t care to come back again.
So to provide an easy hand to your visitors this trick can be of help.
Workaround
- Just sign in to your blogger and navigate to Layouts Section.
- Under layouts just click Edit HTML link.
- Remeber to backup your existing template now so that you can rollback if you don’t like the changes.
4.Now just search for the </head> section in your blogger template.Remember to edit this template in firefox because it will allow you to search within the template rest all browsers which i have tested only search on the visible content on the page.
5.After you find </head>.Just above it enter this exactly the same way it is given below.
<base target=’ "_blank"’/>
Here in my blog the html tags will be replaced by their tags and symbols so i have provide the image below on how you should add this so kindly do it the same way.
Remeber this is tested only for new blogger.I have not tested this myself for old blogger.
That’s all now save the template and see the changes now your every link will open up in a new window not in the same window in which your blog was opened.
If you have any doubts then do leave a comment.
Google Calendar Sync for Windows Server 2003:-Install Google Calendar Sync on your Windows Server 2003 Systems
If you use Microsoft Outlook as a Desktop Client and want to synchronize your Google Calendar then you need to download and install Google Calendar Sync which can be downloaded here.
http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe
How to install this on Windows XP and Vista can be found here on this link
http://www.google.com/support/calendar/bin/answer.py?answer=89955
But if you are running Windows Server 2003 then this installer will fail and give an error stating that this can only be installed on Windows XP and Windows Vista operating Systems.
Workaround
- So the solution of this problem is just download a tool by microsoft called Application Verifier.
- Install this tool and just go to File ->Add Application.
- Now add the Google Calendar Sync.exe to this and just fool the installer to think that it is going to install on Windows XP system.
- How to do this is explained here in this article remember it shows the workaround for Photoshop CS3 but you have to open the Google calendar Sync file.
http://smallworkarounds.blogspot.com/2008/09/installing-photoshop-cs3-on-windows.html
Just copy the below as same given in the above article -
Major Version — 5
Minor Version—- 1
Build Number — 2600
Service Pack Major — 2
Service Pack Minor — 1
Now just click save and run the Google Calendar Sync.exe
Now it will just work fine.
I have not tested it for Windows Server 2008.Anyone who tested this trick please do leave a comment telling that is it working or not in WS2008.
FeedBurner only showing 25 feeds for Blogger blogs,How to get all my posts feed in feedburner
Blogger’s atom.xml file by default contains only 25 latest posts and when we burn this file with feed burner then only these 25 posts are converted to feedburner feeds, so what if i want all my feeds to be burnt by feed burner and to be availiable as feeds to my subscribers.
Workaround
- So the workaround for this common problem is just go to your blogger homepage and do the View Source
- In view source you will find an entry saying …..Atom” href=http://www.blogger.com/feeds/….some no/posts/default.Lets assume this no to be 12345678 so you will be having it like this…..Atom” href=”http://www.blogger.com/feeds/12345678/posts/default.Its also shown in the figure below.

3.Just copy that URL and add to its end ?max-results=100 so now your final URL will look like http://www.blogger.com/feeds/12345678/posts/default?max-results=100.
4.You can also replace this max-results =100 by 500 or 50 or by any no which blogger provides.
5.Also there is some limit on feedburner feeds size. its something around 500-550 KB’s so keep that also in mind before giving a very large no.
6.That’s all go to your feedburner account and add this url and then burn it now you will see that the no of feeds availiable are the one which you specified as the parameter.
Custom DAL having functions which recieve StoredProcedure Name and SortedList having key/value pairs as parameters to reduce code duplicacy and redundant open() and close() sql Connection calls.
Mostly whenever we code an enterprise project we should follow the n-tier model and divide our project into various tiers.
Lets continue from the UI,so first tier is our UI ,from the UI we should we should make use of our Model layer objects which simply contains classes which map our requirements for the projects.
Now from UI,we should create objects of Model Classes and pass these model classes to the Service class.This service class is nothing but it contains all the static functions which we require in our projects.Most of the application’s service logic is applied in these classes, or we can say that these classes serve the Model Objects behaviour.
Next comes the most important layer called Utility or some people might Directly call it DAL layer.
Anyways the function of this layer is to interact with the Service Layer on one hand and on the other hand fetch and persist result to the database either using ad-hoc queries or using the stored procedure logic.Given below is the representation of this n-tier project arichitecture

In this article we will mainly concentrate on the DAL part or the last layer or tier in our architecture.In our model we are not using ad-hoc queries but only stored procedures.So we have developed a SqlHelper file which will recieve only the names of stored procedure and a sorted list having a key value pair of parameters which we will pass to the stored procedure.
This layer will also handle every opening and closing of the connection to the database.We generally return a reader from the database to any point in our code but here we don’t want to open and close connection in the application logic so we are converting the reader fetched from the database to the dataset and then finally returning the dataset in the application.
There are various functions used in order to achieve this logic i will describe here a few important ones.You can download the whole file which is attached at the end of this article.
1: public static void DBExecuteNonQuery(string storedProcedure, SqlCommand command)
2: {
3: using (var connection = new SqlConnection(ConnectionString))
4: {
5: connection.Open();
6: command.CommandText = storedProcedure;
7: command.Connection = connection;
8: command.CommandType = CommandType.StoredProcedure;
9: command.ExecuteNonQuery();
10: }
11: }
We are not using above function directly from the application service layers but it is being called from inside another sqlhelper function called “ConvertToSqlCommandForNonQuery” although it can be directly used but we want to follow our key,value transfer from the application thus we follow this pattern.So below given is our ConvertToSqlCommandForNonQuery function which takes stored procedure name and sortedlist as parameters,then it calls the DBExecuteNonQuery which we have seen just above after making a command out of the recieved SoretedList.
In this function we are also using a ConvertToSqlDBType function, it is used because the value we recieve as object and we now have to map the objects C# type to Sql Server Database type.So we have another function called ConvertToSqlDBType to achieve this.We will talk about it later.
1: public static void ConvertToSqlCommandForNonQuery(string storedProcedure, SortedList<string, object> values)
2: {
3: var command = new SqlCommand();
4: foreach (var value in values)
5: {
6: Type type = value.Value.GetType();
7: SqlDbType sqlDBType = ConverToSqlDBType(type);
8: command.Parameters.Add(value.Key, sqlDBType).Value = value.Value;
9: }
10: DBExecuteNonQuery(storedProcedure, command);
11: }
1: public static void SaveCategory(Category category)
2: {
3: var parameterList = new SortedList<string, object>();
4: parameterList.Add("categoryName", category.CategoryName);
5: SqlHelper.ConvertToSqlCommandForNonQuery("usp_SaveCategory", parameterList);
6: }
1: public static Int32 DBExecuteScalar(string storedProcedure, SortedList<string, object> values)
2: {
3: var command = new SqlCommand();
4: foreach (var value in values)
5: {
6: Type type = value.Value.GetType();
7: SqlDbType sqlDBType = ConverToSqlDBType(type);
8: command.Parameters.Add(value.Key, sqlDBType).Value = value.Value;
9: }
10: int retValue = DBExecuteScalar(storedProcedure, command);
11: return retValue;
12: }
1: public static Int32 DBExecuteScalar(string storedProcedure, SqlCommand command)
2: {
3: Int32 value = 0;
4: using (var connection = new SqlConnection(ConnectionString))
5: {
6: connection.Open();
7: command.CommandText = storedProcedure;
8: command.Connection = connection;
9: command.CommandType = CommandType.StoredProcedure;
10: value = (Int32) command.ExecuteScalar();
11: }
12: return value;
13: }
Third set of functions are the main functions which first convert the datareader returned from the stored procedure to the dataset and then return this dataset to the application.We can very well return the datareader to the application and then iterate till the end of the reader but we are not doing here because we dont want to carry the opened connection to the application or simply we want to limit the connection flow only to the DAL layer.
1: public static DataSet DBExecuteReader(string storedProcedure)
2: {
3: SqlDataReader reader = null;
4: var command = new SqlCommand();
5: using (var connection = new SqlConnection(ConnectionString))
6: {
7: connection.Open();
8: command.CommandText = storedProcedure;
9: command.Connection = connection;
10: command.CommandType = CommandType.StoredProcedure;
11: reader = command.ExecuteReader();
12:
13: var dataSet = new DataSet();
14: do
15: {
16:
17: DataTable schemaTable = reader.GetSchemaTable();
18: var dataTable = new DataTable();
19:
20: if (schemaTable != null)
21: {
22: for (int i = 0; i < schemaTable.Rows.Count; i++)
23: {
24: DataRow dataRow = schemaTable.Rows[i];
25: var columnName = (string) dataRow["ColumnName"];
26: var column = new DataColumn(columnName, (Type) dataRow["DataType"]);
27: dataTable.Columns.Add(column);
28: }
29:
30: dataSet.Tables.Add(dataTable);
31: while (reader.Read())
32: {
33: DataRow dataRow = dataTable.NewRow();
34:
35: for (int i = 0; i < reader.FieldCount; i++)
36: dataRow[i] = reader.GetValue(i);
37:
38: dataTable.Rows.Add(dataRow);
39: }
40: }
41: else
42: {
43:
44:
45: var column = new DataColumn("RowsAffected");
46: dataTable.Columns.Add(column);
47: dataSet.Tables.Add(dataTable);
48: DataRow dataRow = dataTable.NewRow();
49: dataRow[0] = reader.RecordsAffected;
50: dataTable.Rows.Add(dataRow);
51: }
52: } while (reader.NextResult());
53: return dataSet;
54: }
55: }
1: public static DataSet ConvertToSqlCommand(string storedProcedure, SortedList<string, object> values)
2: {
3: var command = new SqlCommand();
4: foreach (var value in values)
5: {
6: Type type = value.Value.GetType();
7: SqlDbType sqlDBType = ConverToSqlDBType(type);
8:
9: command.Parameters.Add(value.Key, sqlDBType).Value = value.Value;
10: }
11: DataSet dataSet = DBExecuteReader(storedProcedure, command);
12: return dataSet;
13: }
1: public static List<Category> PopulateUserCategory(int userID)
2: {
3: var categoryList = new List<Category>();
4: var parameterList = new SortedList<string, object>();
5: parameterList.Add("@userID", userID);
6: DataSet dataSet = SqlHelper.ConvertToSqlCommand("usp_GetAllCategoriesByUserID", parameterList);
7: DataTable dataTable = dataSet.Tables[0];
8: foreach (DataRow dataRow in dataTable.Rows)
9: {
10: var category = new Category();
11: category.CategoryID = Convert.ToInt32(dataRow["CategoryID"]);
12: category.CategoryName = Convert.ToString(dataRow["CategoryName"]);
13: categoryList.Add(category);
14: }
15: return categoryList;
16: }
This is the “ConvertToSqlDBType” function which we use to convert C# types to SqlDBTypes.Given below are some common type conversions you can very well enhance this list and do whatever you feel like.
1: public static SqlDbType ConverToSqlDBType(Type systemType)
2: {
3:
4: switch (systemType.Name)
5: {
6: case "Int32":
7: return SqlDbType.Int;
8: case "String":
9: return SqlDbType.NVarChar;
10: case "DateTime":
11: return SqlDbType.DateTime;
12: case "Boolean":
13: return SqlDbType.Bit;
14: default:
15: return SqlDbType.VarChar;
16: }
17: }
JQuery with Asp.net and Visual Studio 2008 intellisense
Here is a small post on Jquery which is a far better alternative to Aspnet Ajax.Its a small JavaScript library with immense power and most widely used these days.A few months ago Microsoft announced that they will be shipping JQuery with Next Release of their Visual Studio i.e Visual Studio 2010.
Visual Studio 2010 and .net framework 4.0 Community Technology Preview are already available for download from
I am not sure about the intellisense support for JQuery and JavaScript in this new version but as Microsoft Promised they will surely ship it in their final release.
As for now with Visual Studio 2008 full intellisense for JQuery is achieved using a .vsdoc.js file.
Steps to follow to get full intellisense
- Install this Hotfix which will fix many issues for Visual Studio Team Systems 2008 and also enable and enhance you script intellisense if somehow it is disabled or its not coming with many other fixes.
Download Link :-https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826
- Jeff King has a very good post describing the second step here.
http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx
Here a hack is applied so there two files are given one is “jquery-1.2.6.js” another is “jquery-1.2.6-vsdoc.js”.So the first file is the actual Jquery file which should be downloaded on the clients browser along with the markup whereas second file should only be available while using intellisense inside the Visual Studio 2008.The markup comments shown above are achieving the same thing.
A very simple Visual Studio Solution is attached at the end of this post for you to see the architecture of how to include jquery files and how to do very basic things using Jquery in an aspx page having basic markup as HTML.
After following these steps you are now ready to start Jquery development in Asp.net
Download Source Code Here :-http://9wtpog.bay.livefilestore.com/y1pPZ0KF1m2F28wRGe4wQYrbDCyIuWruESEpdlcILrP_8rIkJfe2eTchl6iw6KSUMwRroVAQ2UvoCo/JqueryIntellisenseInstallation.rar?download
Adding LinkedIn Button To Blogger or WordPress or any other Blog
Today i was trying to add a “LinkedIn” to my linked in profile button on Blogger.But it was not so easy.
You can directly embed the HTML and get the linked in image link if you want but for me it didn’t workde.Then i came to know that the linked in people themselves provide custom buttons that you can add anywhere either to your blog or your websites.
But these custom button service is rather hidden ie not visible at the first sight.So i thought that it would be helpful if i share this post with you all.
Below i have given detailed description with images on how to add this linked in button to your blog.
Steps:-
- Just go to http://www.linkedin.com/

2.Sign into your profile
- 3.Goto public profile and click the edit button next to your public profile
- 4.Click on promote your profile add custom buttons link

- 5. Now you can see a lot of buttons and their respective code which you can directly paste into your blog.
Outlook 2007 Signatures:- Using custon HTML and styles in Signatures in Outlook 2007
Outlook 2007 does not give the facility to put the custom HTML and styling in Signatures under the signatures box.

As you can see that by default when you edit your signatures you only have Delete New Save Rename Options.
And also a few options to insert image and some hyperlink but no support for any kind of custom editing of HTML and styles.
So what to do if you want to enter some custom HTML and do some styling to your signatures while using Outlook 2007.
Here is the workaround.
WorkAround


Just Navigate to your “C:\Documents and Settings\(your_username)\Application Data\Microsoft\Signatures”.
Here Search for the htm file which will generally be starting with you Name.
Open this file in Notepad , Notepad++ and add whatever custom content you want to add.

Click Save and you are done.
Open your Outlook Signatures Box to see that changes made by you are reflected or not.
Send a mail to your another account to check whether your custom signatures are working or not.
Visual Studio is missing default templates
If your Visual Studio either VS2005 or VS2008 is missing some default tempates, or whenever you want to add any new item and click add new item you are surprise to find that either your add new WebForm is missing or any other similar item is missing from the add new item list then your templates defaults are corrupted due to some reasons or latest updates or patches or any other software which you have recently installed.
Workaround
So the workaround to this problem is:-
- Just go to the Visual Studio command prompt.
- Close all opened instances of Visual Studio
- Run this command devenv/installvstemplates on Visual Studio Command Prompt.
- And thats it all your templates will be set to defaults.
Want to transfer your post:- From Blogger to Blogger,Blogger to WordPress,LiveJournal to Blogger,Blogger To Windows Live Spaces all in all almost every blog.
If you want to transfer your posts from one blogging platform to another and are facing problems , then Paul Cooley has a very good application which he calls “Blog2Blog” which can do this for you very easily.
I have myself tested it for my blogger to blogger transfer and it works just fine.
Also in blogger i was unable to find a safe way to transfer all the posts or selected posts to another blogger account.
But with this tool you can achieve the same easily.
You can download the tool from here:-
http://www.paulcooley.com/linuxlore_blogstorage/apps/blog2blog/blog2blog-2.4.0.2.zip
Instructions for using the tool
- Just Click the setup.exe and install the application.
- Once installed it will open up an interface like this

- In select source select the blogging platform from which you want to import the posts.
- Enter your username and password source-URL ex. http://smallworkarounds.blogspot.com.
- Then for the source-API-URL especially in blogger if you are using old blogger then the defaults which will be coming will work.
- But if you are on new blogger then you have to open your blog on the home page and do the view source.
- In view source you can locate and entry which says “service.post” and there will be a link after that as shown below.

- Just copy and paste that link to the source-API-URL and this is it your source is set up.
- Remember that this trick is for new blogger only.
- Once completed with all the above things just press fetch.
- After fetching is completed just repeat the same steps for your destination blog also.
- Once you are done with your destination blog then just click publish.
- And thats all you will see all the posts being published to your new blog.
Thanks! for this great tool by “Paul Cooley”
http://linuxlore.blogspot.com/2007/09/livejournal-to-blogger-or-blogger-to.html
C#—-When to use As Keyword in C#
- As keyword is a hidden treasure in C# which most of us don’t use in our day today programming.
- As keyword is used for the comparison of compatible types
- Its general syntax is expression as type where expression is also a reference type and type is also a reference type.
- Whenever there is nothing in the object instead of complaining to user or throwing an exception it just returns “null” thus it doesn’t throw an exception.
- So when to use as keyword and when to use cast expression is a very important question indeed.
- Both have their individual significance.
- Whenever you do not want to raise any exception and you have already handled the returned null value condition then it is wiser to use “As” keyword.
- But when you want that whenever the object is null an exception should be raised and you are using exception handling then you always must use the same familier cast expressions.
Given below is a small code snippet to demonstrate that:-
1: using System;2:3: namespace Ramp.Test4: {5: class Program6: {7: static void Main(string[] args)8: {9: var myObject = new object[3];10: myObject[0] = new Student();11: myObject[1] = new Teacher();12: myObject[2] = "I love C#";13:14: foreach (object obj in myObject)15: {16: string s = obj as string;17: if(s!=null)18: Console.WriteLine("It is a string");19: else20: {21: Console.WriteLine("Its not a string");22: }23: Console.ReadLine();24: }25:26: }27: }28: public class Student29: {30:31: }32: public class Teacher33: {34:35: }36: }
Output
Its not a stringIts not a stringIts a string








