Microsoft.SharePoint.WebPartPages.WebPart is provided in MOSS 2007 to provide backwards compatability with MOSS 2003 webparts.
In MOSS 2007, it is recommended to use System.Web.UI.WebControls.WebParts.WebPart instead.
System.Web.UI.WebControls.WebParts.WebPart does not provides a feature to get or provide to to other webparts.
SharePoint 2010 Moss 2007 article all about to SharePoint coding best practice and SharePoint Services Features WebParts Timerjob central admin configuration sanboxed solution etc.
Showing posts with label Sharepoint stsadm. Show all posts
Showing posts with label Sharepoint stsadm. Show all posts
Tuesday, June 11, 2013
Client Object Model vs Server Object Model in SharePoint 2010
Client Object Model
Client object model is a new feature available in SharePoint 2010. .Client object model provides a way to do the programming for a SharePoint site using scripting language such as Java Script .
List list = context.Web.Lists.GetByTitle("Title");
Client object model is a new feature available in SharePoint 2010. .Client object model provides a way to do the programming for a SharePoint site using scripting language such as Java Script .
In Client object model an xml request will be sent and then server will return JSON which is changed to appropriate object model.
Mainly 2 assemblies to be referred while working with the Client object model.
Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll
Below is the code sample for a list object from SharePoint site using Client object model :
ClientContext context = new ClientContext("http://sp2010:2012");
context.Load(list);
context.ExecuteQuery();
So, what else a developer can do with Client object model. Client object model provide a way where you can access SharePoint data with scripting language such as Java Script.
You can write simple java script code to perform all those operation. You can use CAML query to access data from SharePoint site.
Using Client object model you can do below tasks:
Get list items, Add list items, Update list items and many more.
Client object model gives result in fast manner, but there is a limitation. The limitation is, we can not access Farm Object using Client object model.
For Client object model silverlight is also an option to program for a SharePoint site.
So if you want to access Farm object then use Server object model.
Server Object Model :
Server object model contains following classes : SPFarm, SPServer, SPSite, SPSiteCollection etc.
Below is the code Sample for Server Object Model:
This code is to get the list items from a SharePoint site:
using (SPSite oSite = new SPSite(@"http://sp2010:33051"))
{
using (SPWeb oWeb = oSite.RootWeb)
{
SPList oList = oWeb.Lists["List1"];
Console.WriteLine("Items in: " + oList);
foreach (SPListItem oItem in oList.Items)
{
string firstname = oItem["Fname"].ToString();
Console.WriteLine(firstname);
}
}
}
If you want more on Client object model or Server object model then please comment your query. Your comment will be highly appreciated.
Thursday, July 5, 2012
Sharepoint STSADM Interview Questions and Answers
What is sharepoint stsadm?
Stsadm ”stands for SharePoint Team Services Administration"
It is a Command-line tool used for administration of Office SharePoint 2007 (or MOSS 2007) servers and sites and even its not Not limited to administrative needs – can be extremely helpful to developers.
It is a Command-line tool used for administration of Office SharePoint 2007 (or MOSS 2007) servers and sites and even its not Not limited to administrative needs – can be extremely helpful to developers.
Where the sharepoint stsadm is it located?
You will normally find stsadm, under C:\Program Files\Common Files\ shared\web server extensions\12\bin.
Permissions are required to perform sharepoint stsadm operations?
To use Stsadm.exe, you must be a member of the local Administrators group for the server computer.
In addition to this you definitely need access to the required sharepoint databases so that you should not get any errors while deploying sharepoint solutions.
In addition to this you definitely need access to the required sharepoint databases so that you should not get any errors while deploying sharepoint solutions.
How to cancel a stsadm deployment if it is stuck at “deploying” or “Error”
You can either try to force execute timer jobs using execadmsvcjobs command or can cancel the deployment using stsadm command
"stsadm –o cancaldeployment –id {GUID} command."
The Id here would be GUID of the timer or deployment job. You can get the Id from stsadm enumdeployment command. This will display all the deployments which are inprocess or are stuck with Error.
"stsadm –o cancaldeployment –id {GUID} command."
The Id here would be GUID of the timer or deployment job. You can get the Id from stsadm enumdeployment command. This will display all the deployments which are inprocess or are stuck with Error.
How to perform operations on File system or registry of the server with stsadm command ?
Sharepoint Stsadm does not allow you to access file system or registry. It is a tool to perform administrative tasks for SharePoint farms only.
Backup and Restore sites with Sharepoint stsadm?
For backup using sharepoint stsadm
stsadm -o backup -url "http://Siteurl" -filename C:\Backup\BackupSite.bak
For Restore using sharepoint stsadm
stsadm -o restore -url "http://retsoredsite" -filename C:\Backup\BackupSite.bak
Is stsadm backup or restore different from Import or export?
Sharepoint Stsadm Backup or retsore allows you to backup either a site collection or a complete web application. It can also overwrite the exiting site collection for the destination url.
Export or Import - This operation allows you to backup or restore a site, sub site or a SPWeb instance. You can move this site or sub site under any existing site in your farm, across multiple site collections.
Is stsadm working with SharePoint 2010?
it was a rumors that new Power Shell 2.0 will replace the stsadm tool. but sharepoint 2010 fully supports the stsadm. but for the best practice always use powershell if you are using sharepoint 2010.
Related Article : Sharepoint Stsadm Commands List
Related Article : Sharepoint Stsadm Commands List
Subscribe to:
Posts (Atom)