Friday, October 31, 2008

How to install Sql Server 2005 SP1 on existing SQL Server 2005 SP2 Install:- If you are getting "A recently applied update, KB913090, failed to install".


If you are getting this error then one probable reason can be that you are trying to install Sql Server 2005 SP1 on a machine already having Sql Server 2005 SP2 Installed on it.

This error might be followed by another error telling "SqlSupport.msp is not digitally signed"

The best way to fix this error is by following these steps:-

  1. Save the data in the following Registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Bootstrap\MSIRefCount\Uninstall


2.Copy this value data in a text file and save it for future use.

3.Go to control panel , add/remove program and remove the Microsoft Sql Server Setup Support Files.While uninstalling you might get some error message or warning that this uninstall may effect some other Sql Server Components which are already installed.

4.Click Yes to uninstall on the error message.

5.From the installation CD browse to the folder Tools\Setup and start the SqlSupport.msi to again install the Sql Server Setup Support Files

6.After this step again browse to the registry location mentioned earlier  and change the data value to the one we saved in the text file.

7.Now you can successfully start the install of Sql Server 2005 SP1

Wednesday, October 29, 2008

Reporting Server Not Starting:Starting Report Server Failed


How to tackle this situation as it may be really frightening

  1. Find your SQL server installation folder it might be in C:\Program Files\Microsoft SQL Server\MSSQL.x\Reporting Services\ReportManager.Here MSSQL.x can be anything where you Reporting Service is installed, generally if you have installed every thing including Notification Service,Analysis Service,Integration Service and DataBase service then it is MSSQL.4

  2. Use the All Programs menu to open the Report Server Status page.

From here you can locate the instance id ie. is it MSSQL.2 or MSSQL.4 etc... 

3.Now open the ReportServer.config File and find the line containing <WebServiceAccount></WebServiceAccount>

4. Add IWAM_ComputerName like this <WebServiceAccount>IWAM_ComputerName</WebServiceAccount>


5. Save and then close the RSreportserver.config file.

6. Restart the SQL Server Reporting Services service.

Sunday, October 26, 2008

Windows Live Writer Portable

Here is a very good post where you may know about Windows Live Writer Portable.For those who don't know Windows Live Writer is a desktop based application from which you can manage you n number of blogs.It consits of a rich sets of plugins to achieve different blogging objectives.

Its a musch check and must have tool for bloggers

The link to the post which i mentioned earlier is

You can download the portable version of Windows Live Writer from the below given link and you have to follow the instructions given above to install this portable version.

Saturday, October 25, 2008

Some useful properties,classes and methods which we require mostly during development in .net

 1: System.Web.HttpContext.Current.Request.ApplicationPath

System.Web.HttpContext.Current.Request.ApplicationPath gives you the applications current running path.



This list will be ever increasing as soon as i found some useful content i will publish it once again.

If you also want to share some common,useful and often ignored things in .net you can comment in there i will surely include them in the list.

Friday, October 24, 2008

Internet Explorer always ask for password for my Sharepoint this causing havoc

  1. Although When you install Sharepoint it by default configures all the settings to be used with Internet Explorer, but sometimes it may happen that when you installed sharepoint server at that time you were having IE6 or some other version and now you want to switch to some other version.
  2. Now when you install this new version every setting made by Sharepoint is gone  and if you open your sharepoint website in the browser it always asks for the credentials
  3. So what you have to do is follow these simple steps to again configure Sharepoint Sites to run smoothly with you IE browser
  5. Now in Internet Options go to Local Intranet and make the security lever for this zone to low
  6. Then click on the sites tab




Now click on the advanced tab


Here in advanced settings make sure that you sharepoint site is included,and if not than just write the url of your site and press add and then close and then press OK



Now you sharepoint site should work fine in IE7 or others

If you still have some queries than do leave a comment.

There is also another article on how to configure and install sharepoint

Windows Live Writer Important Shortcuts

Few important shortcuts which can make you more productive using Windows Live Writer

  1. Ctrl + F11 for normal view, no styling information is applied while you are writing your blog entry
  2. Shift + F11 this is the Html Mode, here you can edit the Html contents of your posts and just do any manipulations in the HTML or do any inline styling to you post
  3. F11 If you want to writer your blog with all the styling information about the blog in your background while writing.
  4. F12 To see the web preview of the post once you write it, this shows how your post will look after publishing.
  5. Ctrl + L to insert an image either from web or from your desktop
  6. Ctrl + K Insert Hyperlinks
  7. Ctrl + Shift + V is the shortcut to Paste Special Command what it does is if you copy the content from somewhere else it can remove the styling information from the original content and yet preserving all the image and link tags,its thus really powerful
  8. F7 is to check spelling on the post.


If you want some more information regarding windows live writer than you can obtain it from these posts

Share Point Series:- Basic Sharepoint Installations And Configurations Part1

This is the first article in the series of Sharepoint articles, a lot of stuff will be coming in next few months.

Here in this first article i will just talk about simple steps to follow to install Microsoft Office Sharepoint Server 2007 on Windows Server 2003.

It will refer MOSS 2007 to Sharepoint Server from now on.

It should be made clear in early phase of this article series that Sharepoint Server can only be installed on Windows Server Installations it cant be installed on Windows XP and Windows Vista Installations.

Installing Sharepoint Server

  1. Just follow this useful link already present on MSDN to install Sharepoint Server.I will not rewrite the whole thing but i will discuss where ever required and some problems i faced and their solutions.
  3. As satated at last in the above article when the installation finishes than you have to click next and then it will ask you for the configurations,so you can just click next and start the configurations.
  4. If you install the standalone install with all basic settings it basically performs 10 diffrent basic configuration tasks and these tasks may take time so be patient.
  5. If everythings goes on smoothly after sometime it will say configuration completed successfully.
  6. Now at this stage we are ready to test our first sharepoint site.     
  7. If this is the scenario with your system than probably you might be running something else on your port 80 such as your Source Controls Server Such as SVN or Source Vault.
  8. So first you have to stop those or configure them on another port to work in synchronization with Sharepoint Server.
  9. If you are using SVN than you just have to stop the Default running apache server which is uses by default and configures it to use port 80.
  10. Make sure if you have made the default install of Sharepoint Server than no other thing is running on port 80 or your default Sharepoint website will not run.

Wednesday, October 22, 2008

PostBack Events are not firing in

This seems to be a problem with all the beginners at one or the other moment in their coding profession they face this problem.

One of the silly mistake due to which this problem can occur is that you have some validation controls on your page which you are initialy not showing up on the page ie there might be a situation wherein you might have various divs on a page and you might be using tabbed navigaiton to show one particular div's contents at one time and hiding rest of the div's.So sometimes you might have some validation controls in one particular div and you might be working on the contents of another div which doesnot have any validation controls but do have postback controls ie asp controls.

But what happens in this situation is that although the divs are hidden yet the markup is processed and loaded on the page now if you click on any postback buttons or linkbuttons or any control to do postback it will not postback because you have not met the required validation fulfilment reuqirements as the text boxes which you are using for validation might be empty or there might be some other problem in there which is causing validation to be false, thus no postback to the server.

So if such is your scenario then just enter a property of the asp control called "CausesValidation" to false.

Setting this will remove that button from checking that are the validation requirements fulfilled on the page and thus it will cause a postback.

Sunday, October 19, 2008

Returning Values using AdHoc Sql Queries And using Stored Procedures

Here is a very good article by Scott Mitchell

Why is Guid Sometimes better than Identity in Database

When the application demands that the just inserted value should be returned back.In such cases it is much wise to use GUID instead of auto- incrementing identity column in the database.

One benifit of using GUID is that it can be generated programatically beforehand using the GUID class in .net frmework

We can have Guid guid  = new Guid();

Now we can pass this newly generated guid to any no of insert statements this way we can save our application from the complex logic of using output parameters or return statement and also from the use of SCOPE_IDENTITY().

But you are free to use the other approach also it all depends on the need of the application

DropDownList Control problems and challanges faced using appenddatabound items and autopostbacks

Sometimes we need a solution where we have to append certain hardcoded values which are given in the markup and then we have to append some values from the database after these hardcoded values.

These hardcoded value can be a single item saying "Select" or "Remove" or a list of asp list items.

So if we are not following the right steps in the sequence of databinding and clearing items from the dropdownlist control, this control may act a little different as we would have thought and create havoc in our programming life.

