Sunday, June 19, 2011

Finally we will have SharePoint 2010 Service Pack 1

Yes, finally Microsoft is releasing Service Pack 1 for SharePoint 2010. It is expected to get release by June end 2011, when it will be available for download.

People working on SharePoint 2010 are eagerly waiting for this with a hope that it will fix the bugs that they all encountered while working on SharePoint 2010. Though not all the lists of fixes are yet declared, but few additional functionality are already out of which the most interesting one will be Recycle Bin for Sites/Site Collections deletions. So keeping our finger crossed for this release.


Sunday, May 23, 2010

DataColumn.MaxLength not working in C#


Visual Studio Intellisense: Gets or Sets the maximum length of a text column.
MSDN: The maximum length of the column in characters. If the column has no maximum length, the value is –1 (default).

But most of the developers didn't able to get the desired result. It always returns -1. Microsoft has confirmed that this is a bug in the Microsoft products.

To resolve this, you need to set the "MissingSchemaAction" of "SqlDataAdapter" object. If you did not have it set, the ColumnLength property always returns -1.



string strQuery = "SELECT * FROM tbl_MyTable";
objConn = new SqlConnection(strConnString);
objCmd = new SqlCommand(strQuery, objConn);
objDA = new SqlDataAdapter(objCmd);
objDA.MissingSchemaAction = MissingSchemaAction.AddWithKey;
objDS = new DataSet();
int iCount = objDA.Fill(objDS);

Monday, May 17, 2010

When the heart is more beautiful than the face!!!

"One of my friend forwarded me an email with this beautiful story. It's awesome and so decided to share this through my blog."

The rain pouring out heavily invited me for a rendezvous but then I had a session. Just as I checked the time on my cell, the knock at the door announced the arrival.

The assistant informed me of the client and I asked her to send them in.. The couple in their late twenties. A second later the door opened again and I beckoned them to come in..

This man came in … straight out of Bollywood or rather Hollywood.

Accompanying this 6+ft guy was this lady… Very thin , and looking unwell.
I wondered what brought them here. They didn’t look like your usual battlefield couples that come for counseling. Generally when couples came in the first noticeable thing they did was pulling chairs apart. Here he pulled it closer. Asked her if she was fine. The body language suggested care and concern. I sat back amused and let them speak.

This couple was married about 10 years back. A love marriage.. Intercaste marriage they braved many storms to be together .Then a couple of years back destiny struck.

She was diagnosed with ovarian cancer..The disease took a toll on her, drained her physically and psychologically. Her husband stood like the rock of Gibralter.. A pillar of strength.


She now feels inadequate for various reasons. One her inability now to conceive, Two her looks that she thought was her identity and description She could not come to terms with the way she looked now. Her health was bad enough and her depression she thought was contagious spreading all around wherever she went.
She thought him too young to be saddled with problems and wished him a better life. She wanted a separation. She wanted him to move on with life..
She didn’t want to be responsible for ruining his youth, his future. She said she loved him and wanted to let him go… to live better.

The moment she said that I looked at her husband. He looked hurt. Deeply hurt.
This is what he had to say and this is what prompted me to write this blog:

“ I love her for what she is. Yes I liked her looks when I first met her but that was because that was the first noticeable thing, As I got to know her I realized how much more beautiful she is on the inside. I can never love anyone after I have experienced this beauty. Everyone else fails in comparison. What I see her as is her real self and to see her for her beauty you need to look through my eyes and not the mirror. The mirror has its set of lies and one of that is about her looks. To know her, look through me. I do not want any other happiness, I promised to be with her through thick and thin and I will be there no matter what. I will never leave her. She can throw me out , but I will continue living on the doorstep. I need her to know that these suggestions by her are an insult to my love. Is love only about looks?. Is beauty just about skin? If I were to go through the same would she leave me? I would never be able to do that. For me she is highly fecund , producing a higher degree love everytime I look at her. I love her truly and deeply and this is why I’m here to take your help and let her know the value of a relationship that goes beyond all these fallacies of appearances.”

