Simple insert and Gridview in webservices

Simple Insert in webservices:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;

namespace webservices
{
    /// <summary>
    /// Summary description for sample
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class sample : System.Web.Services.WebService
    {

URL REWRITING IN ASP.NET (OR) HOW TO HIDE .ASPX

URL REWRITING IN ASP.NET (OR) HOW TO HIDE .ASPX(VS 2012 OR VERSION 4.5)


This article how to hide .aspx in version 4.5

step:1

visual studio 2012--> file--->new project--->solution explore---> add reference--->system.web.routing

WEBUSER CONTROL

HOW TO CREATE WEBUSER CONTROL

VISUAL STUDIO->SOLUTION EXPLORE->ADD NEW ITEM->WEBUSERCONTROL


WEBUSERCONTROL EXTENSTION--ASCX

Webusercontrol.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="usercontrol.WebUserControl1" %>
<table>
<tr><td><asp:Label ID="labname1" runat="server" Text="Name"></asp:Label></td><td>:</td><td><asp:TextBox ID="txtname1" runat="server" ></asp:TextBox></td></tr>
<tr><td><asp:Label ID="labsal" runat="server" Text="Salary"></asp:Label></td><td>:</td><td><asp:TextBox ID="txtsal" runat="server" ></asp:TextBox></td></tr>
<tr><td></td><td></td><td><asp:Button ID="btemp" runat="server" Text="save"
        onclick="btemp_Click" /></td></tr>


WEB SERVICE IN ASP.NET

BASIC IN WEB SERVICES.


HOW TO ADD TWO VALUE IN WEB SERVICES USING ASP.NET IN C#


Visuval studio 2012àfile-ànew project-àsolution floder-àadd new item-àwebservices.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace ws
{
    /// <summary>
    /// Summary description for WebService1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public int Add(int a, int b)
        {
            return a + b;
        }
    }
}

GOOGLE LANGUAGE TRANS LATER IN ASP.NET WEBSITE

ASP.NET WEBSITE LANGUAGE TRANS LATER:

REGISTER IN THIS LINK:
http://translate.google.com   (website translate)(register or gmail account)


INSERT UPDATE DELETE USING STORED PROCEDURE

INSERT UPDATE DELETE USING STORED PROCEDURE



STORED PROCEDURE


ALTER procedure RegIns(
@id int,
@username varchar(25),
@Password varchar(35),
@Count int

)
as
begin
if @count=1
begin
update reg set  Password=@Password ,username=@username where id=@id
end
else if @count=2
begin

LISTVIEW IN ASP.NET USING C#

INSERT,UPDATE,DELETE IN LIST VIEW

LIST.ASPX


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="listview.list" %>

<!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>Untitled Page</title>
</head>

INSERT,UPDATE,DELETE IN WINDOWS COMMUNICATION FOUNDATION

INSERT,UPDATE,DELETE IN WCF

Visual studio 2008àfileànewàprojectàwcfservicesà

WCF SERVICES HAVE TWO PAGES:
1.SERVICE.CS
2.ISERVICE

SERVICE.CS:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using System.Data.SqlClient;

WINDOWS COMMUNICATION FOUNDATION

BASIC OF WINDOWS COMMUNICATION FOUNDATION.


            WCF communicate any technology and all channels(http,tcp).
             Wcf have services,endpoints and binding.

Services:

The services is basically written on .net language. which contain some methods.that are exposed through wcf services.

Endpoints:

       
A service may have one or more endpoints.endpoint is responsibe for communication for service to the client.
     endpoint is A,B,C

CAPTCHA CREATION

CAPTCHA CREATION



captcha.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="captcha.aspx.cs" Inherits="captcha" %>

HOW TO CREATE A CAPTCHA IN FORM USING C#

HOW TO CREATE A CAPTCHA IN FORM USING C#



Registration.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Registration.aspx.cs" Inherits="Registration" %>

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

HOW TO GET A RANDOM VALUE IN BUTTON CLICK

HOW TO GET A RANDOM VALUE IN BUTTON CLICK

random.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="random.aspx.cs" Inherits="random" %>

<!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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    </div>
    <asp:TextBox ID="TextBox1" runat="server" ToolTip="RANDOM VALUE"></asp:TextBox>
    <asp:Button ID="Button1"
        runat="server" Text="Button" onclick="Button1_Click" />
    </form>
</body>
</html>

SENDING MAIL USING C#

SENDING MAIL USING C#

email.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="email.aspx.cs" Inherits="email" %>

<!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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table >
    <tr><td><asp:Label ID="labto" runat="server" Text="To"></asp:Label></td><td>:</td><td><asp:TextBox ID="txtto" runat="server" ></asp:TextBox></td></tr>
    <tr><td><asp:Label ID="labsub" runat="server" Text="Sub"></asp:Label></td><td>:</td><td><asp:TextBox ID="txtsub" runat="server" ></asp:TextBox></td></tr>
    <tr><td><asp:Label ID="labmsg" runat="server" Text="Message"></asp:Label></td><td>:</td><td><asp:TextBox ID="txtmsg" runat="server" ></asp:TextBox></td></tr>
   
    </table>
    </div>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
    </form>
</body>
</html>


MOVE DATAS FROM ONE GRIDVIEW ROWS TO ANOTHER GRIDVIEW IN ASP.NET

MOVE DATAS FROM ONE GRIDVIEW ROWS TO ANOTHER GRIDVIEW IN ASP.NET


grid.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="groid.aspx.cs" Inherits="groid" %>

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

EXPORT A DATA FROM GRIDVIEW TO EXCEL USING C#

EXPORT A DATA FROM GRIDVIEW TO EXCEL USING C#



excel.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="excel.aspx.cs" Inherits="excel" %>

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

Create a Captcha with Refresh button in c#

Create a Captcha with Refresh button in c#
captcha.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="captcha.aspx.cs" Inherits="captcha" %>

<!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 runat="server">
  
<title>Captcha Image with Refresh Button</title>
<script type="text/javascript">
    function RefreshCaptcha() {
        var img = document.getElementById("imgCaptcha");
        img.src = "Handler.ashx?query=" + Math.random();
    }
</script>
</head>
<body>
<form id="form2" runat="server">
<div>
<img src="Handler.ashx" id="imgCaptcha" />
<a href="#" onclick="javascript:RefreshCaptcha();">Refresh</a>
</div>
</form>
</body>


</html>

Encrypt or Decrypt user password in c#


Encrypt or Decrypt user password in c#

encryptdecrypt.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!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 runat="server">
    <title></title>

OOPS PROGRAM IN C #


OOPS BASIC PROGRAM IN C# 


CLASS PROGRAM:



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;