Today while building an application i came accross the similar situation where i have two dropdownlists one is "ddlCategories " where current categories to which a post belongs are coming form the datasource it alos has a listitem value which is hardcoded in the markup saying Remove Existing Categories which have a value of -1 and index value 0.

There is one more list called "ddlAddUserCategories" in which all the categories related to particular user are databound using the datasource.

Here also we are having a hardcoded value same as above but having a different text saying that Add Existing Categories....

Markup is give below

 1: <td>
 2: <asp:DropDownList ID="ddlCategories" runat="server" AutoPostBack="true" SkinID="ddlBlue"
 3: EnableViewState="true" OnSelectedIndexChanged="ddlCategories_SelectedIndexChanged">
 4: <asp:ListItem Text="Remove Existing Categories...." Value="-1" Selected="True" />
 5: </asp:DropDownList>
 6: <span class="spanAddCategory">Remove Existing Categories</span>
 7: </td>
 8: <td>
 9: <asp:DropDownList ID="ddlUserCategories" runat="server" AutoPostBack="true" SkinID="ddlBlue"
 10: EnableViewState="true" OnSelectedIndexChanged="ddlUserCategories_SelectedIndexChanged">
 11: <asp:ListItem Text="Apply Existing Categories....." Value="-1" Selected="True" />
 12: </asp:DropDownList>
 13: <span class="spanAddCategory">Apply Existing Categories</span>
 14: </td>

Now i want that whenever i postback using the autopostback property of the dropdownlist

i should have changes reflected in both the dropdownlists.

So first of all remember to keep the datasource and databinding code sequence inside

if (!Page.IsPostBack).If you simply keep it inside the page load event,every time the page loads it will again overwrite the values and you may lead to a situation in which even if you selecte different values, then also the same value for the selectedindex is returned.So to prevent this always keep your datasource code for the dropdownlist inside if(!Page.IsPostBack)

 1: protected void Page_Load(object sender, EventArgs e)
 2: {
 4: if (!Page.IsPostBack)
 5: {
 7: ddlCategories.DataSource = CategoryManager.PopulateCategoriesOfPost(post.PostID);
 8: ddlCategories.DataTextField = "CategoryName";
 9: ddlCategories.DataValueField = "CategoryID"; 
 10: ddlCategories.AppendDataBoundItems = true; 
 11: ddlCategories.DataBind(); 
 12: ddlUserCategories.DataSource = CategoryManager.PopulateUserCategory(BasePage.UserID); 
 13: ddlUserCategories.DataTextField = "CategoryName"; 
 14: ddlUserCategories.DataValueField = "CategoryID"; 
 15: ddlUserCategories.AppendDataBoundItems = true; ddlUserCategories.DataBind();
 17: }
 19: }

Now just go through the code for ddlCategories_SelectedIndexChanged and ddlUserCategories_selectedIndexChanged

 1: protected void ddlCategories_SelectedIndexChanged(object sender, EventArgs e)
 2: { 
 3: int postID = Int32.Parse(Request.QueryString["postID"].ToString());
 4: string categoryName = ddlCategories.SelectedItem.ToString();
 5: CategoryManager.RemoveCategoryFromPost(categoryName, postID); 
 6: ddlCategories.Items.Clear(); 
 7: ddlCategories.Items.Add("RemoveExistingCategories...."); 
 8: ddlCategories.Items[0].Value = "-1"; 
 9: ddlCategories.DataSource = CategoryManager.PopulateCategoriesOfPost(postID); 
 10: ddlCategories.DataTextField = "CategoryName"; 
 11: ddlCategories.DataValueField = "CategoryID"; 
 12: ddlCategories.AppendDataBoundItems = true; 
 13: ddlCategories.SelectedIndex = 0; 
 14: ddlCategories.DataBind(); 
 15: } 
 18: protected void ddlUserCategories_SelectedIndexChanged(object sender, EventArgs e)
 19: {
 20: int postID = Int32.Parse(Request.QueryString["postID"].ToString()); 
 21: string categoryName = ddlUserCategories.SelectedItem.ToString(); 
 22: CategoryManager.AddCategoryToPost(categoryName, postID); 
 23: ddlUserCategories.SelectedIndex = 0; 
 24: ddlCategories.Items.Clear(); 
 25: ddlCategories.Items.Add("RemoveExistingCategories...."); 
 26: ddlCategories.Items[0].Value = "-1"; 
 27: ddlCategories.DataSource = CategoryManager.PopulateCategoriesOfPost(postID); 
 28: ddlCategories.DataTextField = "CategoryName"; 
 29: ddlCategories.DataValueField = "CategoryID"; 
 30: ddlCategories.AppendDataBoundItems = true; 
 31: ddlCategories.DataBind();
 32: }

In this donot forget to clear the items otherwise you will again get creepy results which are far beyond your expectations.

So the tip of the day is whenever you want to refresh your list with the new changed database values just clear the existing values and than only start inserting the most recent values from the database.

Some people will suggest to Disable the viewstate but i have tried that it can overcome the problem of appending values i.e it stops the appendingvalues which means now it will not remember your existing state but it will cause problems in the situation mentioned above so for me this is the best solution.

If you have a better solution do leave a comment.

Friday, October 17, 2008

CSS Property !important

There are basically two uses of !important css property

First use is when you want a particular style to be always applied if its also exist at some other place in the Cascading Style Sheets.

As the name suggests "Cascading Style Sheets" this means that the styles will cascade and the browser will render the styles which are applied at the last.

i.e if we have a <a> element in our markup and we define CSS like this:-

 1: a
 2: {
 3: font-size:20px;
 4: }

and than again at another position below than this if we define

 1: a
 2: {
 3: font-size:40px;
 4: }

So it will take font-size of <a> element as 40px not as 20px so if you want that for some elements the style should not change than you should give the a an !important attribute.

 1: a
 2: {
 3: font-size:20px !important;
 4: }

Another use of this came into existance with the CSS2.0 whenever a user gives his stylesheets properties a value containing this !important keyword than user's stylesheet properties override the author's style sheet properties.

Tuesday, October 14, 2008

Configuring Spaw2 Editor for .net applications

1.Simplest possible way to use spaw editor for .net is to just copy the directory spaw2 to the root of your web application.

2.Just rename the spaw2.default.config file to spaw2.config in the config folder in spaw2 directory.

3.Add reference to the toolbar selecting Solmetra.Spaw2.dll and you are ready to go.

Sunday, October 12, 2008

CSS Equivalent of CellSpacing

If you want to use solely CSS for styling the webpages then sometimes you might need the cellspacing property of table element which is not availiable in CSS.

So the CSS property equivalent to CellSpacing is Border-Spacing.

This can prove useful sometimes.




Saturday, October 11, 2008

Repeater Control - How to get formatted date as ouput on a page having Repeater Control

If you are tired of getting dates in your repeater control as shown in the following figure


and you want to get dates in some custom format then simply you can use the ToString() method with some parameters to convert it into desired format as shown below.


You just have to enter this small piece of code to achieve this



For further information on DateTime formats please visit this link

PowerMenu:- Very useful utility by which you can minimize any application to tray

  1. I am using Power Menu from years now it is a tiny but very useful utility especially its minimize to tray is the feature which i use the most.
  2. So i thought to share this with you all.



You can download power  menu from below given links:-

Installer --------

Portable Version--------

Friday, October 10, 2008

Websites to check whether your pages are served after compression or not.


These are among the few websites which can check and give you in detail picture of how your webpages are working with and without compression.

IIS compression using Gzip is preferred over the default deflate compression as browsers have gzip as their first search string thus pages with gzip loads faster although some people can argue that deflate is faster than gzip.

How to enable gzip compression in your static and dynamic pages this we will cover in the next article.

Given here are the results tested from on compression test of a dummy website.


Disabling IE Enhanced Security Configuration for WS2003

  1. Go to Add/Remove Windows Components in the Add/Remove Programs Dialogue Box and uncheck the Internet Explorer Enhanced Security Configurationieenhanced1

2.If uninstalling this feature also doesn't work for you then you can give this a try:-

   Go to  HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
if you find this entry and its value is 1 this means that IE Enhanced Security is enabled for the given user.So just play with the value and make it 0.This works in certain cases but not applicable to all just give it a try,test it and your comments are always welcome.