Monday, February 7, 2011

The backup set holds a backup of a database other than the existing

The below sql error usually comes while taking SQL Server backup. Error message is:
System.Data.SqlClient.SqlError; The backup set holds a backup of a database other than the existing.

Solution:
You can run the in the browser the following command

RESTORE DATABASE AdventureWorks
FROM DISK = 'C:\BackupAdventureworks.bak'
WITH REPLACE

Or Go to options and check Overwrite the existing database from the database restore window.

Friday, February 4, 2011

The Sharepoint 2010 interface

The user interface has been changed drastically like Menus has been changed and moved around. Some has been hides unless until you will keep mouse on it. It also has Ribbon and AJAX dialogs and notifications. The Ribbon is the new combined menu and toolbar and is based on user's context. It has no of tabs and these are contextual and appears when needed. SharePoint interface uses AJAX based dialog framework to avoid postbacks and make the web interface faster and more accessible. Like You will able to see a pop up while you will edit a list rather take you to another page. Also it gives a status bar for notifications below the ribbon.

It also provides a silverlight web part which allows add a silverlight application to your site.
XsltListView Web part in also new in sharepoint 2010.

Some of the outbox web parts in sharepoint 2010:

Filter web parts: Text fileter, Current user filter, data filter, Querystring filter, Page field filter
Also have media web part, Navigation web part like Sites in category, Categories, Tag cloud, Summery links, Table of contents (contanets site map). People web parts like Contact details, Organization browser, Note board. Also comes with My Information web part like My mail folder, My calendar, My contacts, My Inbox, My Task etc.

One of the measure component comes with SharePoint 2010 is the Visual WebPart. Visual web part is a web part that uses a user control to build the user interface.

Wednesday, February 2, 2011

How to write code tag in blogger

There are different ways to post code inside blogger, But the most efficient way I feel is

Go to this link and put code and parse it and then paste the parse code as it is. Then blogger will render your code perfectly.

How to use log4net in sharepoint 2010?

Introduction:
In this article we will discuss how can we use Log4Net in our SharePoint 2010 application. You can visit article how to use Log4Net in Asp.Net.

You can download the log4net dll from here. The next step is to deploy the log4net DLL to the GAC. Then open the web.config present in the port no 80.
Put the below code before the end tag like

<!--Section Added by Bijay Kumar for Log4Net-->
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>

The following module was built either with optimizations enabled or without debug information in vs 2010

I was getting the below error "The following module was built either with optimization enabled or without debug information in Visual Studio 2010
C:\windows\microsoft.net\Framework\v2.0.50727\Temporary ASP.NET Files\ ......

I have done an work around for the same so that I will get that message

Go to Tools ->Options ->Debugging ->General ->Uncheck(Enable Just My Code(Managed Only))

I hope this will work. You can also check out some SharePoint errors and solutions.

Tuesday, February 1, 2011

How to change the local deployment URL for a visual web part in sharepoint 2010?

In this post we will discuss how to change the local deployment URL for a visual web part in sharepoint 2010?

Also you can check out some posts on:

- Difference between site pages and application pages in SharePoint 2010

- How to create a Site Definition using Visual studio 2010 in SharePoint 2010?

- Add script reference dynamically through code in SharePoint

I am currently developing some custom web parts using Visual Studio 2010 for my SharePoint 2010 project. I have deployed the web parts by giving by local site url. Then i try to change that URL to another site collection.

I have spent the whole 7 hrs, trying to deploy but unable to do. Finally got to know where to change the URL of the local deployment URL.

Open the properties not (right click properties) never do that, Simple select the project then click the icon for the properties window near solution explorer, team explorer etc. Also you can select the project and press F4.

It will open with options like Active Deployment configuration, Assembly deployment Target, Project File, Sandboxed solution, Site URL. This Site url you have to change.