Installing SharePoint Foundation 2010 – Step by Step

We are always fall in problem to install SharePoint 2010 for the first time. Here is the step by step approach to install SharePoint 2010. This article is very much handy to install SharePoint Foundation 2010. Installation of other version of SharePoint is almost same. Here I have installed Windows 2008 Server in VMWare Workstation with 4GB of RAM. Below is the step by step approach to install SharePoint 2010.

Step 1: Install Windows 2008 Server R2

Step 2: Configure Windows Server 2008 R2 to install SharePoint 2010

Step 3: Create Domain Controller

Step 4: Install SQL Server – 2008 R2

Step 5: Install Prerequisites

There are two ways to install prerequisite –

i)        First way – Download the following prerequisites according to your Server Requirements and install it’s to the server. Keep in mind, some are already installed in your computer so don’t worry about installation problem. May be all prerequisite is not necessary for your server.
a.  Windows 2008 R2 and Windows Server 2008 KB971831
b. WCF Fix article for Windows 2008 R2 and Windows 7 KB976462
c. Microsoft SQL Server 2008 Native Client
d. Microsoft “Geneva” Framework Runtime
e. Microsoft Sync Framework Runtime v1.0 (x64)
f. Microsoft Chart Controls for Microsoft .NET Framework 3.5
g. Microsoft SQL Server 2008 Analysis Services ADOMD.NET
h. PowerShell V2 RTM
i. SQL Server 2008 SP1
j. .NET Framework 3.5 Service Pack 1 (Full Package)
k. Microsoft Filter Pack x64 for sharepoint

ii)       Second way – This is the very easy way. Just click executable file (SharePointFoundation.exe). Click “Install software prerequisite” of the screen.


Click “Next” to start installation of pre requisites


Mark for license Agreement and Click Next

1-2Pre requisites is installing.


Click Finish to complete installation of Pre requisites.


Step 6: Start SharePoint 2010 Foundation installation – Click Executable file (SharePointFoundation.exe). Click “Install SharePoint Foundation” in the splash screen.


Step 7: Mark to the license agreement and click Continue.


Step – 8: Browse data location and Click “Install Now”

4Installation Progress…


Step 9: Mark “Run the SharePoint Product Configuration Wizard now” and click “Close”.


Step 10: Click “Next” of the SharePoint Products Configuration Wizard.


Step 11: Click “Yes” of the following pop up screen and then click “Next”.


Step 12: Select “Create a new server farm” and then click “Next” of the following screen.


Step -13: Type your database server name, database Name (default: SharePoint_Config), user name (domain name\User name) and password in the following Database Settings screen.


Step 14: Type Passphrase and confirm passphrase in the Farm Security Settings screen and click “Next”


Step 15: To specify port of Central administration we application – Mark specify port number and type your desired port. Select NTLM as default as authentication provider for Web application.


Step 16: Click “Next” in following SharePoint Product Configuration Wizard. If required click Advanced Settings for advanced configuration


Configuring SharePoint Products…..

14Step 17: You will see the following screen after configuring SharePoint Server successfully. Necessary information is given here. Click “Finish” to continue.


Step 18: Type username (my user name: Administrator) and password to enter the server.


Step 19: Select “No, I don’t wish to participate” and click “ok” in the following screen.


Step – 20: Click “Start the Wizard” in the following screen.


Step -21: Select “Use existing managed account” and click “Next”


20Step -22: Type site title and description, select template as Team site and click Ok.


Step – 23: Farm configuration completed. Click “Finish” in the Farm Configuration wizard.


Step – 24: Now you will see the central administration. If you see in the closer look, you will see it uses port -2010(read circle) which you configured at step – 15.


Step – 25: If you want to see the site which you already created just type “htttp://yourservername:80” in the url.

24Yes! You have successfully installed and configured SharePoint 2010. Thanks for your patience.

Populate Dropdownlist with selected Index

This is a demo to populate dropdownlist by C#.

Step 1: Create a dropdownlist

Create a dropdownlist in page. Here, I created a dropdownlist name ddlStudentInfo.

Step 2: Create StudentInfo class

Create a student info class to create list of StudentInfo object.

public class StudentInfo
public int Id { get; set; }
public string Name { get; set; }

Step 3: Populate dropdownlist

Create a list of StudentInfo object. Make it data source of dropdownlist and choose your selected index. Here, I choose selected index 2 means dropdownlist shows Asrafuzzaman as selected text and 3 as selected value. I have write all those in Page Load. You can do as you required.

protected void Page_Load(object sender, EventArgs e)
List lstStudentInfo = new List();

StudentInfo objStudentInfo1 = new StudentInfo();
objStudentInfo1.Id = 1;
objStudentInfo1.Name = "Mahedee Hasan";


StudentInfo objStudentInfo2 = new StudentInfo();
objStudentInfo2.Id = 2;
objStudentInfo2.Name = "Mahmud Ahsan";

StudentInfo objStudentInfo3 = new StudentInfo();
objStudentInfo3.Id = 3;
objStudentInfo3.Name = "Asrafuzzaman";

StudentInfo objStudentInfo4 = new StudentInfo();
objStudentInfo4.Id = 4;
objStudentInfo4.Name = "Enamul Haque";

ddlStudentInfo.DataSource = lstStudentInfo;
ddlStudentInfo.DataValueField = "Id";
ddlStudentInfo.DataTextField = "Name";
ddlStudentInfo.SelectedIndex = 2; //Selected index 2 means selected value is 3 and text is Asrafuzzaman



File Upload to Server with

File Upload to Server with Uploading file to server from client sometimes very tricky. Sometimes it is required that you will not upload file more than certain size. This is the step by step approach to upload file from client to server.

Step 1: Add html input type as file

<input id =”uploadFile” type=”file” runat=”server” />

Step 2: Create a button to upload file in the server

<asp:Button ID=”Button1″ runat=”server” OnClick=”Button1_Click”  />

Step 3: Create a folder in the web project like “TempFiles”
Step 4: Upload file in the server.

protected void Button1_Click(object sender, EventArgs e)

if (this.uploadFile.PostedFile != null)
// Get a reference to PostedFile object
HttpPostedFile huploadFile = uploadFile.PostedFile;

// Get size of uploaded file
int nFileLen = huploadFile.ContentLength;

decimal fileSize = uploadFile.PostedFile.ContentLength / 1024;
if (fileSize > 100) //If file size is no more than 100 KB
this.lblMsg.Text = "Size of this image is greater than 100KB";

byte[] scriptData = new byte[nFileLen];

// Read uploaded file from the Stream
huploadFile.InputStream.Read(scriptData, 0, nFileLen);

string filePath = Server.MapPath("TempFiles");

filePath = filePath + "\\" + Path.GetFileName(uploadFile.PostedFile.FileName); //concate filename with file path
FileStream newFile = new FileStream(filePath, FileMode.Create);

// Write data to the file
newFile.Write(scriptData, 0, scriptData.Length);

// Close file
lblMsg.Text = "This is an empty file";