HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory.

Today I was trying to run a simple web service that I had deployed on IIS, I kept getting the following error message while opening the web service with a browser.

HTTP Error 403.14 – Forbidden

Web server is configured to not list the contents of this directory

enter image description here

Solution

Here is what I did to get it working !

Step 1 : Open the IIS

Step 2 : Find the “Directory Browsing” option in the feature view of the web service application.

enter image description here

Step 3 : As seen in the screenshot below, enable the “Directory Browsing” option

enter image description here

Step 4 : Test again. It should work now. (worked for me atleast :P) Hope this helps you too :)

How to show the invoke button in a web service using C# and ASP.NET

When deploying a webservice on IIS or otherwise, you may need to show an INVOKE button for testing or debugging the deployed webservice.

An invoke button looks like the one shown below…

For enabling this, just add HttpPost and HttpGet protocol under the webServices section of your web.config.

Excerpts from the web.config :

<system.web>
<webServices>
     <protocols>
       <add name="HttpGet"/>
       <add name="HttpPost"/>
     </protocols>
</webServices>

...

</system.web>

Why to enable ?

This by default is disabled to increase the security in the live enviroment, but can be enabled by adding these two protocols for testing or debugging the deployed web services.

England vs Italy Euro 2012 Highlights, Penalty Shoot outs and more

England vs Italy Euro 2012 Highlights, Penalty Shoot outs and more : Italy beat England 4-2 on penalties following a goalless match to earn a Euro 2012 semi-final clash with Germany on Thursday in Warsaw on Thursday.

RESULT: Italy beat England 4-2 on penalties

Penalty shootouts :

England vs Italy 0-1 Mario Balotelli Scores
England vs Italy 1-1 Steven Gerrard Scores
England v Italy 1-1 Riccardo Montolivo Misses
England v Italy 2-1 Wayne Rooney scores
England v Italy 2-2 Andrea Pirlo scores
England vs Italy 2-2 Ashley Young misses
England vs Italy 2-3 Antonio Nocerino scores
England vs Italy 2-3 Ashley Cole misses
England vs Italy 2-4 Alessandro Diamanti scores

Highlights :


Roooooooney by dm_4fdfae0464397

How to read data from database using SqlDataReader in C#

Import the System.Data.SqlClient first.

using System.Data.SqlClient;

SqlDataReader provides a way of reading a forward-only stream of rows from a SQL Server database.

SqlDataReader are used when the need is simply to display the records, not update them. You cannot update using SqlDataReader.

The code below is pretty self explanatory(read the comments), in case of queries please feel free to write in using the comment box below.

using System;
using System.Data.SqlClient;

class Program
{
static void Main()
{
// assign connectionString
string connectionString = "your connection string to go here";

using (SqlConnection con = new SqlConnection(connectionString))
{
// Open the SqlConnection.
con.Open();

string command = "SELECT * FROM YASSER_Table"; 

using (SqlCommand command = new SqlCommand(command, con))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine("{0} {1}",
reader.GetInt32(0), reader.GetString(1));
}
}

}// end of using (SqlConnection)

}
}

References : 

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx

http://www.dotnetperls.com/sqldatareader

What is the difference between Strings and StringBuilder in C# .NET ?

Short Answer : String is immutable – whereas StringBuilder is mutable.

What does that mean ?

Wiki says : In object-oriented, an immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created.

From the StringBuilder Class documentation:

The String object is immutable. Every time you use one of the methods in the System.String class, you create a new string object in memory, which requires a new allocation of space for that new object.

In situations where you need to perform repeated modifications to a string, the overhead associated with creating a new String object can be costly.

The System.Text.StringBuilder class can be used when you want to modify a string without creating a new object. For example, using the StringBuilder class can boost performance when concatenating many strings together in a loop.

Now keeping all these facts in mind, I tried out the following piece of code and I was very suprised at the results.

Code :

Stopwatch stopwatch = new Stopwatch();

// Bad Code  
stopwatch.Start();  
string str1 = "";  
for (int i = 0; i < 100000; i++)  
{  
str1 += i;  
}  
stopwatch.Stop();  
Console.WriteLine("Time taken using string : " + stopwatch.Elapsed.Seconds + "seconds" );

stopwatch.Reset();

// Good Code  
stopwatch.Start();  
StringBuilder builder = new StringBuilder();  
for (int i = 0; i < 100000; i++)  
{  
builder.Append(i);  
}  
string str2 = builder.ToString();  
stopwatch.Stop();  
Console.WriteLine("Time taken using string : " + stopwatch.Elapsed.Seconds + "seconds");

Output:

Highest Paid Sportsmen List for 2012

Here is a list of highest paid sportsmen for the year 2012, source : Forbes

#1 Floyd Mayweather Total earnings: $85 million
#3 Tiger Woods Total earnings: $59.4 million
#5 Roger Federer Total earnings: $52.7 million
#6 Kobe Bryant Total earnings: $52.3 million
#8 David Beckham Total earnings: $46 million
#9 Cristiano Ronaldo Total earnings: $42.5 million
#11 Lionel Messi Total earnings: $39 million
#20 Michael Schumacher Total earnings: $30 million
#31 Mahendra Singh Dhoni Total earnings: $26.5 million
#78 Sachin Tendulkar Total earnings: $18.6 million

Full List

#1 Floyd Mayweather
Total earnings: $85 million

#2 Manny Pacquiao
Total earnings: $62 million

#3 Tiger Woods
Total earnings: $59.4 million

#4 LeBron James
Total earnings: $53 million

#5 Roger Federer
Total earnings: $52.7 million

#6 Kobe Bryant
Total earnings: $52.3 million

#7 Phil Mickelson
Total earnings: $47.8 million

#8 David Beckham
Total earnings: $46 million

#9 Cristiano Ronaldo
Total earnings: $42.5 million

#10 Peyton Manning
Total earnings: $42.4 million

#11 Lionel Messi
Total earnings: $39 million

#12 Haloti Ngata
Total earnings: $37.3 million

#13 Larry Fitzgerald
Total earnings: $36.8 million

#14 Ndamukong Suh
Total earnings: $36 million

#15 Charles Johnson
Total earnings: $34.4 million

#16 Rafael Nadal
Total earnings: $33.2 million

#16 Mario Williams
Total earnings: $33.2 million

#18 Alex Rodriguez
Total earnings: $33 million

#19 Fernando Alonso
Total earnings: $32 million

#20 Valentino Rossi
Total earnings: $30 million

#21 Michael Schumacher Total earnings: $30 million

#22 Darrelle Revis
Total earnings: $28.3 million

#23 Dale Earnhardt Jr.
Total earnings: $28.2 million

#24 Wladimir Klitschko
Total earnings: $28 million

#24 Lewis Hamilton
Total earnings: $28 million

#26 Maria Sharapova
Total earnings: $27.9 million

#27 Sam Bradford
Total earnings: $27.8 million

#28 Tom Brady
Total earnings: $27.1 million

#29 Joe Mauer
Total earnings: $27 million

#30 Eli Manning
Total earnings: $26.6 million

#31 Mahendra Singh Dhoni
Total earnings: $26.5 million

#31 LaMarr Woodley
Total earnings: $26.5 million

#33 Dwight Howard
Total earnings: $25.6 million

#34 Kevin Durant
Total earnings: $25.5 million

#35 Dwyane Wade
Total earnings: $24.7 million

#36 Derek Jeter
Total earnings: $24.5 million

#37 Wayne Rooney
Total earnings: $24.3 million

#38 Mark Sanchez
Total earnings: $24.2 million

#39 Ichiro Suzuki
Total earnings: $24 million

#40 CC Sabathia
Total earnings: $23.8 million

#40 Johan Santana
Total earnings: $23.8 million

#42 Total earnings: $23.6 million
Salary/winnings: $13.6 million

#43 Ben Roethlisberger
Total earnings: $23.3 million

#44 Carmelo Anthony
Total earnings: $22.9 million

#45 Mark Teixeira
Total earnings: $22.8 million

#46 Amar’e Stoudemire
Total earnings: $22.7 million

#47 Tony Stewart
Total earnings: $22.3 million

#48 Luke Donald
Total earnings: $22.2 million

#49 Vernon Wells
Total earnings: $22.1 million

#50 Michael Vick
Total earnings: $22 million

#51 Logan Mankins
Total earnings: $21.9 million

#51 Richard Seymour
Total earnings: $21.9 million

#53 Jimmie Johnson
Total earnings: $21.5 million

#53 Ryan Howard
Total earnings: $21.5 million

#53 Adrian Peterson
Total earnings: $21.5 million

#56 Jon Beason
Total earnings: $21.4 million

#57 Kevin Garnett
Total earnings: $21.1 million

#58 Matthew Stafford
Total earnings: $20.9 million

#59 Miguel Cabrera
Total earnings: $20.8 million

#59 Kaká
Total earnings: $20.8 million

#61 Roy Halladay
Total earnings: $20.6 million

#61 Novak Djokovic
Total earnings: $20.6 million

#63 Usain Bolt
Total earnings: $20.3 million

#63 D’Brickashaw Ferguson
Total earnings: $20.3 million

#65 Sergio Aguero
Total earnings: $20.1 million

#66 DeAngelo Williams
Total earnings: $19.9 million

#67 Joe Thomas
Total earnings: $19.8 million

#68 Fernando Torres
Total earnings: $19.6 million

#68 Eric Berry
Total earnings: $19.6 million

#68 Prince Fielder
Total earnings: $19.6 million

#71 Ryan Kalil
Total earnings: $19.4 million

#72 Chris Paul
Total earnings: $19.2 million

#73 Yaya Touré
Total earnings: $19.1 million

#73 Tim Duncan
Total earnings: $19.1 million

#75 Miguel Cotto
Total earnings: $19 million

#76 Barry Zito
Total earnings: $18.9 million

#77 Robert Mathis
Total earnings: $18.7 million

#78 Carlos Lee
Total earnings: $18.6 million

#78 Sachin Tendulkar
Total earnings: $18.6 million

#78 Lawrence Timmons
Total earnings: $18.6 million

#81 Li Na
Total earnings: $18.4 million

#82 Alfonso Soriano
Total earnings: $18.3 millio

#82 Torii Hunter
Total earnings: $18.3 million

#84 Deron Williams
Total earnings: $18.2 million

#85 Jonathan Joseph
Total earnings: $18.1 million

#86 Darnell Dockett
Total earnings: $18 million

#87 Matt Holliday
Total earnings: $17.6 million

#88 Rashard Lewis
Total earnings: $17.5 million

#88 Justin Verlander
Total earnings: $17.5 million

#88 John Terry
Total earnings: $17.5 million

#91 Carlos Zambrano
Total earnings: $17.4 million

#91 Albert Pujols
Total earnings: $17.4 million

#91 Ernie Els
Total earnings: $17.4 million

#91 Rory McIlroy
Total earnings: $17.4 million

#95 Pau Gasol
Total earnings: $17.2 million

#96 Russell Okung
Total earnings: $17.1 million

#97 Steven Gerrard
Total earnings: $17 million

#98 Carl Crawford
Total earnings: $16.9 million

#99 Rolando McClain
Total earnings: $16.7 million

#100 Jake Peavy
Total earnings: $16.6 million

What is Microsoft Dynamics CRM ?

What is CRM?

CRM stands for Customer Relationship Management.

Customer relationship management (CRM) is a widely implemented model for managing a company’s interactions with customers, clients, and sales prospects.

It involves using technology to organize, automate, and synchronize business processes—principally sales activities, but also those for marketing, customer service, and technical support and many other things

Why do we use CRM?
The overall goals are to find, attract, and win new clients; nurture and retain those clients the company already has; and reduce the costs of marketing and client service.

What is Microsoft Dynamics?
Microsoft Dynamics is a line of CRM and ERP software applications developed by Microsoft.

This product focuses mainly on Sales, Marketing, and Service (help desk) sectors, but Microsoft has been marketing Dynamics CRM as an XRM (‘Extended Relationship Management’) platform and has been encouraging partners to use its.NET based framework to customize it to meet many different demands.

Client – Server and IIS
Dynamics CRM is a client-server application, which, like Microsoft SharePoint, is primarily an IIS-based web application which also supports extensive web services interfaces.

How do we access Microsoft Dynamics CRM?
Clients access Dynamics CRM either by using Microsoft Internet Explorer 6 or later web browser or by a thick client plug-in to Microsoft Outlook. While other browsers can be used to access Dynamics, results can be mixed and are not supported by Microsoft.

Features
Dynamics CRM version 4.0 adds a number of new features, including support for duplicate data detection and other enhancements. Perhaps most importantly, CRM 4.0 provides true multi-tenancy, which will allow the creation of multiple organizations on a single server.

CRM 4.0 was released with the following improvements:

  1. More powerful and easier to configure Reporting and BI (now based on SSRS instead of Crystal)
  2. More powerful data import tools, de-duplication capability now included
  3. Enhanced entity relationships – many to many, self-referential
  4. Improved programmability – enhanced Web Services, unified event model, plug-ins to replace callouts
  5. Light enquiry user license now available – potentially reducing the costs associated with rolling out across larger organizations
  6. Multi Tenancy – One server can host more than one business organization
  7. Multi Currency
  8. Multi Lingual
  9. Microsoft Office Communicator / Windows Live Messenger presence integration support
  10. Cloud Computing with Microsoft Online Services

