Hi supun.d.kaduw...,
Database
For this example I have used of Northwind database that you can download using the link given below.
Download Northwind Database
HTML
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
    Height="400" Width="600" BestFitPage="False" ToolPanelView="None" />
<hr />
<asp:Literal ID="ltEmbed" runat="server" />
Namespaces
C#
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
VB.Net
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        ReportDocument crystalReport = new ReportDocument();
        crystalReport.Load(Server.MapPath("~/CustomerReport.rpt"));
        Customers dsCustomers = this.GetData("SELECT TOP 5 * FROM customers");
        crystalReport.SetDataSource(dsCustomers);
        CrystalReportViewer1.ReportSource = crystalReport;
        Stream stream = crystalReport.ExportToStream(ExportFormatType.PortableDocFormat);
        byte[] buf;
        buf = new byte[stream.Length];
        stream.Read(buf, 0, buf.Length);
        File.WriteAllBytes(Server.MapPath("~/Report.pdf"), buf);
        string embed = "<object data=\"{0}\" type=\"application/pdf\" width=\"500px\" height=\"300px\">";
        embed += "If you are unable to view file, you can download from <a href = \"{0}\">here</a>";
        embed += " or download <a target = \"_blank\" href = \"http://get.adobe.com/reader/\">Adobe PDF Reader</a> to view the file.";
        embed += "</object>";
        ltEmbed.Text = string.Format(embed, ResolveUrl("~/Report.pdf"));
    }
}
private Customers GetData(string query)
{
    string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
    SqlCommand cmd = new SqlCommand(query);
    using (SqlConnection con = new SqlConnection(conString))
    {
        using (SqlDataAdapter sda = new SqlDataAdapter())
        {
            cmd.Connection = con;
            sda.SelectCommand = cmd;
            using (Customers dsCustomers = new Customers())
            {
                sda.Fill(dsCustomers, "DataTable1");
                return dsCustomers;
            }
        }
    }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    If Not IsPostBack Then
        Dim crystalReport As ReportDocument = New ReportDocument()
        crystalReport.Load(Server.MapPath("~/CustomerReport.rpt"))
        Dim dsCustomers As Customers = Me.GetData("SELECT TOP 5 * FROM customers")
        crystalReport.SetDataSource(dsCustomers)
        CrystalReportViewer1.ReportSource = crystalReport
        Dim stream As Stream = crystalReport.ExportToStream(ExportFormatType.PortableDocFormat)
        Dim buf As Byte()
        buf = New Byte(stream.Length - 1){ }
        stream.Read(buf, 0, buf.Length)
        File.WriteAllBytes(Server.MapPath("~/Report.pdf"), buf)
        Dim embed As String = "<object data=""{0}"" type=""application/pdf"" width=""500px"" height=""300px"">"
        embed += "If you are unable to view file, you can download from <a href = ""{0}"">here</a>"
        embed += " or download <a target = ""_blank"" href = ""http://get.adobe.com/reader/"">Adobe PDF Reader</a> to view the file."
        embed += "</object>"
        ltEmbed.Text = String.Format(embed, ResolveUrl("~/Report.pdf"))
    End If
End Sub
Private Function GetData(ByVal query As String) As Customers
    Dim conString As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
    Dim cmd As SqlCommand = New SqlCommand(query)
    Using con As SqlConnection = New SqlConnection(conString)
        Using sda As SqlDataAdapter = New SqlDataAdapter()
            cmd.Connection = con
            sda.SelectCommand = cmd
            Using dsCustomers As Customers = New Customers()
                sda.Fill(dsCustomers, "DataTable1")
                Return dsCustomers
            End Using
        End Using
    End Using
End Function