Sunday, March 27, 2011

SPSite: FileNotFoundException was unhandled

I create a console project in Visual Studio 2010.

After adding a reference to Miscrosoft.SharePoint, I add following code in the project:



When it opens a SPSite, FileNotFoundException is thrown as below:


Since the console project set the Platfrom target is X86 as default and I run the project under X64 environment. Therefore, I need to update the Platform target to x64.

1. Right click the project
2. Click Properties
3. Click Build and update the value in Platfrom target


Saturday, March 26, 2011

Enable to browse html file

I upload html files to a document library, then I try to open a html file. A file download message is shown below:


How can I browse the html file in SharePoint directly?

1. Go to Central Admin\Application Management\Manage Web Applications
2. Select General Setting for the SharePoint Web Application
3. Select permissive under Browser File Handling



Birt Viewer: Cannot load JDBC Driver class

In eclipse, I map an odbc driver  to a Birt report when I add a postgresql data source. It works fine under eclipse's web preview.Then I copy the project to the folder of birt viewer under Tomcat. 

An error message is shown : org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: 

Tomcat cannot find the odbc driver of postgresql. After searching, I discover Tomcat do not share odbc drivers with eclipse, so I need to add the driver to Tomcat separately. The path is shown below: 

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\birt-viewer\WEB-INF\platform\plugins\org.eclipse.birt.report.data.oda.jdbc_2.6.0.v20100524


Saturday, March 5, 2011

CAML Query: FieldRef Element

The CAML  FieldRef contains DisplayName and Name respectively.

DisplayName refers to the name shows in the browser.


Name refers to the internal name which cannot be changed once you create it. If you do not modify it before, Display and Name are the same. 

On the other hand, if you modify it, you can find the Name through the link shown in the browser.First, you can click the column that you want to know its Name. Then, you will discover that the link shown in the browser have changed. 


In the above picture, the value of SortField equals the Name of the column.
In the CAML Query, it uses Name to search items only. Therefore, do not use DisplayName to do a query.



REST: Data service client code-generation failed: Schema specified is not valid

When I add REST Interface as a service reference in a c# projcet, an error message is shown below:


In the above message, it tells me that "Schema specified is not valid". "__x_notify_Item" is invalid"  shows that a list named "__x_notify" contains some special characters which is not accepted by the schema. 



Delete the specified list, the problem will be solved.