What a magnanimous man!

I wasn’t the only one with tears, there was this beauty in front of me crying yet unaware of it. I excused myself and walked out.. I was glad they came to me though honestly all I did was listen to them but I saw a lovely example of true love. Their coming here was important for them and for me. To witness such love is a blessing.

These days when relations are so fragile and break at the slightest of excuses like:
She/ He is too fat
She can’t cook
She doesn’t work
He is hardly earning enough
We need space
He/She smokes/drinks
She isn’t glamourous enough
He/She can’t satisfy me
She/He doesn’t get along with inlaws , friends etc.

And many such excuses so inane , obfuscating the whole concept of marriages,just desperately searching a way out. This person purely defined something so perfect. Perfect love that transcends all these fallacies of looks.

This especially is so important when people marry only on the basis of looks. Yes the matrimonial columns are all about how slim and beautiful your bride needs to be. But then one must realize that EXTERNAL BEAUTY IS SO TEMPORARY. Beauty is just skin depth.. The true beauty lies within. Appreciate that and see love blossom.

Sunday, May 16, 2010

How to rename SharePoint Server?

Sometimes you may need to rename your Computer Name where SharePoint is installed. This also applies to Virtual Machines. I recently tried to do this, but after doing that, I found that SharePoint is not working. So I need to do few activities to bring it back, which I have been listed below:

Step 1: Rename my Computer/Server from My Computer -> Properties -> Computer Name - Change... -> Restart

Step 2: stsadm –o renameserver

Step 3: stsadm –o updatefarmcredentials

Step 4: Restart IIS

Step 5: Update all identity accounts(basically machine names) in IIS

Step 6: stsadm.exe -o setconfigdb

Step 7: All Programs -> Microsoft Office Server -> SharePoint Product and Technologies Configuration Wizard

Step 8 Open Central Admin and change Alternate Access Mappings, wherever applicable.

You are done. I found few other steps also while goggling. But the above steps work for me. The following references may help in case there are some issues:

Monday, March 15, 2010

SharePoint SPSite.AllowUnsafeUpdates

The Microsoft idea behind introducing the AllowUnsafeUpdates property is to protect you from cross-site scripting attacks.

MSDN Definition: Gets or sets a Boolean value that specifies whether to allow updates to the database as a result of a GET request or without requiring a security validation. Setting this property to true opens security risks, potentially introducing cross-site scripting vulnerabilities.

If you try to do any updates to lists, webs or any SharePoint objects that require an SPSite to be created first, you need to set AllowUnsafeUpdates to TRUE, otherwise it will through an error saying "System.Exception: Microsoft.SharePoint.SPException: The security validation for this page is invalid."

In order for the AllowUnsafeUpdates to work, that the Update method of the SPSite object needs to be called as well:

SPSite.AllowUnsafeUpdates = true;

Also, you may want to try using a POST, rather than a GET in order to avoid having to set this property. If your code is processing a POST request then make sure you call SPUtility.ValidateFormDigest() before you do anything else. This will ensure that the post request is validated (that it is not a cross-site scripting attack) and after that you will not have to worry about AllowUnsafeUpdates, because its default value will be “true” after the form digest is validated.

If the HTTPContext.Current is null then AllowSafeUpdates will be always true. This is the case in rich clients where no cross-scripting is possible as there are simply no web requests.

When any object that implements ISecurable (those are SPWeb, SPList and SPListItem) breaks or reverts their role definition inheritance. This means every time you call SPRoleDefinitionCollection.BreakInheritance(), BreakRoleInheritance(), ResetRoleInheritance() or set the value of HasUniquePerm the AllowUnsafeUpdates property of the parent web will reset to its default value and you may need to set it back to true in order to do further updates to the same objects. So always set AllowUnsafeUpdates back to true after you break inheritance in an environment with HTTPContext.

Additional References: