<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>
<!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>Search</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" width="70%" border="4" background="BackGround.jpg" align="center">
<tr><td><marquee>
<asp:Label ID="lblsearchName" runat="server" Text="Search Your Address"
BackColor="#ff9900"> </asp:Label>
</marquee>
</td></tr>
<tr><td> <asp:Label ID="lblSearch" runat="server" Text="Search By:" Font-Bold="true"
ForeColor="#0000ff"> </asp:Label>
<asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label></td></tr>
<tr><td height="5px"></td></tr>
<tr><td>
<asp:Label ID="lblIDsearch" runat="server" Text="ID" Width="120px"> </asp:Label>
<asp:TextBox ID="txtIDSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnIDSearch" runat="server" Text="Search" OnClick="btnIDSearch_Click" />
</td></tr>
<tr><td height="5px"></td></tr>
<tr><td>
<asp:Label ID="lblName" runat="server" Text="First Name" Width="120px"></asp:Label>
<asp:TextBox ID="txtFirstNameSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnNameSearch" runat="server" Text="Search" OnClick="btnFirstNameSearch_click" />
</td></tr>
<tr><td height="5px"></td></tr>
<tr><td>
<asp:Label ID="lblLastName" runat="server" Text="Last Name" Width="120px"> </asp:Label>
<asp:TextBox ID="txtLastNameSearch" runat="server"> </asp:TextBox>
<asp:Button ID="btnLastNameSearch" runat="server" Text="Search" OnClick="btnLastNameSearch_Click" />
</td></tr>
<tr><td height="5px"></td></tr>
<tr><td>
<asp:Label ID="lblMobilesearch" runat="server" Text="Mobile" Width="120px"></asp:Label>
<asp:TextBox ID="txtMobileSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnMobileSearch" runat="server" Text="Search" OnClick="btnMobileSearch_Click" />
</td></tr>
<tr><td height="5px"></td></tr>
<tr><td>
<asp:Label ID="lblEmailSearch" runat="server" Text="Email" Width="120px"></asp:Label>
<asp:TextBox ID="txtEmailSearch" runat="server"> </asp:TextBox>
<asp:Button ID="btnEmailSearch" runat="server" Text="Search" OnClick="btnEmailSearch_Click" />
</td></tr>
<tr><td> <asp:ImageButton ID="ImageMain" runat="server" ImageUrl="~/5ar04a.gif" OnClick="Main_Click"
ToolTip="Click Here To Go On All Record"/></td></tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="70%" align="center">
<tr><td height="5px"></td></tr>
<tr><td>
<asp:DataGrid ID="GridAllRecord" runat="server" AutoGenerateColumns="false" Width="100%" DataKeyField="ID"
BorderStyle="ridge" GridLines="Both" BorderWidth="2px" BorderColor ="white" BackColor="white" CellPadding="0"
OnItemCommand="Grid_ItemCommand" AllowSorting="true" PagerStyle-
HorizontalAlign="Center" PageSize=5 AllowPaging="true">
<FooterStyle ForeColor="Black" BackColor="#C6C3C6"></FooterStyle>
<HeaderStyle Font-Bold="True" ForeColor="#FFFFFF" BackColor="#A53A6A"></HeaderStyle>
<FooterStyle BackColor="beige" />
<PagerStyle Font-Bold="true" Mode=NumericPages Font-Underline="true"/>
<Columns>
<asp:BoundColumn DataField=ID HeaderText="ID" Visible="false">
<ItemStyle BackColor="graytext" />
<HeaderStyle BackColor="graytext" />
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="First Name" >
<ItemTemplate>
<asp:LinkButton ID="lnkName" runat="server"
Text='<%#DataBinder.Eval(Container.DataItem,"FirstName") %>' CommandName="RecordShow">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField=OfficialEmail HeaderText="Official(EMail)">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
<asp:BoundColumn DataField=PersonelEmail HeaderText="Personnel(EMail)">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
<asp:BoundColumn DataField=Mobile HeaderText="Mobile">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
</Columns>
</asp:DataGrid>
</td></tr></table>
</div>
</form>
</body>
</html>
Search.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Search : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection con;
SqlDataAdapter da;
SqlCommand cmd = new SqlCommand();
DataSet ds = new DataSet();
string connect = @"Data Source=MCN0100;Initial Catalog=AddressBook; Uid=sa; Pwd=";
string commandSearch;
protected void btnFirstNameSearch_click(object sender, EventArgs e)
{
if (txtFirstNameSearch.Text == "")
{
lblError.Text = "Please Enter First Name";
}
else
{
commandSearch = "select * from Record where FirstName='" + txtFirstNameSearch.Text + "'";
showSearchRecord();
}
}
protected void btnLastNameSearch_Click(object sender, EventArgs e)
{
if (txtLastNameSearch.Text == "")
{
lblError.Text = "Please Enter Last Name";
}
else
{
commandSearch = "select * from Record where LastName='" + txtLastNameSearch.Text + "'";
showSearchRecord();
}
}
protected void btnMobileSearch_Click(object sender, EventArgs e)
{
if (txtMobileSearch.Text == "")
{
lblError.Text = "Please Enter a Mobile Number";
}
else
{
commandSearch = "select * from Record where Mobile='" + txtMobileSearch.Text + "'";
showSearchRecord();
}
}
protected void btnEmailSearch_Click(object sender, EventArgs e)
{
if (txtEmailSearch.Text == "")
{
lblError.Text = "Please Enter a Email";
}
else
{
commandSearch = "select * from Record where personelEmail='" + txtEmailSearch.Text + "'";
showSearchRecord();
}
}
public void showSearchRecord()
{
con = new SqlConnection(connect);
cmd.CommandText = commandSearch;
cmd.Connection = con;
da = new SqlDataAdapter(cmd);
da.Fill(ds);
con.Open();
cmd.ExecuteNonQuery();
if (ds.Tables[0].Rows.Count > 0)
{
lblError.Text = "";
GridAllRecord.DataSource = ds;
GridAllRecord.DataBind();
}
else
{
lblError.Text = "No Address Found For This Search";
GridAllRecord.DataSource = null;
GridAllRecord.DataBind();
}
}
protected void Grid_ItemCommand(object sender, DataGridCommandEventArgs e)
{
if (e.CommandName == "RecordShow")
{
int Id = int.Parse(e.Item.Cells[0].Text);
Session["ID"] = Id;
Response.Redirect("ShowSelectedRecord.aspx");
}
}
protected void btnIDSearch_Click(object sender, EventArgs e)
{
if (txtIDSearch.Text == "")
{
lblError.Text = "Please Enter a ID";
}
else
{
commandSearch = "select * from Record where ID='" + txtIDSearch.Text + "'";
showSearchRecord();
}
}
protected void Main_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Allrecord.aspx");
}
}
Figure 4: Searching a address.
Login.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LoginCheck.aspx.cs" Inherits="LoginCheck" %>
<!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>Login User</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" width="60%" align="center" border=4 background="BackGround.jpg">
<tr><td align="center"><asp:Label ID="lblLoginWelcome" runat="server"
Text="Wecome Here In OnLine Address Book" ForeColor="Blue" Font-Bold="true"></asp:Label> </td></tr>
<tr><td><asp:Label ID="lblError" runat="server" Visible=false ForeColor="blue"></asp:Label></td></tr>
<tr><td><table cellpadding="0" cellspacing="0" width="50%" align="center" border="0">
<tr><td height="15px"></td></tr>
<tr><td><asp:Label ID="lblLogin" runat="server" Text="Login" Width="112px" Font-Bold="true"
ForeColor="#990066"></asp:Label>
<asp:TextBox ID="txtLogin" runat="server"> </asp:TextBox> </td></tr>
<tr><td height="15px"></td></tr>
<tr><td><asp:Label ID="lblPassword" runat="server" Text="Password" Width="112px" Font-Bold="true"
ForeColor="#990066"></asp:Label>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"> </asp:TextBox> </td> </tr>
<tr><td height="15px"></td></tr>
<tr><td align="center"><asp:Button ID="btnLogin" runat="server" OnClick="btnLogin_Click"
Text="Login" Width="76px" /> </td> </tr>
</table></td></tr>
</table>
</div>
</form>
</body>
</html>
Login.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class LoginCheck : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
if (txtLogin.Text == "rahul" && txtPassword.Text == "saxena")
{
Response.Redirect("UpdateTheRecord.aspx");
}
else
{
lblError.Visible = true;
lblError.Text = "Invalid User";
}
}
}
Figure 5: If user want to update the address then he have to Login before edit the an address
UpdateRecord
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateTheRecord.aspx.cs" Inherits="UpdateTheRecord" %>
<!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>Update Record</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" border="1" width="90%" align="center" background="BackGround.jpg">
<tr><td align="center">
<table cellpadding="0" cellspacing="0" width="80%" border="0" align="center">
<tr><td align="center" style="border-bottom:2px solid;">
<asp:Label ID="lblName" runat="server" Text="Update Personnel Information" Font-Bold="true"
Font-Size="14pt" ForeColor="#0099ff"></asp:Label> </td>
<td align="center" style="border-bottom:2px solid;">
<asp:Label ID="Label1" runat="server" Text="Update Professional Information" Font-Bold="true"
Font-Size="14pt" ForeColor="#ff6600"></asp:Label></td></tr>
<tr><td align="center">
<table>
<tr><td>
<marquee><asp:Label ID="lblPersonnelInformation" runat="server"
Text="Personnel Information" Font-Bold="True" ForeColor=ActiveCaption></asp:Label>
</marquee> </td> </tr>
<tr><td align="left"><asp:Label ID="lblFirstNmae" Text="First Name" runat="server" Width="100px"
ForeColor=ActiveCaption></asp:Label>
<asp:TextBox ID="txtFirstName" runat="server" Enabled=false></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblMiddleName" Text="Middle Name" runat="server"
Width="100px" ForeColor=ActiveCaption> </asp:Label>
<asp:TextBox ID="txtMiddleName" runat="server" Enabled=false>
</asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblLastName" Text="Last Name" runat="server" Width="100px"
ForeColor=ActiveCaption></asp:Label>
<asp:TextBox ID="txtLastName" runat="server" Enabled=false></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblHomePhone" Text="Home Phone" runat="server" Width="100px"
ForeColor=ActiveCaption> </asp:Label>
<asp:TextBox ID="txtHomePhone" runat="server"></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblMobile" Text="Mobile" runat="server" Width="100px"
ForeColor=ActiveCaption></asp:Label>
<asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblPersonelEmail" Text="Email" runat="server" Width="100px"
ForeColor=ActiveCaption></asp:Label>
<asp:TextBox ID="txtPersonnelEmail" runat="server"></asp:TextBox>
</td></tr>
</table></td>
<td>
<table>
<tr><td><marquee> <asp:Label ID="lblOfficeInformation" runat="server" Text="Official Information"
Font-Bold="True" ForeColor="Chocolate"> </asp:Label> </marquee></td></tr>
<tr><td align="left"><asp:Label ID="lblCompany" Text="Company" runat="server" Width="100px"
ForeColor="Chocolate"></asp:Label>
<asp:TextBox ID="txtCompany" runat="server"> </asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblJobTitle" Text="Job Title" runat="server" Width="100px"
ForeColor="Chocolate"></asp:Label>
<asp:TextBox ID="txtJobTitle" runat="server"></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblWebSite" Text="Web Site" runat="server" Width="100px"
ForeColor="Chocolate"></asp:Label>
<asp:TextBox ID="txtWebSite" runat="server"></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblOfficePhone" Text="OfficePhone" runat="server"
Width="100px" ForeColor="Chocolate"></asp:Label>
<asp:TextBox ID="txtOfficePhone" runat="server"></asp:TextBox>
</td></tr>
<tr><td align="left"><asp:Label ID="lblFax" Text="Fax" runat="server" Width="100px"
ForeColor="Chocolate"> </asp:Label>
<asp:TextBox ID="txtFax" runat="server"></asp:TextBox>
</td></tr>
<tr><td align="left"> <asp:Label ID="lblOfficeEmail" Text="Office Email" runat="server"
Width="100px" ForeColor="Chocolate" ></asp:Label>
<asp:TextBox ID="txtOfficeEmail" runat="server"></asp:TextBox>
</td></tr>
</table></td>
</tr>
<tr><td><asp:Label ID="Label2" runat="server" Width="120px" Text="Address" Font-Bold="true"
ForeColor=ActiveCaption></asp:Label>
<asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine"> </asp:TextBox>
</td></tr>
</table></td></tr>
<tr><td height="5px"></td></tr>
<tr><td align="center" height="50px"> <asp:Button ID="btnUpdateRecord" runat="server"
Text="Update The Record" Width="303px" OnClick="UpdateRecord_Click" />
<asp:ImageButton ID="ImageMain" runat="server" ImageUrl="~/5ar04a.gif" OnClick="Main_Click"
ToolTip="Click Here To Go On All Record"/> </td></tr>
</table>
</div>
</form>
</body>
</html>
UpdateRecord.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class UpdateTheRecord : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
record4Update();
}
}
SqlConnection con;
SqlDataAdapter da;
SqlCommand cmd = new SqlCommand();
DataSet ds = new DataSet();
string connect = @"Data Source=MCN0100;Initial Catalog=AddressBook; Uid=sa; Pwd=";
protected void UpdateRecord_Click(object sender, EventArgs e)
{
int IDUpdate = int.Parse(Session["UpadteAddressID"].ToString());
con = new SqlConnection(connect);
cmd.CommandText = "update Record set Jobtype='" + txtJobTitle.Text + "' , Company='" + txtCompany.Text + "', WebSite='" + txtWebSite.Text + "', OfficePhone='" + txtOfficePhone.Text + "', HomePhone='" + txtHomePhone.Text + "',Mobile='" + txtMobile.Text + "', Fax='" + txtFax.Text + "', OfficialEmail='" + txtOfficeEmail.Text + "', PersonelEmail='" + txtPersonnelEmail.Text + "', Address='"+txtAddress.Text+"' where ID="+IDUpdate;;
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
public void record4Update()
{
int IDUpdate = int.Parse(Session["UpadteAddressID"].ToString());
con = new SqlConnection(connect);
cmd.CommandText = "select * from Record where ID=" + IDUpdate;
cmd.Connection = con;
da = new SqlDataAdapter(cmd);
da.Fill(ds);
con.Open();
cmd.ExecuteNonQuery();
txtFirstName.Text = ds.Tables[0].Rows[0][2].ToString();
txtMiddleName.Text = ds.Tables[0].Rows[0][4].ToString();
txtLastName.Text = ds.Tables[0].Rows[0][3].ToString();
txtMobile.Text = ds.Tables[0].Rows[0][10].ToString();
txtOfficeEmail.Text = ds.Tables[0].Rows[0][12].ToString();
txtOfficePhone.Text = ds.Tables[0].Rows[0][8].ToString();
txtPersonnelEmail.Text = ds.Tables[0].Rows[0][13].ToString();
txtWebSite.Text = ds.Tables[0].Rows[0][7].ToString();
txtJobTitle.Text = ds.Tables[0].Rows[0][5].ToString();
txtCompany.Text = ds.Tables[0].Rows[0][6].ToString();
txtHomePhone.Text = ds.Tables[0].Rows[0][9].ToString();
txtFax.Text = ds.Tables[0].Rows[0][11].ToString();
txtAddress.Text = ds.Tables[0].Rows[0][14].ToString();
con.Close();
}
protected void Main_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("AllRecord.aspx");
}
}
Figure 6: In updating the Record.
ShowSelectedRecord.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShowSelectedRecord.aspx.cs" Inherits="ShowSelectedRecord" %>
<!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>Individual Record</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" border="1" width="90%" align="center" background="BackGround.jpg">
<tr><td><table cellpadding="0" cellspacing="0" width="70%" align="center" >
<tr><td align="center" style="border-bottom:2px solid;"> <asp:Label ID="lblName" runat="server" Text="Individual Record"
Font-Bold="true" Font-Size="14pt"></asp:Label> </td></tr>
<tr><td height="5px"></td></tr>
<tr><td><marquee behavior=alternate bgcolor="#ffcccc"><asp:Label ID="lblNameHeading" runat="server"
Font-Bold="true" ForeColor="#0000ff"></asp:Label>
<asp:Label ID="lblLastNameHeading" runat="server"
Width="140px" Font-Bold="true" ForeColor="#0000ff" > </asp:Label>
</marquee> </td ></tr>
<tr><td height="5px"> </td></tr>
<tr><td><table width="60%" align="center">
<tr><td><asp:Label ID="lblFirstname" runat="server" Width="140px" Text="First Name" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtFirsname" runat="server"></asp:TextBox></td></tr>
<tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="lblMiddleName" runat="server" Width="140px" Text="Middle Name" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtMiddleName" runat="server"></asp:TextBox></td></tr>
<tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="lblLastName" runat="server" Width="140px" Text="Last Name" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox></td></tr>
<tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="lblCompany" runat="server" Width="140px" Text="Company" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtCompany" runat="server"></asp:TextBox></td></tr>
<tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="lblJobTitle" runat="server" Width="140px" Text="Job Title" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtJobTitle" runat="server"></asp:TextBox></td></tr>
<tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="lblMobile" runat="server" Width="140px" Text="Mobile" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtMobile" runat="server"></asp:TextBox></td></tr>
<tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="lblPersonnelEmail" runat="server" Width="140px" Text="Personnel Email"
Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtPersonnelEmail" runat="server"></asp:TextBox>
</td></tr><tr><td height="5px"></td></tr>
<tr><td><asp:Label ID="Label1" runat="server" Width="140px" Text="Address" Font-Bold="true"></asp:Label>
<asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine"></asp:TextBox>
</td></tr>
<tr><td height="5px"></td></tr>
<tr><td> <asp:Button ID="btnAllRecord" runat="server" Text="Return On All Record" Width="303px"
OnClick="AllRecord_Click" /> </td></tr>
</table></td></tr>
</table></td></tr>
</table>
</div>
</form>
</body>
</html>
ShowSelectedRecord.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class ShowSelectedRecord : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
record();
}
string connection = @"Data Source=MCN0100;Initial Catalog=AddressBook; Uid=sa; Pwd=";
SqlConnection con;
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
public void record()
{
int ID = int.Parse(Session["ID"].ToString());
con = new SqlConnection(connection);
cmd.CommandText = "select * from record where ID="+ID;
cmd.Connection = con;
da = new SqlDataAdapter(cmd);
da.Fill(ds);
con.Open();
cmd.ExecuteReader();
if (ds.Tables[0].Rows.Count > 0)
{
txtFirsname.Text = ds.Tables[0].Rows[0][2].ToString();
txtLastName.Text = ds.Tables[0].Rows[0][3].ToString();
txtMiddleName.Text = ds.Tables[0].Rows[0][4].ToString();
txtCompany.Text = ds.Tables[0].Rows[0][6].ToString();
txtJobTitle.Text = ds.Tables[0].Rows[0][5].ToString();
txtMobile.Text = ds.Tables[0].Rows[0][10].ToString();
txtPersonnelEmail.Text = ds.Tables[0].Rows[0][13].ToString();
lblNameHeading.Text = ds.Tables[0].Rows[0][2].ToString();
lblLastNameHeading.Text = ds.Tables[0].Rows[0][3].ToString();
txtAddress.Text== ds.Tables[0].Rows[0][14].ToString();
}
else
{
Response.Write("No Record");
}
con.Close();
}
protected void AllRecord_Click(object sender, EventArgs e)
{
Response.Redirect("AllRecord.aspx");
}
}
Figure 7: Selected Address.