-->

Wednesday, January 15, 2014

Search Engine project with source code in ASP.NET

Download this project

Project cost : 300Rs or $10
Pay me at:

Via bank transfer
 
ICICI bank account number is :    153801503056
Account holder name is :                 Tarun kumar saini
IFSC code is :                                   ICIC0001538

SBBJ bank detail :                             61134658849
Account holder name:                        Tarun kumar saini
IFSC code :                                        SBBJ0010398


CONTACT ME

Introduction

Search engine means , you can search any item from the database. Basically a search engine depends on various algorithms. In this project we use simple search algorithm. That algorithm is
First you fill the table by some value like insert title, description, URL, keywords etc. After feeding the data you can search in it.

Software requirement of the project are

1. Visual Studio 2010 with sql server 2008

Download

mail to me : narenkumar851@gmail.com     for project source code

Designing patterns 

1. First prepare master page for outer structure.
2. Search item using TextBox from database also take output in Gridview.
3. Design Admin Login page for feeding data into database table.
4. Also set permission for admin (admin can remove item from database table)


Search Code using stored procedure

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <p>
        Enter Text Here :
        <asp:TextBox ID="TextBox1" runat="server" Height="32px" Width="237px"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="Button1" runat="server" Height="33px" onclick="Button1_Click" 
            Text="Search" Width="122px" />
    </p>
    <p>
        <asp:GridView
         AutoGenerateColumns ="false"
          ID="GridView1" runat="server"
           Height="180px" Width="426px" GridLines ="None" AllowPaging="True" 
            onpageindexchanging="GridView1_PageIndexChanging" PageSize="5" 
            ShowHeader="False">
           <Columns>
           <asp:TemplateField>
              <ItemTemplate>
                  <asp:HyperLink ID="HyperLink1" runat="server" Text ='<%# Eval("title") %>' NavigateUrl='<%# Eval("URL") %>'/>
                  <br />
                  <asp:Label ID="Label1" runat="server" Text='<%# Eval("title") %>'/><br />
               <asp:Label ID="description" runat="server" Text='<%# Eval("metaDescription") %>'/>
               <asp:Label ID="Label2" runat="server" Text='<%# Eval("keywords") %>'/>
              </ItemTemplate>
               
           </asp:TemplateField>
           
          
           </Columns>
        
        </asp:GridView>
    </p>
<p>
        &nbsp;</p>
</asp:Content>


Csharp File code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection();
    SqlCommand cmd = new SqlCommand();
    DataSet ds = new DataSet();
     
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        loadgrid();

    }

    private void loadgrid()
    {
        con.ConnectionString = connection.Connectionstring;
        con.Open();
        cmd.CommandText = "GetEngine";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@parameter", TextBox1.Text);
        cmd.Connection = con;
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        da.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        loadgrid();
    }
}


Search Engine project with source code  in ASP.NET

Search Engine project with source code  in ASP.NET


If you want to purchase this please contact me on :  narenkumar851@gmail.com

Tuesday, January 14, 2014

How to create and read Profile Group in ASP.NET

Step-1: Add this code into web.config file

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <system.web>
      <authentication mode="Windows" />
      <profile>
        <properties>
          <group name ="AuthorInfo">
            <add name="AuthorName"/>
            <add name ="age"/>
            <add name="rights"/>
              
            
          </group>

          <group name ="EditorInfo">

            <add name ="EditorName"/>
            <add name ="EditorMail"/>
            <add name ="Editorrights"/>
          </group>
          
        </properties>
      </profile>
        <compilation debug="false" targetFramework="4.0" />
    </system.web>

</configuration>

Step-2: Add this code into .aspx file
 
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">  
    protected void Page_Load(object sender, System.EventArgs e)  
    {
        // Author Information
        Profile.AuthorInfo.AuthorName = "Rhett Butler";
        Profile.AuthorInfo.age = "30";
        Profile.AuthorInfo.rights = "Article writing";
        
        // Editor Information

        Profile.EditorInfo.EditorName = "Jacob Lefore";
        Profile.EditorInfo.EditorMail = "narenkumar851@gmail.com";
        Profile.EditorInfo.Editorrights = "full rights";
        
        
       
        
    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text += "<b>Author Information</b><br/>";
        Label1.Text += Profile.AuthorInfo.AuthorName+"<br/>";
        Label1.Text += Profile.AuthorInfo.age + "<br/>";
        Label1.Text += Profile.AuthorInfo.rights + "<br/>";
        Label1.Text += "<b>Editor Information</b><br/>";
        Label1.Text += Profile.EditorInfo.EditorName + "<br/>";
        Label1.Text += Profile.EditorInfo.EditorMail  + "<br/>";
        Label1.Text += Profile.EditorInfo.Editorrights + "<br/>";
        
        
        
        
        
        
    }
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Get Lastupdated Date</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2>Create user Group</h2>
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Get user Group" 
            Width="169px" onclick="Button1_Click" />
        <br /><br />  
    </div>  
    </form>  
</body>  
</html>

Code Generate the following output

How to create and read Profile Group in ASP.NET

How to Get Last Activity Date of Profile user in ASP.NET

Step-1: Add this code into web.config file

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <system.web>
      <authentication mode="Windows" />
      <profile>
        <properties>
          <add name="UserName"/>
        </properties>
      </profile>
        <compilation debug="false" targetFramework="4.0" />
    </system.web>

</configuration>

Step-2: Add this code into .aspx page (Before add this code, please create profile first )

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">  
    protected void Page_Load(object sender, System.EventArgs e)  
    {
       
        
    }  

    protected void update_date(object sender, EventArgs e)
    {
        Label1.Text += "current Date and Time is " + DateTime.Now.ToString() +"<br/>";
        Label1.Text += "Profile LastUpdate Date is " + Profile.LastActivityDate; 
            
         

    }
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Get Last Activity Date</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2>Get Last activity Date</h2>
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Get Last Activity Date" 
            Width="169px" onclick="update_date" />
        <br /><br />  
    </div>  
    </form>  
</body>  
</html>
Code Generate the following output
How to Get Last Activity Date of Profile user in ASP.NET

Monday, January 13, 2014

How to Get Last Updated Date of Profile user in ASP.NET

Step-1: Add this code into web.config file

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <system.web>
      <authentication mode="Windows" />
      <profile>
        <properties>
          <add name="UserName"/>
        </properties>
      </profile>
        <compilation debug="false" targetFramework="4.0" />
    </system.web>

</configuration>

Step-2: Add this code into .aspx page (Before add this code, please create profile first )

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">  
    protected void Page_Load(object sender, System.EventArgs e)  
    {
       
        
    }  

    protected void update_date(object sender, EventArgs e)
    {
        Label1.Text += "current Date and Time is " + DateTime.Now.ToString() +"<br/>";
        Label1.Text += "Profile LastUpdate Date is " + Profile.LastUpdatedDate;
         

    }
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Get Lastupdated Date</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2>Last updated Date</h2>
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Get Last Updated Date" 
            Width="169px" onclick="update_date" />
        <br /><br />  
    </div>  
    </form>  
</body>  
</html>

Code Generate the following output

How to Get Last Updated Date of Profile user in ASP.NET

ProfileManager.DeleteProfile method delete profile in asp.net example

Step-1: Add this code in web.config file
<configuration>

    <system.web>
      <authentication mode="Windows" />
      <profile>
        <properties>
          <add name="UserName"/>
        </properties>
      </profile>
        <compilation debug="false" targetFramework="4.0" />
    </system.web>

</configuration>

Step-2: Add this code into your .aspx page

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">  
    protected void Page_Load(object sender, System.EventArgs e)  
    {   
        if(!Page.IsPostBack)  
        {
            Profile.UserName = "Jacob Lefore";
            Profile.Save();
            Label1.Text = "Current User:" + Profile.UserName;  
        }  
    }  
  

    

    protected void DelteProfile(object sender, EventArgs e)
    {
        ProfileManager.DeleteProfile(User.Identity.Name);
        Profile.Save();
        Label1.Text = "Profile Deleted";

    }
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Delete Users Profile</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <h2>Delete User Profile</h2>
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Delete User Profile" 
            Width="169px" onclick="DelteProfile" />
        <br /><br />  
    </div>  
    </form>  
</body>  
</html>
Code generate the following output
ProfileManager.DeleteProfile method delete profile in asp.net example
ProfileManager.DeleteProfile method delete profile in asp.net example
ProfileManager.DeleteProfile method delete profile in asp.net example
ProfileManager.DeleteProfile method delete profile in asp.net example





Computer Programming: Web Form controls, General introduction in ASP.NET

The Web form controls are closely designed to resemble standard Visual basic Winforms controls. These controls are used for designing the interface for any Web application, for example, when you visit the website of Google, you type your search query in a TextBox, which is a control. ASP.NET provides a standard set of controls that can be used for the development of Web Applications. You can access all these controls from the ToolBox present in the Visual Studio Integrated Development Environment ( IDE ) . These controls can easily be used by just dragging and dropping them at any desired location on the Web form. Based on the tasks performed by them, these controls on the ToolBox are grouped under various categories known as tabs. For example, controls for validating the data are put under the validation tab and controls used for logging on the websites are put under the Login tab. Similarly, controls for common use are put under the standard tab and are known as standard controls . All these controls come under the Control class. All the Standard/ Web server controls are based on the WebControl class, which, in turn, is based on the control class. In other words, the WebControl class has originated from the Control class.

Later session we will discuss about the inheritance hierarchy, pubic properties, public methods, and public events of the Controls and the WebControl classes. We also get to know about the various controls such as Label, Button, TextBox, Literal, Placeholder, Hidden Field, and FileUpload that originate from the WebControl class, along with their implementations.  

Sunday, January 12, 2014

How to Perform Grouping of Data Matching a Criteria: SQL Programming

The database users might need to view data in a user-defined format. These reports might involve summarizing data on the basis of various criteria. SQL Server allows you to generate summarized data reports using the PIVOT clause of SELECT statement.

The PIVOT operator is used to transform a set of columns into values. PIVOT rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output. In addition, it also performs aggregations on the remaining column values if required in the output. Following is the syntax of PIVOT operator is:

SELECT * from table_name
PIVOT (aggregation_function (value_column)
FOR pivot_column
IN (column_list)
) table_alias

Where,

  • Table_name: name of table on which query will execute.
  • Pivot_column: the only column on which condition perform.
  • Table_alias: alias name of the table used in query only.

Consider an example, you want to display the number of purchase orders placed by certain employees, laid down with the vendors. The following query provides this report:

SELECT VendorID, [164] AS Empl, [198] AS Emp2, [223] AS Emp3, [231] AS Emp4, [233] AS Emp5 FROM
(SELECT PurchaseOrderID, EmployeeID, VendorID
FROM Purchasing.PurchaseOrderHeader) p
PIVOT
(
COUNT (PurchaseOrderID)
FOR EmployeeID IN
( [164], [198],[223], [231], [233] )
) AS pvt
ORDER BY VendorID

Following output is displayed by the preceding statements.

How to Perform Grouping of Data Matching a Criteria: SQL Programming


© Copyright 2013 Computer Programming | All Right Reserved