Wed 19 Feb 2014

I have came through below wiki article on Microsoft technet, which have a nice collection of eBooks and articles on Microsoft Technologies.

Download content for SharePoint, Lync, MS Office, SQL Server, System Center, Visual Studio, Web Development (asp.net), Windows Server, Window Azure, Windows Phone and other Microsoft technologies in e-book formats (references, guide, and step-by-step).

 

E-Book Gallery for Microsoft Technologies

 

Source: social.technet.microsoft.com/wiki/contents/articles/11608.e-book-gallery-for-microsoft-technologies.aspx (Monica Rush)
Source: mstechtalk.com/collection-of-e-book-and-articles-on-microsoft-technologies/ (Adnan Amin)

 

E-mail this post to someone or Comments here
Tue 26 Mar 2013

In last days, I was trying to restore SharePoint web application backup using PowerShell, but run into following error (although my sharepoint version was newer then the backup version)

Restore-SPSite : Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5138' or later.

Following is the quick overview / steps which I followed and successfully restored the SharePoint backup. Might be this could be applicable in your case

If you have the source database files (mdf and ldf) not the SharePoint backup file then follow step 2, otherwise step 1 and 2

Step 1.

  • Create a virtual machine if you don’t have

  • Install SharePoint on that vm if your don’t have it on that vm

  • Make the environment version same by installing the same cumulative update(s) which source server has. Once the server has the same version as of the backup, in my case it was (14.0.0.5138). (to check SharePoint version central administration -> upgrade and migration -> check product and patch installation)

  • Create new web application and Restore the SharePoint backup.

  • In sql server, detach the restored SharePoint database and physically copy database files (mdf and ldf)

 

Step 2.

On SharePoint environment where you want to restore the backup (this SharePoint version obviously needs to be later version, in my case it was 14.0.6029.1000)

  • Create web application (no need to create site collection) (central administration -> application management -> manage web application-> new)

  • Remove content database of newly created web application (central administration -> application management -> manage content database -> choose web application from the dropdown -> click on database name -> choose offline from database status and check mark Remove content database) (make sure you have selected the newly created web application and its content database)

  • In sql server, detach that content database of newly created web application

  • Physically replace the detached content database files (mdf and ldf) from the SharePoint backup's mdf/ldf file (which were taken from step1 or from the original server / source)

  • Attach Database (while attaching, after selecting mdf file, Change the Database name as of file name in Database to Attach's -> Attach As textbox, then on same screen, select/browse both mdf and ldf file in database details section -> Current File Path)

  • Open SharePoint 2010 Management Shell, and add content database using following command
    stsadm -o addcontentdb -url <URL name> -databasename <database name>

  • Then follow remaining application specific restore steps (for e.g. change site collection administrators, changes in web.config, add or change global resource files etc.)

Then access web application, hope so it would restored successfully

 

E-mail this post to someone or Comments here
Sun 30 May 2010

Query to find all the Tables and Index with number of days statistics being old. Then run Update Statistics command to update statictics for optimized query plan.

SELECT
OBJECT_NAME(A.object_id) AS Object_Name,
A.name AS index_name,
STATS_DATE(A.OBJECT_ID, index_id) AS StatsUpdated ,
DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),
getdate()) DaysOld
FROM sys.indexes A
INNER JOIN sys.tables B ON A.object_id = B.object_id
WHERE A.name IS NOT NULL
ORDER BY DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),getdate()) DESC

 

E-mail this post to someone or Comments here
Fri 28 Aug 2009

Yesterday, after restoring CRM DB backup on other maching and importing Organization using Deployment Manager of CRM 4.0, I received this error.

The SELECT permission was denied on the object 'BuildVersion', database 'MicrosoftCRM_MSCRM', schema 'dbo'
or the variation
The SELECT permission was denied on the object 'SystemUser', database 'MicrosoftCRM_MSCRM', schema 'dbo'

If you have tried changing the owner of new database with admin login making it as dbowner but did not help then following may help solving this problem

Right click the affected object (table/view etc) in my case it was 'BuildVersion' and 'SystemUser' in SQL Server Management Studio,
click on properties
click on "Permissions" on left tab
click on "View schema permission" link on right tab
click on "Add" button,
click on "Browse" 
select "CRMReaderRole" of type Database role.
click ok,
click ok,
now you will be again in object properties.
Place check mark in "Grant" column against "Select" permission
click ok