Microsoft Dynamics CRM Modules
Microsoft CRM is divided into three main sections.

Microsoft Dynamics CRM Sales provides users with the tools to successfully manage every stage of the sales process.

  • Manage contacts and accounts
  • Improve time management
  • Promote leads to opportunities
  • Manage sales pipelines

Microsoft Dynamics Marketing Automation facilitates every aspect of campaign management and mass communications. Microsoft CRM supports everything from the initial planning stages through to measurement of success.

  • Generate and send communications
  • Manage workflow
  • Create targeted lists
  • Manage and track costs

Microsoft Dynamics Customer Service module acts as a central repository for all client information and enquiries. Microsoft CRM enables customer service representatives to provide a more consistent service supporting customer retention.

  • View history relating to a particular issue
  • Generate and log cases
  • Use information within the knowledge base to answer frequently asked questions
  • Assign cases to individuals or teams

CRM as a tool for communication

  • Scheduling calls and appointment – Using outlook
  • Faxing – built into Microsoft CMR Small Business Edition.
  • Emailing _ again uses Outlook for this
  • Printing – uses Microsoft Office

CRM with Accounting

With Microsoft Dynamics we can share customer, products, invoice and billing information.

Reasons of using CRM with Accounting

Case 1: No sales manager would want his team spending their time trying to close another deal with an existing customer when that customer hasn’t paid for the previous six orders stretching over the last eight months.

Case 2: Say a credit manager calls an existing client in an effort to collect a past-due payment, it may be important for the manager to understand that the sales department is on the verge of closing a megadeal with the very same client.

Workflow rules in Microsoft Dynamics CRM

Using workflow rules one can automate many routine function of an organization, such as following up with standard letter after an appointment or alerting members of your team to account-related deadlines etc…

Following are the several basic principles

  1. Assigning Task: Each task should have one (at least) primary person assigned to it.
  2. Feedback: Every step of every task should be confirmed. E.g.: Amazon.com feedback request after every purchase and delivery.
  3. Escalation: Assigning Task itself is not sufficient. Give each team member a reasonable amount of time to accomplish a task. If the task isn’t completed, make sure that the next person in the organization chart is notified. Continue escalating and notifying until something is done about the situation.
  4. 4.      Reporting and Measuring:

These are few workflow rules, using these rules you can program the business process you design. Workflow rules can access any of the data files in the Microsoft CRM and create activities for your user or send out correspondence through a fax or email. These rules can be used to notify you of overdue activities and can escalate important issues.

Microsoft CRM Server Editions

  1. Workgroup – This is intended for the smaller organization, you get five user licenses and that’s it. You can’t expand beyond five.
  2. Professional – Here you are limited only by the number of user licenses, you can purchase and always buy more as you grow. Like Workgroup, here too you can install only one copy of the software on one server, but it does have more power and flexibility when compared to the Workgroup edition.
  3. Enterprise – support for multi-currency, multi-language. You can have more than one copy of software on this server.

Hosting options

Microsoft Dynamics CRM is available on-premise and as an on-demand service (also known as Software as a Service) to provide users with choice of deployment methods to suit individual needs and budgets:

Microsoft CRM On-premise

Microsoft CRM can be installed directly into your IT environment, regardless of the size of your company.

Microsoft CRM Software as a Service or Live

Live actually means hosted or sometimes also referred to as SaaS (software as a service), here you don’t buy it, you rent it. This option is beneficial to those who do not have the facility to host Microsoft CRM on site. With Microsoft CRM Live, you don’t own the software; instead you temporarily own the right to use the software on someone else’s server, either a third party hosting company’s server or Microsoft itself.

How to change width / style for a column of a webgrid in MVC 3 Razor

In webgrid, using the style attribute we can specify a style for a column.

Please do not confuse yourself, by directly putting style=”width:10px” …

Webgrid’s style attribute is more like className !!!

The style attribute needs to have a class name which you may have defined in your css file.

@grid.GetHtml(columns: grid.Columns(
grid.Column("Username", "Username", canSort: true, style: "user"),
grid.Column("Password", "Password", canSort: true, style: "pass")
));

I have defined two seperate CSS classes : user and pass and have given some css property to it, say if you want to change the width of a column you can use the width property.

.user{
width:150px;
font-size:12px;
}

.pass {
width: 100px;
font-weight:bold;
}

Incase of any queries or suggestions, please feel free to write in using the comment section.