If somebody like the post and its helpful in your work then, add comments.

Wednesday, August 25, 2010

SharePoint Database when set to status ‘Suspect’


Today my SharePoint 2010 Admin database automatically set to status Suspect.


I search for that issue and I got the solution which is below

EXEC sp_resetstatus 'SharePoint_AdminContent_c92d3a99-1800-4cac-b986-7e380ea42454'

ALTER DATABASE [SharePoint_AdminContent_c92d3a99-1800-4cac-b986-7e380ea42454] SET EMERGENCY

DBCC checkdb('SharePoint_AdminContent_c92d3a99-1800-4cac-b986-7e380ea42454')

ALTER DATABASE [SharePoint_AdminContent_c92d3a99-1800-4cac-b986-7e380ea42454] SET SINGLE_USER WITH ROLLBACK IMMEDIATE

DBCC CheckDB ('SharePoint_AdminContent_c92d3a99-1800-4cac-b986-7e380ea42454', REPAIR_ALLOW_DATA_LOSS)

ALTER DATABASE [SharePoint_AdminContent_c92d3a99-1800-4cac-b986-7e380ea42454] SET MULTI_USER

Thursday, August 19, 2010

SharePoint Web Part Development

Hi again,

Now these days I am working for the SharePoint 2010 internet facing or public facing publishing site. No doubt's we are using the OOTB publishing features of the SharePoint 2010 publishing, content types, approval workflows etc.

Well, in that site I am developing the custom web parts for the site in the Visual Studio 2010 version 10.0.30319.1 RTMRel. In this or before VS 2010 we have the .net framework 3.0 in which HtmlGenericControl which is present in the System.Web.UI.HtmlControls namespace. It will help us to build the custom UI for the web part instead of maintaining HTML in the web part and render to output(HTMLTextWriter).

You can create any of the HTML tag from HtmlGenericControl this like div, table, table row, table column and that will be very easy to manage in the code.

How this will work ?

In the code we have to add reference for the control and declare the HtmlGenericControl control in the class like :

HtmlGenericControl divSponser_Blogs_Contatiner;
In the CreateChildControl or any method where you are creating the UI for the web part you can instantiate it.

divSponser_Blogs_Contatiner = new HtmlGenericControl("div");
You can also set its properties like CSS class or its attributes in the control after instantiate.

divSponser_Blogs_Contatiner.Attributes.Add("class", "Sponser-Blogs-Contatiner");

or like

divSponser_Blogs_Contatiner.Attributes.Add("id", "Sponser_Blogs_Contatiner");
if you wnat to create table from HtmlGenericControl then you have to just replace div with table.

divSponser_Blogs_Contatiner = new HtmlGenericControl("table");
Well this post will help you to create rich UI web parts for the SharePoint and it will also make easy to mage and create the custom web parts from the .net framework.