Now check hope so it has been resolved.

================

To change the dbowner command is (If required)

use <CRMDatabaseThatYouNeedToChangeTheOwner>
exec sp_changedbowner 'DOMAIN\AdministratorMappedWithCrmAdmin'
go


===============

E-mail this post to someone or Comments (2)
Thu 1 Jan 2009

 Microsoft Application Architecture Guide 2.0‏.  Nice stuff for those who are interested in Application architecture at http://www.codeplex.com/AppArchGuide

Summary :

Parts

Part I, Fundamentals
Part II, Design
Part III, Layers
Part IV, Archetypes

Forewords

*   Foreword by S. Somasegar

*   Foreword by Scott Guthrie

Chapters

*   Introduction

*   Architecture and Design Solutions At a Glance

*   Fast Track

Part I, Fundamentals

*   Chapter 1 - Fundamentals of Application Architecture

*   Chapter 2 - .NET Platform Overview

*   Chapter 3 - Architecture and Design Guidelines

Part II, Design

*   Chapter 4 - Designing Your Architecture

*   Chapter 5 - Deployment Patterns

*   Chapter 6 - Architectural Styles

*   Chapter 7 - Quality Attributes

*   Chapter 8 - Communication Guidelines

Part III, Layers

*   Chapter 9 - Layers and Tiers

*   Chapter 10 - Presentation Layer Guidelines

*   Chapter 11 - Business Layer Guidelines

*   Chapter 12 - Data Access Layer Guidelines

*   Chapter 13 - Service Layer Guidelines

Part IV, Archetypes

*   Chapter 14 - Application Archetypes

*   Chapter 15 - Web Applications

*   Chapter 16 - Rich Internet Applications (RIA)

*   Chapter 17 - Rich Client Applications

*   Chapter 18 - Services

*   Chapter 19 - Mobile Applications

*   Chapter 20 - Office Business Applications (OBA)

*   Chapter 21 - SharePoint Line-Of-Business (LOB) Applications

Appendix

*   Cheat Sheet - patterns & practices Pattern Catalog

*   Cheat Sheet - Presentation Technology Matrix

*   Cheat Sheet - Data Access Technology Matrix

*   Cheat Sheet - Workflow Technology Matrix

*   Cheat Sheet - Integration Technology Matrix

Errata Page

*   Errata Page

Team

*   Core Dev Team: J.D. Meier , Alex Homer, David Hill, Jason Taylor , Prashant Bansode , Lonnie Wall, Rob Boucher Jr, Akshay Bogawat

*   Test Team - Rohit Sharma, Praveen Rangarajan, Kashinath TR, Vijaya Jankiraman

*   Edit Team - Dennis Rea.

*   External Contributors/Reviewers - Adwait Ullal; Andy Eunson; Brian Sletten; Christian Weyer; David Guimbellot; David Ing; David Weller; Derek Greer; Eduardo Jezierski; Evan Hoff; Gajapathi Kannan; Jeremy D. Miller; John Kordyback; Keith Pleas; Kent Corley; Mark Baker; Paul Ballard; Peter Oehlert; Norman Headlam; Ryan Plant; Sam Gentile; Sidney G Pinney; Ted Neward; Udi Dahan

*   Microsoft Contributors / Reviewers - Ade Miller; Amit Chopra; Anna Liu; Anoop Gupta; Bob Brumfield; Brad Abrams; Brian Cawelti; Bhushan Nene; Burley Kawasaki; Carl Perry; Chris Keyser; Chris Tavares; Clint Edmonson; Dan Reagan; David Hill; Denny Dayton; Diego Dagum; Dmitri Martynov; Dmitri Ossipov; Don Smith; Dragos Manolescu; Elisa Flasko; Eric Fleck; Erwin van der Valk; Faisal Mohamood; Francis Cheung; Gary Lewis; Glenn Block; Gregory Leake; Ian Ellison-Taylor; Ilia Fortunov; J.R. Arredondo; John deVadoss; Joseph Hofstader; Koby Avital; Loke Uei Tan; Luke Nyswonger; Manish Prabhu; Meghan Perez; Mehran Nikoo; Michael Puleio; Mike Francis; Mike Walker; Mubarak Elamin; Nick Malik; Nobuyuki Akama; Ofer Ashkenazi; Pablo Castro; Pat Helland; Phil Haack; Reed Robison; Rob Tiffany; Ryno Rijnsburger; Scott Hanselman; Seema Ramchandani; Serena Yeoh; Simon Calvert; Srinath Vasireddy; Tom Hollander; Wojtek Kozaczynski

 

To download go to following link.

http://www.codeplex.com/AppArchGuide

 

 

 

E-mail this post to someone or Comments here
Wed 31 Dec 2008

Sample Code Oracle stored procedure - In this simple implementation, call commit at the end of work done, and Rollback if any exception occur.

 

PROCEDURE SAVE_TWO_THINGS(
IN_THING_ONE IN VARCHAR2,
IN_THING_TWO IN VARCHAR2)
IS

BEGIN

INSERT INTO TABLEONE
(ACTIVE, THING_DESC)
VALUES
('Y', IN_THING_ONE);


INSERT INTO TABLETWO
(ACTIVE, THING_DESC)
VALUES
('N', IN_THING_TWO);

COMMIT;

EXCEPTION WHEN OTHERS THEN 
ROLLBACK;
END;

E-mail this post to someone or Comments here
Wed 31 Dec 2008

Today I need to implement transaction in .NET. Front end language was VB.NET and database was Oracle.

This transaction is being implemented using Oracle Data Access Provider - ODP.NET.

Simple implementation is that create and open a connection, begin transaction using that connection, create command using that connection, call stored procedures or statments using command(s), if every thing gone fine and success then call commit of that transaction else rollback, and in last close and dispose connection and transaction.

Be sure not to use commit, rollback or statement that causes transaction invalidate inside the procedure that is being called within .NET transaction, otherwise that .NET transaction scope will no longer valid as within that connection commit or rollback have been called.

Sample code that make my work done is :-

=============

Private Sub Save()
Dim conn As New OracleConnection("ConnString")
Dim trans As OracleTransaction
Dim success as Boolean = False

Try
conn.Open()
 trans = conn.BeginTransaction
success =  saveThingOne(conn)
If success Then
success = saveThingTwo(conn)
End If

If success  Then
 trans.Commit()
else
trans.Rollback()
End If

Catch ex As Exception
 trans.Rollback()
Finally
trans.Dispose()
conn.Close()
conn.Dispose()
End Try
End Sub



Private Sub saveThingOne(ByVal conn As OracleConnection) As Boolean
Dim success as Boolean = False
Using comm As New OracleCommand("Save_Thing_One_Stored_Procedure", conn)
   comm.CommandType = CommandType.StoredProcedure
   comm.Parameters.Add("IN_ID", OracleType.Number).Value = intID
   comm.Parameters.Add("IN_THING_ONE", OracleType.VarChar, 60).Value = strThingONe
   comm.Parameters.Add("OUT_RESULT", OracleType.Number).Direction = ParameterDirection.Output
   comm.ExecuteNonQuery()
‘Here if that procedure successfully perform action then will return 0 in case of success and 1 in case of failure
success = Iif(comm.Parameters(“OUT_RESULT”).Value.ToString().equals(“0”), True, False)
Return success
End Using
End Sub



Private Sub saveThingTwo(ByVal conn As OracleConnection)
Dim success as Boolean = False
Using comm As New OracleCommand("Save_Thing_Two_Stored_Procedure", conn)
   comm.CommandType = CommandType.StoredProcedure
   comm.Parameters.Add("IN_ID", OracleType.Number).Value = intID
   comm.Parameters.Add("IN_THING_TWO", OracleType.VarChar, 60).Value = strThingTwo
   comm.Parameters.Add("OUT_RESULT", OracleType.Number).Direction = ParameterDirection.Output
   comm.ExecuteNonQuery()
‘Here if that procedure successfully perform action then will return 0 in case of success and 1 in case of failure
success = Iif(comm.Parameters(“OUT_RESULT”).Value.ToString().equals(“0”), True, False)
Return success

End Using
End Sub

 

 

E-mail this post to someone or Comments here