Wednesday, November 24, 2010

How to fix error "Cannot connect to the configuration database"

When you try to view your Microsoft Windows SharePoint Services 2.0 Web site, you receive the following error message: Cannot connect to the configuration database.



Please read this KB to know how to fix this error: http://support.microsoft.com/kb/823287

On that KB, Microsoft explains 4 situations may happen that error and lead to verify on your system. But another reason was found and often causes if you are running on SharePoint Farm or using Domain account to configure out the SharePoint.

1) On SharePoint Farm

You should check on your server in which hosting SharePoint Central Admin the Local Users & Groups to find out whether any account did not deduce to fullname account. That means each of account in Local Users & Groups must be show full name of that account and you will see them very clearly. 

For example: when you get the error "cannot connect to the configuration database", let do the following instruction. 
-> from Start Menu -> Run -> type compmgmt.msc then Enter. After windows opens, expand Local Users & Group, click to open Groups, and then double-click on any group. You will see the error like that:



Because the domain account did not deduce on your system, so SharePoint can not connect to SQL server and that error happens.

For double-hop, you should verify this thing both on SQL machine where is hosting your SQL and SharePoint Central Admin.

Note: Don't try to remove that account and re-add them.

To fix this issue, just disconnect both your system from your domain and join to the domain again.

2) On Single Server using Internal DataBase (connect to MICROSOFT##SSEE)

If on single server happens this issue, please remove the account to connect to SQL group in Local Users & Groups. Find in all SQL groups and WSS/MOSS group and remove that account out of group, then add this account into that group again.

Good luck.

Saturday, November 13, 2010

How to connect to MICROSOFT##SSEE (Windows Internal Database)

When we run the wizard configuration for SharePoint, we have 2 options to install: Web Front-End and Standard. For Web Front-End, we will use a specific SQL server, database and account to login. For standard, we needn't install SQL Server, so we won't specify SQL Server name, database and account, SharePoint will install a minimum SQL server with windows authentication. You never know what the server name is, however, you can open Registy Editor to see the currently server name SharePoint is using.

[To open Registry Editor from Windows Start -> Run -> type Regedit and then press Enter] Expand the following path:

[SharePoint 2007] HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB

[SharePoint 2010] HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB

On the left handsite, you will see the property DNS with the value like this:

Data Source=WSS2K3X86Final\Microsoft##SSEE;Initial Catalog=SharePoint_Config_d3e9e3d0-4d67-48fb-9242-4e46b0021086;Integrated Security=True;Enlist=False

Yeah, for now you can install SQL Server on that server to try to connect to SharePoint Standard server with  server name above. The result is "can not connect to database server"!

In fact, SSEE means SharePoint Service Embedded Edition server, it's connected through Name Pipe. To find out the name pipe server, the following step to show you.

1) Run SQL Server Configuration Manager:

The Windows Internal Database is connecting to MICROSOFT##SSEE is currently to use for SharePoint. Now, click on Protocols for Microsoft##SSEE

2) The name pipe shows as following picture:



3) Double click on Name Pipes to see the server link to connect:


Now, you can connect to \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

Friday, November 12, 2010

How to Customize the Document Set Ribbon

In this article, we will extend that sample by adding a new menu to download all files in the Document Set, check out selected files, check in selected files and send selected files as links.  We will walk through the example, and we will also provide a finished program and scripts that you can use to upload in your SharePoint server.

Here is Full Blog :

http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/11/12/sharepoint-2010-cookbook-customize-the-document-set-ribbon.aspx

Thursday, November 4, 2010

25 ways to be healthier / 25 cách để sống khỏe hơn.



1.)      Brush twice a day!

2.)    Dress right for the weather.


3.)
      Visit the dentist regularly.  



4.)
   Get plenty of rest.


5.)
       Make sure your hair is dry before going outside..

 

6.)
     Eat right.



7.)
     Get outside in the sun every once in a while.



8.)
      Always wear a seatbelt.



9.)
   Control your drinking of alcoholic beverages.





10.)
  Smile!  It will make you feel better.

 

11.)
    Don't over indulge yourself.




12.)
   Bathe regularly.





13.)
   Read to exercise the brain.





14.)
  Surround yourself with friends.





15.)
   Stay away from too much caffeine.





16.)
  Use the bathroom regularly.

 



17.)
  Get plenty of exercise.



18.)
   Have your eyes checked regularly.



 19.)
  Eat plenty of vegetables


20.)
Believe that people will like you for who you are.


21.)
   Forgive and forget.


 22.)
  Take plenty of vacations



23.)
  Celebrate all special occasions.


24.)  Pick up a hobby.



25.)
Love your neighbor as yourself. 


                
 Send this to your
computer buds to give them a warm fuzzy! 



Pictures: copy from the internet. Relax!

Monday, October 25, 2010

Error: File not found when address the site with full computer name

Today, I have an interesting thing while I am working on SharePoint. My co-worker gets an error when he try to access the SharePoint site by IP address. Of course, he can fix this issue, that means it's so easy, at least with him. However, it still shows error if I address to his site with full computer name. You know, when your computer join to the domain, then your computer's fullname is your computer name dot domain name.

In this example, my computer name is htserver2k8x64 (or vm_moss2007x64), when I join to the domain with named "tuan-tomy-blogspot.vn" then my computer's fullname is "vm_moss2007x64.tuan-tomy-blogspot.vn". The problem is if I browse my site from http://vm_moss2007x64 or http://htserver2k8x64 (for windows server 2008, 64 bits), everything works fine. After that I changed to http://vm_moss2007x64.tuan-tomy-blogspot.vn, with the team site without my web part that everything is fine again. But if in the team site included my web part already, I got an error like this:

Then, I removed my web part out web part zone, then added my web part again, I got another error:


Yeah! for now I just did the following SharePoint instruction. In this case, I must add new alternating access mapping in the Central Admin.
Go to Options -> Alternating Access Mapping -> Add internal URL for Port 80 ( I am working on Port 80)

Then you will see 2 internal url can access to the same web application:

For now, you can access the site by http://vm_moss2007x64 or http://vm_moss2007x64.tuan-tomy-blogspot.vn without any error.

------------------
For another solutions, you can modify the Host header of your site in IIS:


This solutions is also resolved this issue.


Error: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again

Today, I try to create a hidden list and then get its schema. My purpose is to know how many columns in each of list type. But I did not logged in the site by owner, just used  Contribute account to do creating. Unfornately, Contribute account does not have the right to create a new list, only can create a new view or new item in the list. So, I get the error if I try to create:

[COMException (0x8102006d): The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.]


Now, take a look at my code:

After search on the internet, I read the blog from: Tushar Parikh. He recommended to re-config Security of the Web Application:

Central Administration -> Application Management -> Web Application General Settings ->Select web application

In Web Page Security Validation , change security validation is off. 


I tried the following his instruction and it worked for me, but the another problem is just worked for PostBack page. But in recent, my page is running under ajaxified. So, I must turn the security validation on. But I found another blog and I resolved the problem.

Here is the blog:
http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/05/15/when-allowunsafeupdates-doesn-t-work.aspx

My code was changed:

AllowUnsafeUpdates property is very useful if you want to update the property bag of Web or Site object. It takes me 1 hour to research and fix the problem... Thanks for all

Monday, October 18, 2010

How is the Attachment column worked in CAML query?

It took me a few minutes to fix this issue.

SharePoint did not allow you filter the value of attachment column with another value except for "Yes" or "No". But when you bind data into a gridview with filtering option is ON, user still can type or filter this column with another value, for example: Greater than "5" or Less Than "OK"

1) Greater Than "5" Our CAML query is


Result: No record is displayed. That would be nice. But when you change Less Than "5", it would be:



You know, with Attachments column, if the item has an attachment, its value is 1 and otherwise is 0. So, the CAML query is less than "5" matched with items which have both an attachment and none. That's very funny.


2) Less Than "OK"




I really dont know how the SharePoint parsed this value, but it will show data with items which has no attachment.

Conclusion: When you want to return "No record" if user filters with the value different from "Yes" / "No" or "1" / "0" the value in CAML query must be "." (dot) 

Yeap. It worked for me now.




Wednesday, October 13, 2010

Best Practices for Writing JavaScript in SharePoint 2010

JavaScript is an important part of building any interactive website, and SharePoint is certainly no exception. With SharePoint, JavaScript is often used to execute code on the client and it is usually designed to affect only one specific Web Part, as opposed to affecting an entire page. So, in a typical SharePoint page where there are many Web Parts in a zone, it's very easy to mistakenly write Java code that affects another Web Part.  The potential for such conflicts is unavoidable, so this article details some best practices for working on JavaScript and SharePoint Web Parts in SharePoint 2010.

http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/10/14/best-practices-for-writing-javascript-in-sharepoint-2010.aspx


Full article here

Tuesday, October 12, 2010

Error javascript if RadGrid binds data with Ajaxified and filtering is ON (SharePoint 2010)

Problem:


I have an UI to allow user to select a list and bind the data into grdiview. The button create will run under Ajax.

If you are using RadGrid with ajaxified in the package Telerik.Web.UI.Dll (2010.1.415.35), but did not bind the data into grid until the configuration finished, you will get the error like this: (this error just happens with filtering function is ON).

Note: Just happen on SharePoint 2010 (both of SharePoint Foundation and Office SharePoint Server)



In fact, you still see the data on gridview but some functions on grid did not work correctl such as the filtering menu is stopped working.



Symptom:

After binding data, RadGrid added a lot of javascript resources in page need to run all functions. However, these resources will not be added after binding data under ajaxified.



Solutions:

When the setting page is showing, we bind the empty data (because the grid view does not show on the page, so we can bind with any data), here I am using a simple data with one column)

//This code should be put in OnLoad() method
//and just run for the first time
//when we click on Create button, the radGrid will bind from table after collecting data
//and these code will bypassed.

if (!Page.IsPostBack)
{
   DataTable tb = new DataTable();
   tb.Columns.Add("col1");
   GridDataBound col = new GridDataBound()
   col.HeaderText = "Col1";
   col.DataField = "Col1";
   col.UniqueCol = "Col1";

   radGrid.Columns.Clear();
   radGrid.MasterTableView.Columns.Add(col);
   radGrid.DataSource = tb;
   radGrid.DataBind();
}


//Events for create button
 protected void Create_Click(object sender, EventArgs e)
{
   //Collecting data
   radGrid.DataSource = tb;
   radGrid.DataBind();
}

The purpose to bind data at the first time is to generate the JavaScript resources by RadGrid. The next step is running under Ajax, so these resource will not update after that. But we can use the filtering function correctly.