Thursday, June 21, 2012

Sql Query to Take DB into offline

HI All,
         -> One of my friend told me i.e after  Moving Content t'Db  of SP 2007 to SP 2010 environment  he is getting error, when restoring Sql back up file of SP 2003 to SP 2010 sql  .
        ->I connected to his PC and seen the way he restores the backup file and i find him doing in right way.I goggled for i.e solution ,And finally I came to knew i.e before moving the content DB of SP 2003 we need to but the SP 2003 content db  into Offline mode ,But he doesn't have permissions to take backup
     ->When he tries to but the DB in offile line it shows error as "Don't have admin permission" I used the
below  query  and it it kept the DB in offline

           Syntax
                     alter database database-name  set offline with rollback immediate
         example
          alter database WSS_Content_18c0de26c5a14be08d9bc142c288c976 set offline with rollback immediate

Thursday, June 14, 2012

Print Grid View

Hi All,
         Few of my Blog Members asked me code related to Print Grid-view 



step 1:  Create  html button

<input type="button" value="Print " id="bbtnPrint" runat="Server" onclick="javascript:CallPrint('name')"  visible="false"/>

Step 2: in the div tag use  grid-view

<div id=”name”>
   <table>

   </table>
</div>

step 3:Function Call

<script type="text/javascript">
    function CallPrint(strid)
            {
          var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'letf=0,top=0,width=600,height=500,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();
    }

</script>

Tuesday, June 12, 2012

New Web Application in Disable mode

Hi All,
One of my friend works on SP 2010,He has come ac-crossed to a situation where the option of new web application in central admin is in disable mode.Actually if we open I.E in Admin Mode it should be in enable ,But it is still in disable mode.Then I came to knew i.e during the installation he hadn't allotted Admin Permissions.The I came knew i.e lo-gin person doesn't have permissions to create web Application.
Solution

Thursday, June 7, 2012

Location of 14 hyve bin folder to Run Stsadm Commands


Hi All

I generally use Powershell Commands to work with SharePoint 2010 environment.
Recently while I had come across to the situation where I need to remove the content database of one SharePoint web application.
when I used the remove command as
stsadm.exe -o deletecontentdb -databasename WSS_Content_1234 -url http://servername:1234 using command prompt I am getting error as below
stsadm is not recognized as internal or external command
Then I came to knew i.e we need to go in the below location in command prompt and then use stsadm commands
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN