Archive for the ‘Sharepoint’ Category

Download the Sharepoint List Attachment

May 28, 2011 Leave a comment

You can download the attachment from the any SharePoint List to your local drive in your Server using the following code. Based on the article from Microsoft “How to Pro grammatically Download attachment from list items in WSS” i iterate the list item and also i checked for Exist of attachment for each list item.

Inherited Web-part Class and create the button control and attach the click event, in the “CreateChildControls” method as below code

(Click on above image to Enlarge the Image)

Now write the code to download the attachment from the List as below in the Button Click event Method

(Click on above image to Enlarge the Image)
Now you create a custom web-part for download the attachment of the list. Create Strong key and build the class deploy it in your Server and update the Web.Config. Add it in web-part gallery and edit the page select the web-part to download attachment. that it. When you click on the web-part, it will automatically download all attachment to the specified path.

Categories: Sharepoint

Programatically copy document from list to library

May 28, 2011 Leave a comment

Using this below code you can copy the document from list to library, with in the same web application. The logic is as below

Categories: Sharepoint

Stsadm operations

May 16, 2011 Leave a comment

· Activatefeature
Activates a feature in the feature collection.
· Addalternatedomain
Adds an internal URL and maps it to one of the five URL zones of a Web application or external resource.
· Addcontentdb
Creates a new content database or adds a database that needs to be upgraded when the url and databasename parameters are specified.
· Adddataconnectionfile
Adds a new DataConnectionFile to the DataConnectionFiles collection for InfoPath Forms Services.
· Add-ecsfiletrustedlocation
Lets an administrator add a file to the trusted location list.
· Add-ecssafedataprovider
Lets an administrator add a supported provider type to the safe provider list.
· Add-ecstrusteddataconnectionlibrary
Adds a trusted data connection to a library.
· Add-ecsuserdefinedfunction
Adds a user defined function.
· Addexemptuseragent
Adds a user agent, which is typically in the form of a search bot, to receive the XML file that contains the data of the form for indexing instead of the HTML rendering of the form.
· Addpath
Adds a managed path inclusion to a Web application.
· Addpermissionpolicy
Adds a user to a policy role for the Web application based on the specified permission level name and corresponding zone.
· Addsolution
Adds a solution file to the solution store.
· Addtemplate
Adds a site template to the template gallery.
· Adduser
Adds a user account to the specified site collection and assigns it to the specified site group.
· Authentication
Authentication provides the user identity input to the authorization process which determines what actions the current user is allowed to perform on a given object.
· Backup
Describes how to back up a site collection, an individual database, a Web application, or an entire farm.
· Backuphistory
Displays a history of backup and restore operations that have been run.
· Creategroup
Lets site collection administrators create new groups from any site collection.
· Createsite
Creates a site collection at the specified Uniform Resource Locator (URL) with the specified user as site collection owner and site collection administrator.
· Deletecontentdb
Detaches a content database when the Web application, database name, and database server are specified.
· Deleteconfigdb
Unprovisions the local machine from the farm and deletes the configuration database (but does not drop the configuration database).
· Deletegroup
Deletes a group created in Microsoft Office SharePoint Server 2007.
· Deletesite
Deletes the site collection with the specified URL from the Web application.
· Deletesolution
Removes a Windows SharePoint Services Solution Package (*.wsp) from the solution store.
· Deletessp
Deletes a Shared Services Provider (SSP) in a Web application when the title parameter is specified.
· Deletessptimerjob
Deletes all of the timer jobs in the Shared Services Provider (SSP).
· Deletetemplate
Deletes a specified site template from the site template gallery.
· Deleteuser
Deletes a user account from the specified site collection and specified site.
· Deleteweb
Deletes a subsite using the specified Uniform Resource Locator (URL).
· Deploysolution
Deploys files related to a solution from the configuration database to individual front-end Web servers in the farm.
· Displaysolution
Displays specific solution or Web Part information in a solution store.
· Editssp
Allows the site collection administrator for the Shared Services Administration site to perform the following functions:
· Change the databases that a Shared Services Provider (SSP) uses.
· Change the SQL credentials associated with the SSP databases.
· Modify the service account credentials.
· Rename an SSP
· Email
Sets the e-mail configuration settings for your server.
· Export
Exports site and subsite data from your Microsoft Office SharePoint Server 2007 installation.
· Import
Imports site and subsite data from your Microsoft Office SharePoint Server 2007 installation.
· Installfeature
Installs a feature.
· Renameserver
Changes the name of the specified server in the configuration database.
· Renamesite
Changes a URL of a host-named site collection to a new URL.
· Renameweb
Changes the URL of a subsite.
· Restore
Explains how a restoration of a site collection, an individual database, a Web application, or an entire farm is performed.
· Restoressp
Creates a Shared Service Provider using a restored database.
· Retractsolution
Retracts the specified solution’s deployment, and removes files from the front-end Web server.
· Scanforfeatures
Scans for new features in the file system, and if new features are present, installs them.
· Setconfigdb
Creates a new configuration database in a farm or joins the local computer to an existing farm’s configuration database.
· Setdefaultssp
Sets a Shared Services Provider (SSP) as the default SSP in a farm.
· Setlogginglevel
Sets the Windows event log and trace log logging level for one or more diagnostic logging categories registered in the farm.
· Setsitelock
Sets a value that specifies whether the site collection is locked and unavailable for read or write access.
· Siteowner
Sets the primary or secondary administrator of a site collection.
· Setworkflowconfig
Enables or disables the workflow settings
· Upgradesolution
Upgrades an existing solution. The solution to be upgraded could be either deployed or not deployed; however, the immediate or time parameters apply only if the solution has been deployed.
· Userrole
Adds or deletes permission levels to site groups.

Categories: Sharepoint

Fetch the Sharepoint ListItem value directly from SQL Server

April 8, 2010 Leave a comment


    Are you looking to get the ListItem Values from the sharepoint List directly from the Sql Server, If you know List Name or List GUID then you can get the values.  Use the below query and replace the GUID or Listname in where part of the Sql query










dbo.UserData.tp_ListId = ‘{A1E60AA0-2A83-4CE5-AB2D-E22236206772}’

(or another type)

select dbo







dbo.Lists innerjoin dbo.UserData on dbo.Lists.tp_ID=dbo.UserData.tp_ListIdwhere



Categories: Sharepoint

Sharepoint 2010 Remote Server return No data Exception

January 22, 2010 Leave a comment

When i use Sharepoint and Silverlight, i face the Communication exception.” Remote server returned an error : Not Found “, it will not tell the reason for the exception causes. Few reasons for exception occurs

1)  Check you have permission to access the sharepoint site.

2) Check you SQL database have proper permission to access data

3) Otherwise the value you are passing is not match in sharepoite service, Make sure that you are pass the correct value

Please feel free to place you questions 🙂

Categories: Sharepoint
%d bloggers like this: