Friday, December 31, 2010

JQuery: Validate all the controls in the rows of a table

Validating all the controls of each row of a TABLE element can be done at clientside using jQuery.






<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JQuery Page</title>
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<style type="text/css">
.mandatory
{
border: solid 1px red;
}
</style>
<script type="text/javascript">
function CallThis()
{
var mandatorys = $('#tableid').find('.mandatory');
var allFieldsComplete = true;
mandatorys.each(function(index) {
if (this.value.length == 0) {
$(this).addClass('mandatory');
allFieldsComplete = false;
} else {
//alert(this.value);
$(this).removeClass('mandatory');
}
});
if(!allFieldsComplete){
$('#dispMsg').html('Mandatory fields to be entered');
}
return allFieldsComplete;
}
</script>

</head>
<body>
<table id="tableid" border="1" class="tableid">
<tr> <td>
<input type="text" class="mandatory" />
</td> <td>
<input type="text" class="mandatory" />
</td> </tr>
<tr> <td>
<input type="text" class="mandatory" />
</td>
<td><input type="text" class="mandatory" />
</td> </tr> </table>
<div id="dispMsg" style="color:Red;"></div>
<input type="button" class="txtbox" value="Validate" onclick="javascript:CallThis();" />
</body>
</html>

Wednesday, December 29, 2010

How to make ASP.Net Server side Calls from JQuery





Here Comes the WebService.
Dont forget to add the Namespace: System.Web.Script.Services. (Comes with AJAX Extensions).
(You may face problem while making the server call if the Website you built is not an Ajax Enabled Website.)


using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class ThisService : System.Web.Services.WebService
{
    public ThisService()
    {
        //InitializeComponent();
    }

    [WebMethod]
    public string HelloWorld(string dlaID)
    {
        return "Hello World";
    }
}


Now the .aspx page with Markup.
Download the latest JQuery file and add to your project and refer.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JQServiceCall.aspx.cs" Inherits="JQServiceCall" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>JQuery ASP.Net Page</title>
    <script type="text/javascript" src="Scripts/jquery-1.4.2.min.js" language="javascript"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(
        function() {
        var ID = '49214';
        $.ajax({
        type:"POST",
        url:"ThisService.asmx/HelloWorld",
        dataType:"json",
        // data: "{}",
        data:'{"dlaID":' + ID + '}',
        contentType:"application/json; charset=utf-8",
        success:function(msg) {
        if (msg != null) {alert(msg);}
        else {alert('My Message!');
        }},
        error:
        function(xhr) {if (xhr != null) {alert("Error occured \n" + xhr.responseText);}}
        });});
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <font color="#000000">User Name :
            <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
            <span id="status"></span></font>
        <div>
        </div>
    </form>
</body>
</html>

Tuesday, November 23, 2010

Microsoft.Practices.Repository : Make sure "GenericResources.resources" was correctly embedded or linked into assembly

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "GenericResources.resources" was correctly embedded or linked into assembly "Microsoft.Practices.Repository" at compile time, or that all the satellite assemblies required are loadable and fully signed.

This was the error which held my neck for more than two days. We follow Repository Factory for Visual Studio 2008 for Data Access Layer Creation (By Microsoft Patterns and Practices.)


I replaced the ExceptionHandling snippet [throw new RepositoryFailureException(ex);]
with [throw new RepositoryFailureException(ex.Message,ex.InnerException);] in each repository class generated by Repository Factory.

Did a Find and Replace for the whole DataAccess Project. Then went for a build of all the projects (DataAccess Layer, Business Logic Layer, and Presentation Layer. Then Ran the solution by Setting Startup Page as Finance User Dashboard.

Error got changed to the following.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

This is a very familiar one. Could be some thing wrong either with the Connection String in the Web.config or Failed network connection. :) the parameters mentioned in the Web.Config was pointing a wrong DB.

See, how vague the initial error was. It didnt have any relation with the actual problem. Be aware of these situations, these can mess up your day.

Wednesday, November 10, 2010

Resolved : Unable to connect to asp.net development server

Working on Visual Studio 2008 and not debugging the website and whenever you run the solution it gives error as "Unable to connect to asp.net development server" ?


WebDev.WebServer.EXE is the process associated with Visual Studio 2008 when you run a project(solution).
This is located EITHER at
C:\Program files\Common files\Microsoft Shared\DevServer\9.0  OR C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727


Problem is, your Visual Studio is unable to get attached to this exe, when you try to run the solution due to some reason. Problem with mine was, this executable (WebDev.WebServer.EXE) was corrupted. (There is no method known to identify this exe is corrupted or not). I just replaced this exe with the one i have copied from my colleagues PC where he had installed VS 2008, and was running fine. 


This has helped me in resolving the issue "Unable to connect to asp.net development server" with VS 2008. 
Have a try. 

Thursday, September 16, 2010

Ajax assembly version conflicts and resolution

The following could be faced during your Staging to Production movement or Implementation server.

System.Web.Script.Services.ScriptMethodAttribute exists in both 'C:\Windows\Microsoft.Net\Framework64\v2.050727\Temporary ASP.Net....' 
and C:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0_...'

BindingRedirects


First step is to clear the Temporary ASP.Net folder and try, even then you face the same error message, spend some time in the below described.

When you build a .NET Framework application against a strong-named assembly, the application uses that version of the assembly at run time by default, even if a new version is available. However, you can configure the application to run against a newer version of the assembly.

You can redirect more than one assembly version by including multiple elements in a element.

The following example shows how to redirect one assembly version to another.



Visual Studio 2008 automatically adds binding redirects in the web.config file
This solves many of the interoperability issues and nothing wrong in creating applications with reference to System.Web.Extensions of older version (v1.0) with VS2008

Wednesday, September 1, 2010

Basics; Updating a row item in GridView

GridView Row Edit and Update would be one among the basics a .Net fresher programmer to start with.

   CODE BEHIND File

   protected void GrvCannibalize_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GrvCannibalize.EditIndex = e.NewEditIndex;
        BindCannibaliseGrid();
    }
    protected void GrvCannibalize_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        GrvCannibalize.EditIndex = -1;
        BindCannibaliseGrid();
    }
   protected void GrvCannibalize_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TrnFutureSales oEntity = new TrnFutureSales();  // Business Entity
FutureSalesLogic oLogic = new FutureSalesLogic();  // Business Logic Layer
      
TextBox oWRActual = GrvCannibalize.Rows[e.RowIndex].FindControl("TxtWRActual") as TextBox;
        TextBox oWIActual = GrvCannibalize.Rows[e.RowIndex].FindControl("TxtWIActual") as TextBox;
        TextBox oCNNActual = GrvCannibalize.Rows[e.RowIndex].FindControl("TxtCNNActual") as TextBox;

        HiddenField oFutureSalesId = GrvCannibalize.Rows[e.RowIndex].FindControl("HdnFutureSalesId") as HiddenField;

        oEntity.ActualCan = Convert.ToDecimal(oWRActual.Text);
        oEntity.ActualRR = Convert.ToDecimal(oCNNActual.Text);
        oEntity.ActualImpact = Convert.ToDecimal(oWIActual.Text);
        oEntity.FutureSalesId =  Convert.ToInt64(oFutureSalesId.Value);

oLogic.UpdateFutureSalesForId(oEntity);    // This method has to be added as yours to update the database. 

        GrvCannibalize.EditIndex = -1;
        BindCannibaliseGrid(); // Bind the grid again to load with the new values.
    }

ASPX (MARK UP) File

<asp:GridView ID="GrvCannibalize" DataKeyNames="FutureSalesID" runat="server" AutoGenerateColumns="false" EmptyDataText="No Record Found" EmptyDataRowStyle-CssClass="redstar" AllowPaging="true" Width="100%" PageSize="5" ShowFooter="true" OnRowEditing="GrvCannibalize_RowEditing" OnRowCancelingEdit="GrvCannibalize_RowCancelingEdit"
OnRowUpdating="GrvCannibalize_RowUpdating" AutoGenerateEditButton="false">

<Columns>
<asp:CommandField ButtonType="Image" ShowEditButton="True" EditImageUrl="~/App_Themes/images/Edit.gif" UpdateImageUrl="~/App_Themes/images/Update.gif" CancelImageUrl="~/App_Themes/images/Cancel.jpeg">
</<asp:CommandField>

<asp:TemplateField HeaderText="Actual WI">
  <ItemTemplate>
  <asp:Label ID="LblWIActual" runat="server" Text='<%# Bind("ActualImpact") %>'></<asp:Label>
 <asp:HiddenField ID="HdnFutureSalesId" runat="server" Value='<%# Eval("FutureSalesID") %>'></<asp:HiddenField>
  </ItemTemplate>
    <EditItemTemplate>
      <asp:TextBox ID="TxtWIActual" runat="server" CssClass="txtboxAmount" Text=''></<asp:TextBox>
      <asp:RequiredFieldValidator ID="RfvWIActual" runat="server" ErrorMessage="Required" CssClass="redstar" Text="Required" ControlToValidate="TxtWIActual">
</<asp:RequiredFieldValidator>
</EditItemTemplate>
</<asp:TemplateField>

<asp:TemplateField HeaderText="Actual WR">
<ItemTemplate>
<asp:Label ID="LblWRActual" runat="server" Text='<%# Bind("ActualRR") %>'></<asp:Label>
</ItemTemplate>
<EditItemTemplate>
  <asp:TextBox ID="TxtWRActual" runat="server" CssClass="txtboxAmount" Text=''></<asp:TextBox>
    <asp:RequiredFieldValidator ID="RfvWRActual" runat="server" ErrorMessage="Required" CssClass="redstar" Text="Required" ControlToValidate="TxtWRActual"></<asp:RequiredFieldValidator>
</EditItemTemplate>
</<asp:TemplateField>

</Columns>
</<asp:GridView>

Clientside Validation for Controls inside GridView

Server Side validations for the Controls inside the Gridview will be bit heavy for the pages havingmore than two gridviews. Javascripts can be used to iterate through the controls inside the particular column of grid. We will have to create a Javascript Two dimensional array to hold both the Server ID and Client ID of the control from the GridView PreRender Event. Same can be achieved from GridView RowDataBound Event also.

The following PreRender Event registers a Two Dimensional Array with control's Server ID and Client ID.


protected void GrvPostPromotion_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ClientScriptManager oCsm = this.Page.ClientScript;
            TextBox oGrossSales = e.Row.FindControl("TxtGrossSalesPOP") as TextBox;
            TextBox oNetToGross = e.Row.FindControl("TxtNetToGrossPOP") as TextBox;
            TextBox oSGM = e.Row.FindControl("TxtPSGMPOP") as TextBox;

            oCsm.RegisterArrayDeclaration("TxtGrossSalesPOP", "'" + oGrossSales.ClientID + "'");
            oCsm.RegisterArrayDeclaration("TxtNetToGrossPOP", "'" + oNetToGross.ClientID + "'");
            oCsm.RegisterArrayDeclaration("TxtPSGMPOP", "'" + oSGM.ClientID + "'");                
        }
    }


Your Javascript Validation Function can do the Job like this

function ValidateDraftPostPromoGrid() {
    var rerunThis = false;
    var vFlag = 0;
    var oDisp = document.getElementById('divMessage'); // DIV, where you display the error message
    for (i = 0; i < TxtGrossSalesPOP.length; i++) {
        var oGrossSales = document.getElementById(TxtGrossSalesPOP[i])
        if (oGrossSales.value == "") {
            oGrossSales.className = "txtboxRedBorder";
            oDisp.innerHTML = "Post Promotion Details is Mandatory ";
            vFlag = 1;
            rerunThis = false;
            break;
        }
        else {
            if (isNaN(oGrossSales.value) == false) {
                oGrossSales.className = "txtboxNormal";
                oDisp.innerHTML = "";
                rerunThis = true;
            }
            else {
                oGrossSales.className = "txtboxRedBorder";
                oDisp.innerHTML = "Gross Sales to be entered in numbers ";
                vFlag = 1;
                rerunThis = false;
                break;
            }
        }
    }
return rerunThis;
}

Tuesday, August 31, 2010

Grouping/Appending GridView Header

GridView header to have a Parent Header(Grouped Header) is as simple as the following.







protected void
GrvPrePromotion_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            GridView HeaderGrid = (GridView)sender;
            GridViewRow HeaderGridRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
            TableCell HeaderCell = new TableCell();
            HeaderCell.Text = "Promotion Product Group";
            HeaderCell.ColumnSpan = 3;
            HeaderGridRow.Cells.Add(HeaderCell);
            HeaderGridRow.CssClass = "gridheadtop";

            HeaderCell = new TableCell();
            HeaderCell.Text = "Sales and SGM";
            HeaderCell.ColumnSpan = 4;
            HeaderGridRow.Cells.Add(HeaderCell);

            HeaderCell = new TableCell();
            HeaderCell.Text = "Special Discount";
            HeaderCell.ColumnSpan = 3;
            HeaderGridRow.Cells.Add(HeaderCell);

            HeaderCell = new TableCell();
            HeaderCell.Text = "Rebate";
            HeaderCell.ColumnSpan = 1;
            HeaderGridRow.Cells.Add(HeaderCell);

            HeaderCell = new TableCell();
            HeaderCell.Text = "Free Goods / Prize";
            HeaderCell.ColumnSpan = 1;
            HeaderGridRow.Cells.Add(HeaderCell);

            GrvPrePromotion.Controls[0].Controls.AddAt(0, HeaderGridRow);
        }
    }

 How to Display/Calculate Total/Percentage in the Gridview footer.

Rounding a number to decimal places, Javascript.

As Javascript's Math.Round() cant be directly used to round to decimal places, we should find the workarounds.
Have a look at the following function which does the job.

function RoundNumber(ThisNumber, rlength) { // Arguments: number to round, number of decimal places
  var RoundedNumber = Math.round(ThisNumber*Math.pow(10,rlength))/Math.pow(10,rlength);
  return RoundedNumber ; // returns the resulting number. 
}

Friday, August 27, 2010

WebConfig settings for Sharepoint (WSS and MOSS Portals)

Get Microsoft ASP.NET 2.0 AJAX Extensions 1.0 running on the WFE (WHere the Instance of your WSS/MOSS is running. Open up the Web.config of your WebSite from C:/INETPUB/VIRTUAL DIRECTORIES/WSS/(PORT NUMBER OF YOUR SITE) and do some settings which are required for AJAX to run on your Portal. Web.Config wont have Ajax settings in it even if AJAX is installed on the Server.

FOR WSS

FOR MOSS

ASP.Net Application to run on IIS 7.0

Upgrading an ASP.NET application from IIS 6.0 or lower version to IIS 7.0 will have a lot of work. Microsoft provides an application that does the settings for your application to run on IIS 7.0. [Classic ASP.NET Integration Mode to IIS 7.0 Integrated Mode]

IIS 7.0 takes care of migrating the application by using the APPCMD.EXE command line tool to perform the migration. The migration error message contains the command that is executed in command line window (which you must run--right click the Programs\Accessories\Command Prompt icon, and choose "Run as administrator") in order to instantly migrate your application to Integrated mode.

The format of the migration command is :

%windir%\system32\inetsrv\APPCMD.EXE migrate config

where Application Path is the virtual path of the application containing the site name, such as "Default Web Site/app1"

Monday, August 2, 2010

Use Delegate to Delete an Item from a List

Iterating through the list items is quite a simple task when delegates are in place.

 
protected void GrvUploads_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.ToString() == "DeleNow")
        {
            List oUploader = Session["UploadedFiles"] as List;
            if (oUploader != null)
            {
                oUploader.Remove(oUploader.Find(delegate(UploadEntity oEntity)
                {
                    return (oEntity.UploadID == Convert.ToInt64(e.CommandArgument));
                }
                ));
            }
            Session["UploadedFiles"] = oUploader;
            BindUploadGrid();
        }
    }

Tuesday, July 20, 2010

SET NOCOUNT ON, the performance booster

We normally use SET NOCOUNT ON in STORED PROCEDURES and TRIGGERS
What does actually SET NOCOUNT ON do?

When we normally execute a T-SQL statements (INSERT, UPDATE, SELECT, DELETE) in a query window, we see messages that says something like "(20 row(s) affected)" as the response to our query?

Database's internal architecture processes and displays the status of the execution process. The message display is done by the DONE_IN_PROC which is predefined in the architecture. Though this is default to SQL Server, this makes a slight difference in performance. Obviously, when a query has lots of T-SQL statements in it to perform, this costs you a lot.

The DONE_IN_PROC message is pretty useful when we are using the query window to execute the procedure. But it runs unwanted when the web applications are concerned. Each operation of T-SQL statement will return this internal message (eg, an INSERT, UPDATE, or SET in a WHILE loop) for each step within the Stored Procedure execution cycle.

So from the web developer perspective, its quite unwanted when he update the files in to production server. Lets have a boost in performance this way.

Wednesday, July 14, 2010

ReportViewer not getting displayed on IIS7

Symptoms:
Unable to render ReportViewer on ASP.NET Web pages while running on IIS7.
You have no problem viewing your reports when running on debug mode with your Visual Studio 2005.
You are able to view your reports on Report Manager but not able to view them on IIS7.
You encounter JavaScript error when loading your report page with ReportViewer. Image buttons such as calendar appear as red 'X'.

Cause:
When the ReportViewer control is added to Web Form (.aspx), the
Reserved.ReportViewerWebControl.axd httpHandler is added to System.Web section of the Web.Config file. In IIS7, it should be added under System.Webserver section.
IIS7 Handler Mappings does not contain Reserved.ReportViewerWebControl.axd httpHandler, and therefore unable to render the ReportViewer elements needed by the JavaSript.

Applies to:
Internet Information Services 7.o (IIS7)
Microsoft Report Viewer Redistributable 2005

Resolution:
Open Internet Information Services (IIS) Manager and select your Web application.
Under IIS area, double-click on Handler Mappings icon.
At the Action pane on your right, click on Add Managed Handler.
At the Add Managed Handler dialog, enter the following:
Request path: Reserved.ReportViewerWebControl.axd
Type: Microsoft.Reporting.WebForms.HttpHandler
Name: Reserved-ReportViewerWebControl-axd
Click OK.

Reserved-ReportViewerWebControl-axd handler is now added to your Handler Mappings list. Notice that the following line has also been added to your Web.config file under the system.webserver's handler section:



Run your report now!




Tuesday, July 13, 2010

ASP.Net Menu control not working in IE 8. Hot fix.

Almost an year ago when i was struggling with ASP.Net menu controls which were not getting displayed properly on new aged browsers like Google Chrome and IE 8.0 there were no posts available on net in this regard. Though I could come out of Google Chrome's issue with ASP.Net Menu Control, IE 8.0 issue was left out as it is as my Customer was not at all upgraded to IE 8.0. Luckily I got my head out from it.

But today, if some one is in trouble on ASP.Net menu with IE 8.0, you have a hot fix file to be installed to get rid of the problems. Microsoft support Center accepted the issue in IE 8.0 and released a hot fix which available for free download. The Microsoft Knowledge Base Article details this issue. (Click on the link)

For Windows Vista and Windows Server 2008

For Windows XP and Windows Server 2003

A simple Web Service for the beginners; ASP.Net C#

WebService Method in App Code folder with a [WebMethod] attribute. Just a normal C# method with [WebMethod] attribute. @RecordCount is an output parameter returned by the stored procedure.

     [WebMethod]
    public static Int64 VerifyDuplicateActivation(Int64 DetailsId)
    {
        Int64 RecordsCount = 0;
        string connString = ConfigurationManager.AppSettings["DatabaseAnalyzeUAT1"].ToString();
        SqlConnection oConn = new SqlConnection(connString);
        SqlCommand oCommand = new SqlCommand();
        oCommand.Connection = oConn;
        oCommand.CommandText = "VerifyTeamActivation";
        oCommand.CommandType = CommandType.StoredProcedure;
        oCommand.Parameters.AddWithValue("@DetailsID", DetailsId);
        oCommand.Parameters.Add("@RecordCount", SqlDbType.BigInt);
        oCommand.Parameters["@RecordCount"].Direction = ParameterDirection.Output;
        oConn.Open();
        oCommand.ExecuteScalar();
        RecordsCount = (Int64)oCommand.Parameters["@RecordCount"].Value;
        return RecordsCount;
    }


Consuming WebService is just a method call if it is from Server Side.
Int64 RecCount = VerifyForDuplicate(details.DetailsId);

Wednesday, July 7, 2010

Patterns & Practices: Repository Factory for Data Access Creation

The Repository Factory is a guidance package that automates creation of entity classes that map to database tables and repository classes to read and write those entity classes. The generated code removes the tedium of writing a persistence-ignorant domain model.

The Repository Factory is not intended to be a be-all-does-everything ORM solution. Instead, it's a lightweight code generator that automates most of the hand-coding needed to build domain model object and persist them to a database

Download it Here

How to Create Data Access Layer in ASP.Net with Repository Factory

Never run ASP.NET Applications with debug=”true” enabled in Live Server

We, rarely bother about the settings in Web.Config file of our application when moving from Development environment to Production/Live.

has big impact on the performance of the Web Application/Site.

When debug is set to true, the following happens in the application scope.

1) Batch optimizations will be disabled and hence the compilation of pages takes longer
2) Some additional debug paths get enabled which causes for slower execution of code
3) More memory is used within the application at runtime
4) Scripts and images downloaded from the WebResources.axd handler are not cached

All client-javascript libraries and static images that are deployed via WebResources.axd will be continually downloaded by clients on each page view request and not cached locally within the browser.

When is set, the WebResource.axd handler will automatically set a long cache policy on resources retrieved via it – so that the resource is only downloaded once to the client and cached there forever

Sunday, May 30, 2010

Developing Custom Content Types for SharePoint

What could be a Content Type in SharePoint?

A content type is an object that is stored within MOSS that defines several elements of a piece of content, including:

  • Document Template that the content will be based on
  • Columns that the content will have associated with it (metadata)
  • Workflows that the content will use
  • Information Management policies that apply to the content
  • Conversion types for the content
Watch this wonderful video to learn about developing it with Visual Studio. Thanks to the author.





Monday, May 17, 2010

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID - MOSS

You may see this error in the EVENT VIEWER - more than once - when working with your Microsoft Office SharePoint Server (MOSS) 2007 deployment. This animal / error generally shows itself after you have applied an upgrade to an existing deployment. For example, when upgrading from B2 MOSS to B2TR MOSS - or when applying a special service pack from MSFT - you may begin to see a lot of these errors pop up in the SYSTEM event log.

The error CLSID is followed by a class ID for the DCOM+ application that the service account trying to activate that application - does NOT have permission to activate.

For example, let's say I installed MOSS on a server, and used the account mossService as the service account (a least privileged, user account you created to run the MOSS service(s))., when I get this error, I could very well see an error like the following:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

{61738644-F196-11D0-9953-00C04FD919C1}

to the user \mossService SID (S-1-5-21-). This security permission can be modified using the Component Services administrative tool.

Copy the GUID following the CLSID above, and go to REGEDIT

Start-->Run-->regedit

With the registry editor open, ensure that your cursor is on the computer at the beginning of the tree (make sure you are not in the middle of some previous edit session in the registry editor).

Edit-->Find and paste in the GUID. It'll stop at the application entry - and you will want to note the application name on the right side pane. In this example, it was the IIS WAMREG admin service that popped up.

Now, open Component Services from the server :-

Start-->Administrative Tools-->Component Services,

Expand Component Services, Computers, My Computer, DCOM Config. Scroll down and find the application (IIS WAMREG in this case).

Right-Click-->Properties and select the Security tab
.

You'll have some options here - the first block Launch and Activation Permissions - ensure that the
Customize radio button is selected, and click Edit. Now,

Add your service account - giving it launch and activate - and in some requirements - remote launch / activate permission.

Restart IIS and continue on.

NOTE: This solution is not specific to MOSS, i feel; hopefully this will help someone else who sees these annoying DCOM errors in WINDOWS EVENT LOG (EVENTVWR).

Friday, April 16, 2010

Classic ASP on IIS 7, PDF on Windows 7

Vijay Pais was back again on a drowsy afternoon with certain other issues
He was on his way of migrating our Corporate Intranet.

Migration
Destination Server : Windows Server 2003, IIS 6.0, Oracle Express
Source Server: Windows 7, IIS 7.0, Oracle Express.

Issue 1: Classic ASP website not running on IIS 7.0.

By default, IIS 7.0 runs on Integrated Mode. It has to be changed to Classic for Clasic ASP to Run. And few other steps.

Alex Thissan has already put it on his web log.


But issues didnt leave us, were hooked on another interesting thing,

Issue2: PDF files not opening up on Windows 7.

Though the IIS 7 running on Windows 7 is configured for .pdf MIME types, it fails opening up the file. Microsoft accepts this issue in their knowledge base article and suggest a HOTFIX (KB: 979543) as resolution.


Requested microsoft for this fix file setup, got it installed and PDFs started opening up.

Happiness was back at faces, as there was minutes left out for the weekend bash.

Wednesday, April 14, 2010

The name 'CastDBNull' does not exist in the current context

The name CastDBNull does not exist in the current context

Generating Data Access Layer using Guidance Package for VS2008 ?(ISimpleDomainObjectFactory)?

using Microsoft.Practices.EnterpriseLibrary.Data

Define this in your code.

public static class CastDBNull
{
public static T To(object value, T defaultValue)
{
if (value == DBNull.Value) return defaultValue;
return (T)Convert.ChangeType(value, typeof(T));
}
}

Sunday, April 11, 2010

The media family on device Microsoft SQL Server, Error: 3241

The media family on device 'D:\Web_Applications_Sabin\HOF\LPT\HOF_NEW_BACKUP.bak' is incorrectly formed. SQL Server cannot process this media family.
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)

I was trying to restore a database back up on my machine. Back up file was taken from a different machine. Got stuck up with the error.

Later I realised, it was due to the compatibility issue as the Back up was taken from SQL Server 2008 Express and I was restoring on SQL Server 2005 Express.

Resolution.
Generate Script (.sql) from the destination server and execute in the source server.


Thursday, March 25, 2010

Setting up MOSS 2007 in a server farm environment

Setting up MOSS 2007 in a server farm environment. (A Web Front End Server WFE and a Database Server)

Security account requirements
To install MOSS 2007 in a server farm environment, at-least 2 accounts are required.
(Only one account required when WFE and Database are on a Single computer. This installation has got a slightly different procedure. Dont follow this instruction for a Single Server Configuration.)

One as Domain User with Admin power in both the WFE and DB Server. This user should be manually added in to the SQL Server Users from the Management Studio. This should be able to login to SQL Server with Windows authentication should have DB Creator and Security Admin rights on SQL Server. This will be used for Installing MOSS and will be acted as SERVICE ACCOUNT for all the related services of MOSS.

Do not use the main domain\administrator account. This causes a problem if ever you wish to install Project Server 2007 on the same machine.

Account 1 (We call it as MOSSADMIN)
A user account that you can use to install Office SharePoint Server 2007 and run the SharePoint Products and Technologies Configuration Wizard. This account must be:
  • A domain user account.
  • A member of the Administrators group on each of your front-end servers.
  • A member of the SQL Server Logins, which grants login access to your SQL Server instance.
  • A member of the SQL Server Database Creator server role, which grants permission to create and alter databases.
  • A member of the SQL Server Security Administrators server role, which grants permission to manage server logins.

Account 2 (We Call this as MOSSUSER)
A unique domain user account that you can specify as the Office SharePoint Server 2007 service account. This user account is used to access your SharePoint configuration database. It also acts as the application pool identity for the SharePoint Central Administration application pool and it is the account under which the Windows SharePoint Services Timer service runs.

The SharePoint Products and Technologies Configuration Wizard adds this account to the SQL Server Logins (We don’t need to manually add this in to SQL Server, Just provide when MOSS Technologies Configuration wizard asks), the SQL Server Database Creator server role, and the SQL Server Security Administrators server role. It is recommended that you follow the principle of least privilege and do not make this user account a member of any particular security group on your front-end servers or your back-end servers.

SQL Server Installation.
This has to be a different server.
(Preferably, SQL Server 2005 should be installed with Local System account (Local Administrator of that machine). If you install it with Domain Admin User, SQL Server uses Kerberos Security. I don’t prefer this as MOSS Configuration Wizard’s default installation would be on NTLM, not Kerberos. So, I just login as Local System Admin for installation rather than going with domain Admin.)

Select Database Engine and Analysis Services in the Wizard, No need of selecting the other features like integration Services. Click Advanced, Select Client Component Tools (This is for getting the Management Studio). Service pack 3 is a must for SQL Server for MOSS. Open up Management Studio and add the Service account in to the Users, assign permissions as DB Creator and Security Admin rights on SQL Server.
Log off from DB Server if you are logged in as LOCAL ADMIN and Login as MOSSADMIN and Connect to Database Engine through SQL Server Management Studio with Windows Authentication. Give DB Creator and Security Admin roles to this user .

Make sure that Collation settings is of Latin1_General_CI_AS_KS_WS
Enable the remote connection to the SQL Server through Serface Area Configuration wizard. Click Surface Area Configuration for Services and Connections. Select Remote Connections
Read out these carefully to prepare a new DB Server for MOSS
http://technet.microsoft.com/en-us/library/cc263187.aspx

Configure surface area settings in SQL Server 2005

1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
2. In the SQL Server Surface Area Configuration dialog box, click Surface Area Configuration for Services and Connections.
3. In the tree, open your instance of SQL Server, open Database Engine, and then click Remote Connections.
4. Click Local and Remote Connections, click Using both TCP/IP and named pipes, and then click OK

How do i know the Version of SharePoint installed on my server?

To check this on a moss installed server, go to Central Administration(CA) > Operations > Servers in the farm. You can see the version of the MOSS there.
Also, To know the Edition of MOSS(Standard/Enterprise) you installed
Go to the Central administration -> Operations-> Enable Enterprise features. This will show you whether it is standard or enterprise. If it is enterprise edition, Button would be disabled.
Name
Version
MOSS 2007/WSS 3.0 Service Pack 1 (Contains the below)
12.0.0.6219
MOSS 2007/WSS 3.0 October 2007 Public Update
12.0.0.6039
MOSS 2007/WSS 3.0 August 2007 Hotfix
12.0.0.6036
MOSS 2007/WSS 3.0 RTM
12.0.0.4518
Framework 2.0 and 3.0 on the front end server (Where MOSS is going to be installed)
IIS on the Front end server with the rights
As the front end server runs with Windows Server 2008 Operating system(OS), Installing and configuring will not be as easy as on a 2003 OS.
For installing IIS refer http://learn.iis.net/page.aspx/29/install-iis-7-on-windows-server-2008-or-windows-server-2008-r2/
IIS 7 will get installed with .Net Framework 2.0. We need Framework 3.0 also to be installed on Moss WFE. Go to IIS Manager, Application Pools and see the version of Framework version in the right pane.

IIS Isolation mode settings (IF IIS 6.0)
1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
2. In the IIS Manager tree, click the plus sign ( ) next to the server name, and then right-click the Web Sites folder and select Properties.
3. In the Web Sites Properties dialog box, click the Service tab.
4. In the Isolation mode section, clear the Run WWW service in IIS 5.0 isolation mode check box, and then click OK.

IF IIS 7.0, This is to be as CLASSIC MODE (There is no Isolation mode in IIS 7, Instead it is Pipeline Mode)
1. Select Application Pools in IIS Manager in the left pane in IIS 7.0, In the middle pane, MODE will be displayed as INTEGRATED/CLASSIC. ASP.Net should be in CLASSIC Mode and Default Application Pool on INTEGRATED MODE
Enable ASP.NET 2.0 in IIS 6.0

You must enable ASP.NET 2.0 on all Office SharePoint Server 2007 servers.

Enable ASP.NET 2.0
1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

2. In the IIS Manager tree, click the plus sign (+) next to the server name, and then click the Web Service Extensions folder.

3. In the details pane, click ASP.NET v2.0.50727, and then click Allow.

Enabling ASP.Net 2.0 is not required for IIS 7.0 I Guess. By default it does this configuration during installation.

Login as MOSSADMIN User in the WFE server and click on the MOSS Setup exe file. This is the account will be used to Run MOSS and Run SharePoint Technologies Configuration Wizard. Service Account (MOSSUSER) will be given only when SharePoint Technologies Configuration Wizard asks for creating Sharepoint_config database.
Set up will ask for running the Sharepoint Technologies Configuration Wizard once the installation of Sharepoint is over. Provide the database server name and Service account credentials (MOSSUSER) here, Configuration Wizard creates the connection to the database server and create Configuration database (Sharepoint_Config) and other Configuration DBs like SSP, Search etc.
This process takes some time to complete the configuration.

The SharePoint Central Administration Web page opens.

Don’t refer this linked article for installing in a Web Farm, because this is specifically instructed for an installation where WFE and DB Server on the same machine. Follow it if you are setting up both WFE and DB on a single server. It is a good written document.

Preparing Web Front End & Application servers.
DB Server Preperation

Do an IIS Reset and browse Central Administration(CA).

Notes

If you are prompted for your user name and password, you might need to add the SharePoint Central Administration site to the list of trusted sites and configure user authentication settings in Internet Explorer. Instructions for configuring these settings are provided in the next set of steps. If you see a proxy server error message, you might need to configure your proxy server settings so that local addresses bypass the proxy server. Instructions for configuring this setting are provided later in this section.

Add the SharePoint Central Administration site to the list of trusted sites

1. In Internet Explorer, on the Tools menu, click Internet Options.

2. On the Security tab, in the Select a Web content zone to specify its security settings box, click Trusted Sites, and then click Sites.

3. Clear the Require server verification (https:) for all sites in this zone check box.

4. In the Add this Web site to the zone box, type the URL for the SharePoint Central Administration site, and then click Add.

5. Select the Require server verification (https:) for all sites in this zone check box.

6. Click Close to close the Trusted Sites dialog box.

7. Click OK to close the Internet Options dialog box.

:) CA Loaded !

There would be some message in CA saying configuration is not complete.

Configure and run the Services in the server one by one as follows.

Configure 2007 Office SharePoint Server services After you have installed and configured Office SharePoint Server 2007 on all of your front-end servers, you must configure Office SharePoint Server 2007 services. The services you need to configure depends on your server topology and the server roles you deploy. Use the following guidelines to determine which services you need to configure in your server farm. Search and indexing servers You must start and configure the Office SharePoint Server Search service on at least one of your front-end servers. This service provides search and indexing services.

You can start and configure this service on any type of server, including a server that is acting as an application server and provides only Office SharePoint Server 2007 services, a server that is acting as both an application server and a Web server and provides both Office SharePoint Server 2007 services and Web services, or a server that is acting as a Web server and provides only Web services. Web servers The Web server role is implemented by IIS and the Windows SharePoint Services Web Application service.

The Windows SharePoint Services Web Application service must be running on any server that acts as a Web server and renders Web content. This service is started by default on servers that you set up using the Web Front End option during Setup. Hope this is started by default in the farm.

In addition to configuring services on your front-end servers, you must create the Shared Services Provider (SSP). The SSP makes it possible to share the Office SharePoint Server 2007 services across your server farm. You must create the SSP before you can use it in a farm environment; Office SharePoint Server 2007 does not create the SSP by default in a farm environment.

The following procedures step you through the process of configuring Office SharePoint Server 2007 services, creating a Web application for the SSP, creating the SSP, and configuring indexing settings.

Start and configure the Search service

1. On the SharePoint Central Administration home page, click the Operations tab on the top navigation bar.

2. On the Operations page, in Topology and Services, click Servers in farm.

3. On the Servers in Farm page, click the server on which you want to configure the search service.

4. Click Start next to Office SharePoint Server Search.

5. On the Office SharePoint Server Search Settings page, in the Query and Indexing section, make sure that the Use this server for indexing content and Use this server for serving search queries check boxes are selected.

6. In the Default Catalog Location section, type a path to a physical folder to store the index files, or use the default location that is specified.

7. In the Contact E-Mail Address section, specify a valid e-mail address.

8. In the Service Account section, click Configurable, and in User name and Password, type theSERVICE ACCOUNT(DOMAIN\MOSSUSER)

9. In the Web Front End And Crawling section, do one of the following: If you are configuring the search service on a server that provides Web services and renders Web content, click No dedicated Web front-end computer for crawling If you are configuring the search service on a server that is a standalone search server that does not provide Web services and render Web content, click Use a dedicated web front end computer for crawling, and then, in Select a web front end computer, click the computer you want to use for crawling.

10. Click Start.

Create the Shared Services Provider SSP

1. On the SharePoint Central Administration home page, click the Application Management tab on the top navigation bar.

2. On the Application Management page, in the Office SharePoint Server Shared Services section, click Create or configure this farm's shared services.

3. On the Manage this Farm's Shared Services page, click New SSP. Note: We have to have an independent Web Application for SSP. If you have not created a Web application for the SSP administration site, you need to create one before you create the SSP. If you have already created a Web application for the SSP administration site, skip to step 14.

4. On the New Shared Services Provider page, click Create a new Web application.

5. On the Create New Web Application page, in the IIS Web Site section, click Create a new IIS web site, and do not modify the default settings in this section.

6. In the Security Configuration section, under Authentication provider, select the appropriate option for your environment, and do not modify the default settings in the remainder of this section.

7. In the Load Balanced URL section, do not modify the default settings.

8. In the Application Pool section, click Create new application pool.

9. In Application pool name, enter the name of your application pool or use the default name.

10. Click Configurable, and in User name and Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

11. In the Database Name and Authentication section, verify the database information and make sure that Windows Authentication (recommended)is selected.

12. In the Search Server section, do not modify the default settings.

13. Click OK. Upon successful creation of the Web application, the New Shared Services Provider page appears.

14. In the SSP Name section, in Web Application, select the Web application that you created for the SSP, and do not modify any of the default settings in this section.

15. In the My Site Location section, do not modify any of the default settings.

16. In the SSP Service Credentials section, in User name and Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

17. In the SSP Database section, you can either accept the default settings (recommended), or specify your own settings for the database server, the database name, or the SQL authentication credentials.

18. In the Search Database section, you can either accept the default settings (recommended), or specify your own settings for the search database server, the database name, or the SQL Server authentication credentials.

19. In the Index Server section, in Index Server, click the server on which you configured the Search service. Note: If there is no index server listed in the Index Server section, then no server in your farm has been assigned the index server role. To assign the index server role to a server in your farm, follow the instructions in the "Configure the Search service" section earlier in this topic.

20. In the SSL for Web Services section, click No.

21. Click OK. Upon successful creation of the SSP, the Success page appears.

22. On the Success page, click OK to return to the Manage this Farm's Core Services page.

Configure indexing settings

1. On the SharePoint Central Administration home page, click the Application Management tab on the navigation bar.

2. On the Application Management page, in the Office SharePoint Server Shared Services section, click Create or configure this farm's shared services.

3. On the Manage this Farm's Shared Services page, click SharedServices1.

4. On the Shared Services Administration page, in Search, click Search Settings.

5. On the Configure Search Settings page, in the Crawl Settings section, click Default content access account.

6. In the Default content access account section, in Account, Password, and Confirm Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

7. Click OK.

8. In the Crawl Settings section, click Content sources.

9. On the Manage Content Sources page, click Local Office SharePoint Server sites.

10. On the Edit Content Source page, in the Crawl Schedules section, under Full Crawl, click Create schedule.

11. In the Manage Schedules dialog box, configure schedule settings for full crawls of your content, and then click OK.

12. In the Crawl Schedules section, under Incremental Crawl, click Create schedule.

13. In the Manage Schedules dialog box, configure schedule settings for incremental crawls of your content, and then click OK.

14. In the Start Full Crawl section, select the Start full crawl of this content source check box, and then click OK. Create and configure a site After you configure services in your server farm, you can create a Web application and a site collection. You should create the Web application on the first server on which you installed Office SharePoint Server 2007 (in other words, the same server that is running the SharePoint Central Administration service).

Create a Web application for your SharePoint site On the SharePoint Central Administration home page, click the Application Management tab on the top navigation bar.

1. In the SharePoint Web Application Management section, click Create or extend Web application.

2. On the Create or Extend Web Application page, click Create a new Web Application.

3. On the Create New Web Application page, in the IIS Web Site section, click Create a new IIS web site, and change the port setting to port 80. This will allow you to access your site by typinghttp://ServerName. If you use a nonstandard port number you will have to include the port number in the URL to access your site (for example, http://ServerName:port).

4. In the Security Configuration section, under Authentication provider, select the appropriate option for your environment, and do not modify any other settings in this section. Note: By default, the authentication provider is set to NTLM.

6. In the Load Balanced URL section, do not modify the default settings.

7. In the Application Pool section, select Create new application pool, and use the default settings for the application pool name.

8. Click Configurable, and in User name and Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

9. In the Database Name and Authentication section, verify the database information and ensure Windows Authentication (recommended)is selected.

10. In the Search Server section, do not modify the default settings.

11. Click OK.

12. On the Application Created page, which appears after successful creation of the Web application, click Create a new Windows SharePoint Services site collection.

Create the site collection for your Web application

Tuesday, March 23, 2010

Backup & Restore MOSS SQL Server Method

Procedure to move a site from One FARM set up to a different FARM of SAME Configuration (Sharepoint Version)

1) I did a sitelock for the site you are going to back up.
This will ensure that content databases wont be updated as there is no option for users to add/edit the site.
stsadm –o setsitelock -lock readonly -url "http://corp-intranet:1200"

Gone to Central Administration and select the Application Management/Content databases

Selected the Application which has to be backed up. Clicked on the Content Database and Made the status as Offline (Ready/Offline). Clicked OK.

Gone to SQL Server Management Studio (Database Server) and took the back up as "Filename.bak"

Changed the Content Database Status to Ready once the back up is completed.

Set the site lock status to none after above steps are done.
stsadm –o setsitelock -lock none -url "http://corp-intranet:1200"


3) I restored the database back up "Filename.bak" database to the SQL instance for the new farm. (New database Server)

4) On the new farm, I opened SharePoint Central Administration.

5) On the Application Management tab, I created a new SharePoint Application. In doing so, I created a new web site that used the same port and host header the site on the original farm used.

6) When the application creation process completed, I did not run the Site Collection Creation Wizard.

7) Within SharePoint Central Administration Application Management tab, I clicked on Content Databases.

8) I verified the Web Application, then clicked on the content database (which is an empty content database created during the Web Application creation process)

9) On the Content Database Settings page, I changed the database status from Ready to Offline, clicked to select the option to Remove Content Database and clicked OK.

10) Back on the Manage Content Databases page, I verified the web application then clicked Add a content database.

11) On the Add Content Database page, I entered the name of my SQL server where I attached my restored database, as well as the database name. I verified Windows Authentication was selected, selected the appropriate Search Server, and clicked OK.

12) Once that process finished, I was returned to the Manage Content Databases tab and could see that the restored content database was now associated with the web application I had created minutes earlier.

13) I edited my local hosts file so the URL of my site would resolve to the local server

14) I opened a command prompt and ran an iisreset, then ran an ipconfig /flushdns, then pinged my site URL to verify it resolved to the local server.

15) I opened Internet Explorer and browsed to my site and voila! there it was!!

Monday, March 22, 2010

Installing and Configuring MOSS for Server Farm

Security account requirements

To install MOSS 2007 in a server farm environment, at-least 2 accounts are required.

(Only one account required when WFE and Database are on a Single computer.)


One as Domain User with Admin power in both the WFE and DB Server. This user should be manually added in to the SQL Server Users from the Management Studio. This should be able to login to SQL Server with Windows authentication should have DB Creator and Security Admin rights on SQL Server. This will be used for Installing MOSS and will be acted as SERVICE ACCOUNT for all the related services of MOSS.


Do not use the main domain\administrator account. This causes a problem if ever you wish to install Project Server 2007 on the same machine.

Account 1 (We call it as MOSSADMIN)

A user account that you can use to install Office SharePoint Server 2007 and run the SharePoint Products and Technologies Configuration Wizard. This account must be:

§ A domain user account.

§ A member of the Administrators group on each of your front-end servers.

§ A member of the SQL Server Logins, which grants login access to your SQL Server instance.

§ A member of the SQL Server Database Creator server role, which grants permission to create and alter databases.

§ A member of the SQL Server Security Administrators server role, which grants permission to manage server logins.


Account 2 (We Call this as MOSSUSER)

A unique domain user account that you can specify as the Office SharePoint Server 2007 service account. This user account is used to access your SharePoint configuration database. It also acts as the application pool identity for the SharePoint Central Administration application pool and it is the account under which the Windows SharePoint Services Timer service runs. The SharePoint Products and Technologies Configuration Wizard adds this account to the SQL Server Logins (We don’t need to manually add this in to SQL Server, Just provide when MOSS Technologies Configuration wizard asks), the SQL Server Database Creator server role, and the SQL Server Security Administrators server role. It is recommended that you follow the principle of least privilege and do not make this user account a member of any particular security group on your front-end servers or your back-end servers.

SQL Server Installation.

This has to be a different server.

(Preferably, SQL Server 2005 should be installed with Local System account (Local Administrator of that machine). If you install it with Domain Admin User, SQL Server uses Kerberos Security. I don’t prefer this as MOSS Configuration Wizard’s default installation would be on NTLM, not Kerberos. So, I just login as Local System Admin for installation rather than going with domain Admin.)

Select Database Engine and Analysis Services in the Wizard, No need of selecting the other features like integration Services. Click Advanced, Select Client Component Tools (This is for getting the Management Studio). Service pack 3 is a must for SQL Server for MOSS. Open up Management Studio and add the Service account in to the Users, assign permissions as DB Creator and Security Admin rights on SQL Server.

Log off from DB Server if you are logged in as LOCAL ADMIN and Login as MOSSADMIN and Connect to Database Engine through SQL Server Management Studio with Windows Authentication. Give DB Creator and Security Admin roles to this user .

Make sure that Collation settings is of Latin1_General_CI_AS_KS_WS

Enable the remote connection to the SQL Server through Serface Area Configuration wizard. Click Surface Area Configuration for Services and Connections. Select Remote Connections

Read out these carefully to prepare a new DB Server for MOSS

http://technet.microsoft.com/en-us/library/cc263187.aspx

Configure surface area settings in SQL Server 2005

1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.

2. In the SQL Server Surface Area Configuration dialog box, click Surface Area Configuration for Services and Connections.

3. In the tree, open your instance of SQL Server, open Database Engine, and then click Remote Connections.

4. Click Local and Remote Connections, click Using both TCP/IP and named pipes, and then click OK


How do i know the Version of SharePoint installed on my server?

To check this on a moss installed server, go to Central Administration(CA) > Operations > Servers in the farm. You can see the version of the MOSS there.

Also, To know the Edition of MOSS(Standard/Enterprise) you installed

Go to the Central administration -> Operations-> Enable Enterprise features. This will show you whether it is standard or enterprise. If it is enterprise edition, Button would be disabled.

Name

Version

MOSS 2007/WSS 3.0 Service Pack 1 (Contains the below)

12.0.0.6219

MOSS 2007/WSS 3.0 October 2007 Public Update

12.0.0.6039

MOSS 2007/WSS 3.0 August 2007 Hotfix

12.0.0.6036

MOSS 2007/WSS 3.0 RTM

12.0.0.4518

Framework 2.0 and 3.0 on the front end server (Where MOSS is going to be installed)

IIS on the Front end server with the rights

As the front end server runs with Windows Server 2008 Operating system(OS), Installing and configuring will not be as easy as on a 2003 OS.

For installing IIS refer http://learn.iis.net/page.aspx/29/install-iis-7-on-windows-server-2008-or-windows-server-2008-r2/

IIS 7 will get installed with .Net Framework 2.0. We need Framework 3.0 also to be installed on Moss WFE. Go to IIS Manager, Application Pools and see the version of Framework version in the right pane.

IIS Isolation mode settings (IF IIS 6.0)

1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

2. In the IIS Manager tree, click the plus sign ( ) next to the server name, and then right-click the Web Sites folder and select Properties.

3. In the Web Sites Properties dialog box, click the Service tab.

4. In the Isolation mode section, clear the Run WWW service in IIS 5.0 isolation mode check box, and then click OK.

IF IIS 7.0, This is to be as CLASSIC MODE (There is no Isolation mode in IIS 7, Instead it is Pipeline Mode)

1. Select Application Pools in IIS Manager in the left pane in IIS 7.0, In the middle pane, MODE will be displayed as INTEGRATED/CLASSIC. ASP.Net should be in CLASSIC Mode and Default Application Pool on INTEGRATED MODE

Enable ASP.NET 2.0 in IIS 6.0


You must enable ASP.NET 2.0 on all Office SharePoint Server 2007 servers.


Enable ASP.NET 2.0

1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.


2. In the IIS Manager tree, click the plus sign (+) next to the server name, and then click the Web Service Extensions folder.


3. In the details pane, click ASP.NET v2.0.50727, and then click Allow.


Enabling ASP.Net 2.0 is not required for IIS 7.0 I Guess. By default it does this configuration during installation.


Login as MOSSADMIN User in the WFE server and click on the MOSS Setup exe file. This is the account will be used to Run MOSS and Run SharePoint Technologies Configuration Wizard. Service Account (MOSSUSER) will be given only when SharePoint Technologies Configuration Wizard asks for creating Sharepoint_config database.

Set up will ask for running the Sharepoint Technologies Configuration Wizard once the installation of Sharepoint is over. Provide the database server name and Service account credentials (MOSSUSER) here, Configuration Wizard creates the connection to the database server and create Configuration database (Sharepoint_Config) and other Configuration DBs like SSP, Search etc.

This process takes some time to complete the configuration.

The SharePoint Central Administration Web page opens.

Don’t refer
this linked article for installing in a Web Farm, because this is specifically instructed for an installation where WFE and DB Server on the same machine. Follow it if you are setting up both WFE and DB on a single server. It is a good written document.

Preparing Web Front End & Application servers.
DB Server Preperation

Do an IIS Reset and browse Central Administration(CA).

Notes

If you are prompted for your user name and password, you might need to add the SharePoint Central Administration site to the list of trusted sites and configure user authentication settings in Internet Explorer. Instructions for configuring these settings are provided in the next set of steps. If you see a proxy server error message, you might need to configure your proxy server settings so that local addresses bypass the proxy server. Instructions for configuring this setting are provided later in this section.

Add the SharePoint Central Administration site to the list of trusted sites

1. In Internet Explorer, on the Tools menu, click Internet Options.

2. On the Security tab, in the Select a Web content zone to specify its security settings box, click Trusted Sites, and then click Sites.

3. Clear the Require server verification (https:) for all sites in this zone check box.

4. In the Add this Web site to the zone box, type the URL for the SharePoint Central Administration site, and then click Add.

5. Select the Require server verification (https:) for all sites in this zone check box.

6. Click Close to close the Trusted Sites dialog box.

7. Click OK to close the Internet Options dialog box.

:) CA Loaded !

There would be some message in CA saying configuration is not complete.

Configure and run the Services in the server one by one as follows.

Configure 2007 Office SharePoint Server services After you have installed and configured Office SharePoint Server 2007 on all of your front-end servers, you must configure Office SharePoint Server 2007 services. The services you need to configure depends on your server topology and the server roles you deploy. Use the following guidelines to determine which services you need to configure in your server farm. Search and indexing servers You must start and configure the Office SharePoint Server Search service on at least one of your front-end servers. This service provides search and indexing services.

You can start and configure this service on any type of server, including a server that is acting as an application server and provides only Office SharePoint Server 2007 services, a server that is acting as both an application server and a Web server and provides both Office SharePoint Server 2007 services and Web services, or a server that is acting as a Web server and provides only Web services. Web servers The Web server role is implemented by IIS and the Windows SharePoint Services Web Application service.


The Windows SharePoint Services Web Application service must be running on any server that acts as a Web server and renders Web content. This service is started by default on servers that you set up using the Web Front End option during Setup. Hope this is started by default in the farm.

In addition to configuring services on your front-end servers, you must create the Shared Services Provider (SSP). The SSP makes it possible to share the Office SharePoint Server 2007 services across your server farm. You must create the SSP before you can use it in a farm environment; Office SharePoint Server 2007 does not create the SSP by default in a farm environment.

The following procedures step you through the process of configuring Office SharePoint Server 2007 services, creating a Web application for the SSP, creating the SSP, and configuring indexing settings.

Start and configure the Search service

1. On the SharePoint Central Administration home page, click the Operations tab on the top navigation bar.

2. On the Operations page, in Topology and Services, click Servers in farm.

3. On the Servers in Farm page, click the server on which you want to configure the search service.

4. Click Start next to Office SharePoint Server Search.

5. On the Office SharePoint Server Search Settings page, in the Query and Indexing section, make sure that the Use this server for indexing content and Use this server for serving search queries check boxes are selected.

6. In the Default Catalog Location section, type a path to a physical folder to store the index files, or use the default location that is specified.

7. In the Contact E-Mail Address section, specify a valid e-mail address.

8. In the Service Account section, click Configurable, and in User name and Password, type theSERVICE ACCOUNT(DOMAIN\MOSSUSER)

9. In the Web Front End And Crawling section, do one of the following: If you are configuring the search service on a server that provides Web services and renders Web content, click No dedicated Web front-end computer for crawling If you are configuring the search service on a server that is a standalone search server that does not provide Web services and render Web content, click Use a dedicated web front end computer for crawling, and then, in Select a web front end computer, click the computer you want to use for crawling.

10. Click Start.

Create the Shared Services Provider SSP

1. On the SharePoint Central Administration home page, click the Application Management tab on the top navigation bar.

2. On the Application Management page, in the Office SharePoint Server Shared Services section, click Create or configure this farm's shared services.

3. On the Manage this Farm's Shared Services page, click New SSP. Note: We have to have an independent Web Application for SSP. If you have not created a Web application for the SSP administration site, you need to create one before you create the SSP. If you have already created a Web application for the SSP administration site, skip to step 14.

4. On the New Shared Services Provider page, click Create a new Web application.

5. On the Create New Web Application page, in the IIS Web Site section, click Create a new IIS web site, and do not modify the default settings in this section.

6. In the Security Configuration section, under Authentication provider, select the appropriate option for your environment, and do not modify the default settings in the remainder of this section.

7. In the Load Balanced URL section, do not modify the default settings.

8. In the Application Pool section, click Create new application pool.

9. In Application pool name, enter the name of your application pool or use the default name.

10. Click Configurable, and in User name and Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

11. In the Database Name and Authentication section, verify the database information and make sure that Windows Authentication (recommended)is selected.

12. In the Search Server section, do not modify the default settings.

13. Click OK. Upon successful creation of the Web application, the New Shared Services Provider page appears.

14. In the SSP Name section, in Web Application, select the Web application that you created for the SSP, and do not modify any of the default settings in this section.

15. In the My Site Location section, do not modify any of the default settings.

16. In the SSP Service Credentials section, in User name and Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

17. In the SSP Database section, you can either accept the default settings (recommended), or specify your own settings for the database server, the database name, or the SQL authentication credentials.

18. In the Search Database section, you can either accept the default settings (recommended), or specify your own settings for the search database server, the database name, or the SQL Server authentication credentials.

19. In the Index Server section, in Index Server, click the server on which you configured the Search service. Note: If there is no index server listed in the Index Server section, then no server in your farm has been assigned the index server role. To assign the index server role to a server in your farm, follow the instructions in the "Configure the Search service" section earlier in this topic.

20. In the SSL for Web Services section, click No.

21. Click OK. Upon successful creation of the SSP, the Success page appears.

22. On the Success page, click OK to return to the Manage this Farm's Core Services page. Configure indexing settings

1. On the SharePoint Central Administration home page, click the Application Management tab on the navigation bar.

2. On the Application Management page, in the Office SharePoint Server Shared Services section, click Create or configure this farm's shared services.

3. On the Manage this Farm's Shared Services page, click SharedServices1.

4. On the Shared Services Administration page, in Search, click Search Settings.

5. On the Configure Search Settings page, in the Crawl Settings section, click Default content access account.

6. In the Default content access account section, in Account, Password, and Confirm Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

7. Click OK.

8. In the Crawl Settings section, click Content sources.

9. On the Manage Content Sources page, click Local Office SharePoint Server sites.

10. On the Edit Content Source page, in the Crawl Schedules section, under Full Crawl, click Create schedule.

11. In the Manage Schedules dialog box, configure schedule settings for full crawls of your content, and then click OK.

12. In the Crawl Schedules section, under Incremental Crawl, click Create schedule.

13. In the Manage Schedules dialog box, configure schedule settings for incremental crawls of your content, and then click OK.

14. In the Start Full Crawl section, select the Start full crawl of this content source check box, and then click OK. Create and configure a site After you configure services in your server farm, you can create a Web application and a site collection. You should create the Web application on the first server on which you installed Office SharePoint Server 2007 (in other words, the same server that is running the SharePoint Central Administration service).

Create a Web application for your SharePoint site On the SharePoint Central Administration home page, click the Application Management tab on the top navigation bar.

1. In the SharePoint Web Application Management section, click Create or extend Web application.

2. On the Create or Extend Web Application page, click Create a new Web Application.

3. On the Create New Web Application page, in the IIS Web Site section, click Create a new IIS web site, and change the port setting to port 80. This will allow you to access your site by typinghttp://ServerName. If you use a nonstandard port number you will have to include the port number in the URL to access your site (for example, http://ServerName:port).

4. In the Security Configuration section, under Authentication provider, select the appropriate option for your environment, and do not modify any other settings in this section. Note: By default, the authentication provider is set to NTLM.

6. In the Load Balanced URL section, do not modify the default settings.

7. In the Application Pool section, select Create new application pool, and use the default settings for the application pool name.

8. Click Configurable, and in User name and Password, type the SERVICE ACCOUNT(DOMAIN\MOSSUSER)

9. In the Database Name and Authentication section, verify the database information and ensure Windows Authentication (recommended)is selected.

10. In the Search Server section, do not modify the default settings.

11. Click OK.

12. On the Application Created page, which appears after successful creation of the Web application, click Create a new Windows SharePoint Services site collection.

Create the site collection for your Web application