Someone has rightly said:
"A friend in need is a friend indeed"
In our life, friends are so precious that we don't want to forget them. But the problem is how we will remember them. Currently we can see so many social networking sites. So I got an idea of making such a site for my friends. Here in this site any user can see all registered user but if you want to visit the profile then you have to login in this site. First make your own profile and after it you can visit any user profile. While visiting the profile if you want to make this user as a friend then you can make. After this you can visit all friend list and profile from your account.
Design consideration has been left out in this project. The purpose is to have the functionality rather than design.
To use this project just attach the database which I stored in zip file and change the connection string in web.config file.
Let see the all pages used in this site:
This is the first page will show when user will run the application. Here on this page we can see all registered users:
AllRegisteredUsers.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AllRegisteredUsers.aspx.cs" Inherits="AllRegisteredUsers" %>
<!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>All Registered Users</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" width="90%" border="0" align="center" Background="BackGround.jpg">
<tr><td> <asp:Label ID="lblerror" ForeColor="Red" runat="server" Font-Bold="true">
</asp:Label>
</td></tr>
<tr> <td height="10px"> </td> </tr>
<tr><td height="10px"></td></tr>
<tr> <td align="center">
<marquee> <asp:Label ID="Label1" ForeColor="blue" runat="server" Font-Bold="true" Text="All Registered User" Font-Size="18pt">
</asp:Label>
</marquee>
</td></tr>
<tr><td>
<table cellpadding="0" cellspacing="0" width="90%" align="center">
<tr> <td align="right">
<asp:LinkButton ID="MyAccount" runat="server" Visible="false" Text="My Account" OnClick="MyAccount_Click">
</asp:LinkButton>
</td></tr>
<tr><td height="10px"> </td></tr>
<tr><td align="center">
<asp:DataGrid ID="GridAllRecord" runat="server" AutoGenerateColumns="false" Width="90%"
DataKeyField="RegistrarionID" PagerStyle-HorizontalAlign ="Center" BorderStyle="ridge"
GridLines="Both" BorderWidth="2px" BorderColor ="white" BackColor="white" CellPadding="3"
CellSpacing="1" OnEditCommand="EditAddress" OnDeleteCommand="AddressDelete"
OnItemCommand="Grid_ItemCommand" AllowSorting="true" PageSize="5"
OnPageIndexChanged= "GridAllRecord_PageIndexChanged" 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=RegistrarionID HeaderText="ID" Visible="false">
<ItemStyle BackColor="graytext" />
<HeaderStyle BackColor="graytext" />
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="First Name">
<ItemTemplate>
<asp:LinkButton ID="lnkName" runat="server" ToolTip="Click Here To See The Profile" Text='<%#DataBinder.Eval(Container.DataItem,"FirstName") %>' CommandName="RecordShow">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField=LastName HeaderText="Last Name">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
<asp:BoundColumn DataField=WebPage HeaderText="Web Page">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
<asp:BoundColumn DataField=AboutYourSelf HeaderText="My Self">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
<asp:BoundColumn DataField=Interest HeaderText="Interest">
<ItemStyle BackColor=GhostWhite />
</asp:BoundColumn>
<asp:ButtonColumn CommandName="DeleteAddress" HeaderText="Delete Address" Text="Delete">
</asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</td></tr>
<tr><td height="20px"></td></tr>
<tr><td align="Right">
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" Width="250px" Height="50px" />
<br /> <br />
<asp:Button ID="Button1" runat="server" Text="New User" OnClick="btnRegister_Click" Width="250px" Height="50px" />
</td></tr>
</table>
</td></tr>
<tr><td height="200px"> </td></tr>
</table>
</div>
</form>
</body>
</html>
AllRegisteredUsers.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 AllRegisteredUsers : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
AllRecord();
if(!object.Equals(Session["LoginID"], null))
{
MyAccount.Visible = true;
}
}
}
SqlConnection con;
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da;
DataSet ds = new DataSet();
public void AllRecord()
{
con = new SqlConnection(ConfigurationSettings.AppSettings["Connect"]);
cmd.CommandText = "Select RegistrarionID,FirstName,LastName,WebPage,AboutYourSelf,Interest from Registration";
//cmd.CommandText = "select * from Registration";
da = new SqlDataAdapter(cmd);
cmd.Connection = con;
da.Fill(ds);
con.Open();
cmd.ExecuteNonQuery();
GridAllRecord.DataSource = ds;
GridAllRecord.DataBind();
}
public void AddressDelete( object sender, DataGridCommandEventArgs e)
{
if (!object.Equals(Session["LoginID"], null))
{
if (Session["LoginID"].ToString() == "rahulSaxena")
{
int User_Id = int.Parse(e.Item.Cells[0].Text);
con = new SqlConnection(ConfigurationSettings.AppSettings["Connect"]);
cmd.CommandText = "delete from Registration where RegistrarionID='" + User_Id + "'";
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
else
{
lblerror.Text = "You can't Delete the profile";
}
}
else
{
Response.Redirect("Default.aspx");
}
}
public void EditAddress(object sender, DataGridCommandEventArgs e)
{
}
public void Grid_ItemCommand(object sender, DataGridCommandEventArgs e)
{
if (e.CommandName == "RecordShow")
{
if (!object.Equals(Session["LoginID"], null))
{
int User_Id = int.Parse(e.Item.Cells[0].Text);
string Friend_name = e.Item.Cells[1].Text;
Session["ShowProfile"] = User_Id;
Session["Friend_Name"] = Friend_name;
Response.Redirect("MakeFriend.aspx");
}
else
{
Response.Redirect("Default.aspx");
}
}
else
if (e.CommandName == "DeleteAddress")
{
if (!object.Equals(Session["LoginID"], null))
{
if (Session["LoginID"].ToString() == "RahulSaxena")
{
int User_Id = int.Parse(e.Item.Cells[0].Text);
con = new SqlConnection(ConfigurationSettings.AppSettings["Connect"]);
cmd.CommandText = "delete from Registration where RegistrarionID='" + User_Id + "'";
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
else
{
lblerror.Text = "You can't Delete the profile";
}
}
else
{
Response.Redirect("Default.aspx");
}
}
}
public void GridAllRecord_PageIndexChanged(object sender, DataGridPageChangedEventArgs e)
{
GridAllRecord.CurrentPageIndex = e.NewPageIndex;
AllRecord();
}
public void MyAccount_Click(object sender, System.EventArgs e)
{
Response.Redirect("MyAccount.aspx");
}
protected void btnLogin_Click(object sender, EventArgs e)
{
Response.Redirect("Default.aspx");
}
protected void btnRegister_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
}

Figure 1: All Registered Users.
Now if any registered user want to login to the site then here is the Login page:
DefaultLogin.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="tblSendMail" cellspacing="1" cellpadding="5" width="100%" runat="server" background="BackGround.jpg" >
<tr><TD class="TextBlack">
</TD><TD></TD>
<td align="left">
<asp:Label ID="lblError" runat="server" CssClass="redtext" Visible="False" Font-Bold="True">
</asp:Label>
<asp:Label ID="statusLabel" runat="server" CssClass="redtext" Visible="False" Font-Bold="True">
</asp:Label>
</td>
</tr>
<tr> <td> </td><td> </td>
<td> <marquee> <asp:Label ID="lblLoginmsg" runat="server" Text="Please Login" Font-Bold="true" Font-Size="20pt" ForeColor="#66ffcc">
</asp:Label>
</marquee></td></tr>
<tr>
<TD class="TextBlack">
</TD>
<td align="right" valign="middle">
<asp:Label ID="lbllogin" runat="server" Text="Login ID" ForeColor="Red" >
</asp:Label><span class="redtext">*</span>
</td>
<td align="left">
<asp:textbox id="txtLoginId" runat="server" CssClass="NormalTextBox" Width="270px">
</asp:textbox>
</td>
</tr>
<tr>
<TD></TD>
<td align="right" valign="middle">
<asp:Label ID="lblpassword" CssClass="logintext" runat="server" Text="Password" ForeColor="Red">
</asp:Label><span class="redtext">*</span>
</td>
<td align="left">
<asp:textbox id="txtPassword" runat="server" CssClass="NormalTextBox" Width="270px" TextMode="Password">
</asp:textbox>
</td>
</tr>
<tr>
<td></td><td> </td>
<td align="left" class="GrayFont">
<asp:CheckBox ID="chkBoxRemember" runat="server" Checked="True" CssClass="GrayFont" Text="Remember Me? |"/>
<asp:LinkButton ID="lnkforget" runat="server" Text="Forgot Your Password ?" OnClick="lnkforget_Click" CssClass="HeaderLink1">
</asp:LinkButton> <br />
New user
<asp:LinkButton ID="lnkBtnRegisterHere" runat="server" CssClass="HeaderLink1" Font-Bold="False" OnClick="lnkBtnRegisterHere_Click">
Register Here</asp:LinkButton>
</td>
</tr>
<tr> <TD></TD> <td></td>
<td align="left">
<asp:button id="btnLogin" runat="server" CssClass="NormalButton" Text="Login" Width="121px" OnClick="btnLogin_Click" Font-Bold="True">
</asp:button>
<asp:button id="Button1" runat="server" CssClass="NormalButton" Text="Home Page" Width="121px" OnClick="btnHomePage_Click" Font-Bold="True">
</asp:button>
</td>
</tr>
<tr><td height="25px"> </td></tr>
</table>
</div>
</form>
</body>
</html>
DefaultLogin.aspx.cs
using System;
using System.Data;
using System.Configuration;
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 _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection con;
SqlCommand cmd = new SqlCommand();
SqlDataReader dr;
protected void btnLogin_Click(object sender, EventArgs e)
{
if (funCheck())
{
con = new SqlConnection(ConfigurationSettings.AppSettings["Connect"]);
cmd.CommandText = "select User_LoginId from UserIDInformation where User_LoginId='" + txtLoginId.Text + "'";
cmd.Connection = con;
con.Open();
dr = cmd.ExecuteReader();
if (dr.Read())
{
Session["LoginID"] = txtLoginId.Text;
Response.Redirect("MyAccount.aspx");
}
else
{
Response.Redirect("Login.aspx");
}
con.Close();
}
}
protected void lnkforget_Click(object sender, EventArgs e)
{
}
protected void lnkBtnRegisterHere_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
private bool funCheck()
{
string sMessage = "Enter: ";
bool bCheck = false;
if (txtLoginId.Text == "")
{
sMessage += " UserID";
bCheck = true;
}
if (txtPassword.Text == "")
{
if (bCheck)
sMessage += "/Password ";
else
sMessage += "Password ";
bCheck = true;
}
if (bCheck == true)
{
lblError.Visible = true;
lblError.Text = sMessage;
return false;
}
else
return true;
}
protected void btnHomePage_Click(object sender, EventArgs e)
{
Response.Redirect("AllRegisteredUsers.aspx");
}
}
Figure 2: Login Page
If any user wants to register to this site then he/she have to follow Registration process, like as:
Login.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
<!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>Register login</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="Table2" cellSpacing="0" cellPadding="0" width="90%" align="center" border="0" bgcolor="#ffcccc">
<tr><td height="20px"></td> </tr>
<tr> <td vAlign="top" class="graytext" height="10">
<table cellSpacing="0" cellPadding="0" border="0" width="85%" align="center">
<tr width="100%">
<td colspan=5>
<asp:label id="lblError" runat="server" Font-Bold="True" ForeColor="Red">
</asp:label>
<asp:label id="lblEmailError" runat="server" ForeColor="Red" Font-Bold="True"></asp:label>
</td>
</tr>
<tr><td height="20px"></td> </tr>
<tr> <td height="40px" align="center" colspan=5 width="100%">
<asp:Label ID="lblMessage" runat="server"
Text="Please fill all the information in the fields given below and the fields
marked with an asterisk" ForeColor="Blue" Font-Bold="true" Font-Size="16px"> </asp:Label>
<asp:Label ID="lblhead" runat="server" ForeColor="Red" Text="(*)"></asp:Label>
<asp:Label ID="lblmandatry" runat="server" ForeColor="Blue" Text="are mandatory." Font-Bold="true">
</asp:Label>
</td>
</tr>
<tr>
<td height="18px" colspan=5>
</td>
</tr>
<TR height=30><td width="5%"></td>
<TD align="left" >
<span style="color: red">*</span>
<asp:label id="LabelUserId" runat="server" Text="User ID"
Font-Bold="true"> </asp:label>
</TD>
<TD vAlign="middle" class="gray" align="left" colspan=4 style="height: 30px" >
<asp:textbox id="TextBoxUserId" runat="server" CssClass="NormalTextBox" Width="180px" MaxLength="50">
</asp:textbox>
User Id cannot have space in between!
<asp:requiredfieldvalidator id="RFVUserId" runat="server" ErrorMessage="UserId"
ControlToValidate="TextBoxUserId" Display="None">User ID </asp:requiredfieldvalidator>
<asp:RegularExpressionValidator ID="revId" runat="server" ControlToValidate="TextBoxUserId"
ErrorMessage="Invalid UserId" Display="None" ValidationExpression="^([a-zA-Z0-9-_]+[\s]*)$">
</asp:RegularExpressionValidator>
</TD>
</TR>
<tr><td height="10px"></td></tr>
<tr height=30><td width="5%"></td>
<TD align="left" valign="top" >
<span style="color: red">*</span><asp:label id="Label1" runat="server" Font-Bold="true">
E-Mail Address</asp:label> </TD>
<TD vAlign="top" align="left" class="gray" colspan=4 >
<asp:textbox id="txtBoxUserEMail" runat="server" CssClass="NormalTextBox" Width="180px" MaxLength="50">
</asp:textbox>
Enter valid & unique Email address
<asp:requiredfieldvalidator id="RFVUserEMail" runat="server" ErrorMessage="EMail Address"
ControlToValidate="txtBoxUserEMail" Display="None" CssClass="redtext">User EMail
</asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id="REVUserEMail" runat="server" ErrorMessage="Enter Correct E-Mail"
ControlToValidate="txtBoxUserEMail" Display="None"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
CssClass="redtext">User EMail </asp:regularexpressionvalidator> </TD>
</tr>
<tr><td height="10px"></td></tr>
<TR height=30><td width="5%"> </td>
<TD align="left" valign="top">
<span style="color: red">*</span>
<asp:label id="LabelPassword" runat="server" Font-Bold="true" > Password </asp:label>
</TD>
<TD class="gray" align="left" colspan=4 vAlign="top">
<asp:textbox id="TextBoxPassword" runat="server" CssClass="NormalTextBox" Width="180px"
TextMode="Password" MaxLength="15"></asp:textbox>
4 to 15 letters only. Capitalization matters!
<asp:requiredfieldvalidator id="RFVPassword" runat="server" ErrorMessage="Password"
ControlToValidate="TextBoxPassword" Display="None"> </asp:requiredfieldvalidator> </TD>
</TR>
<tr><td height="10px"></td></tr>
<tr height=30><td width="5%"></td>
<TD align="left" valign="top" > <span style="color: red">*</span>
<asp:Label id="LabelCPassword" runat="server" Font-Bold="true"> Re-type Password</asp:Label> </TD>
<TD align="left" class="gray" colspan=3 vAlign="top" ><asp:textbox id="TextboxCPassword" runat="server"
CssClass="NormalTextBox" Width="180px" TextMode="Password" MaxLength="15"></asp:textbox>
Re-type password should match with your password
<asp:comparevalidator id="CVPassword" runat="server" ErrorMessage="Re-type Password doesn't match"
ControlToValidate="TextboxCPassword" Display="None" ControlToCompare="TextBoxPassword"
CssClass="redtext"> </asp:comparevalidator>
<asp:regularexpressionvalidator id="revPWDRange" runat="server"
ErrorMessage="Password should be 4 to 15 letters & Space not allowed"
ControlToValidate="TextBoxPassword" Display="None" ValidationExpression="\S{4,15}"
CssClass="redtext"> </asp:regularexpressionvalidator>
<asp:RequiredFieldValidator ID="rfvCPwd" runat="server"
ControlToValidate="TextboxCPassword" Display="None" ErrorMessage="Re-type Password">
</asp:RequiredFieldValidator>
</TD>
</TR>
<tr><td height="10px"></td></tr>
<tr><td width="10%"></td>
<TD style="height: 18px"></TD>
<TD vAlign="middle" align="left" style="height: 18px;">
<asp:button id="ButtonSubmit" runat="server" CssClass="NormalButton" Width="100"
Text="Register Me" OnClick="ButtonSubmit_Click"> </asp:button>
<asp:button id="ButtonCancel" runat="server" CssClass="NormalButton"
Width="100" Text="Cancel" CausesValidation="False" OnClick="ButtonCancel_Click">
</asp:button>
</TD>
</TR>
<tr><td height="20px"></td></tr>
</table>
</td>
</tr>
</TABLE>
<asp:validationsummary id="ValidationSummary1" runat="server"
ShowSummary="False" ShowMessageBox="True" HeaderText="Check entries:" Height="30px">
</asp:validationsummary>
</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;
using System.IO;
using System.Net.Mail;
using System.Drawing;
using System.Data.SqlClient;
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection con;
SqlCommand cmd = new SqlCommand();
DataSet ds = new DataSet();
SqlDataAdapter da;
SqlDataReader dr;
protected void ButtonSubmit_Click(object sender, EventArgs e)
{
int result = UserStatus();
if (result == 1)
{
lblEmailError.Text = "User All Ready Exists";
}
else if (result == 0)
{
Session["User_ID"] = TextBoxUserId.Text;
Session["Email"] = txtBoxUserEMail.Text;
lblEmailError.Text = "SucessFully Registered";
Response.Redirect("SelfRegistration.aspx");
}
}
protected void ButtonCancel_Click(object sender, EventArgs e)
{
Response.Redirect("AllRegisteredUsers.aspx");
}
public int UserStatus()
{
con = new SqlConnection(ConfigurationSettings.AppSettings["Connect"]);
cmd.CommandText = "select User_LoginId from UserIDInformation where User_LoginId='" + TextBoxUserId.Text + "'";
cmd.Connection = con;
con.Open();
dr = cmd.ExecuteReader();
if (dr.Read())
{
return 1;
}
else
{
con = new SqlConnection(ConfigurationSettings.AppSettings["Connect"]);
cmd.CommandText = "insert into UserIDInformation (User_LoginId,User_Email,Password) values ('" + TextBoxUserId.Text + "','" + txtBoxUserEMail.Text + "','" + TextBoxPassword.Text + "') ";
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
return 0;
}
con.Close();
}
}

Figure 3: Make a userID.
After this the user will be rdirected to SelfRegistration:
SelfRegistration.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SelfRegistration.aspx.cs" Inherits="SelfRegistration" %>
<!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>Registration</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" width="70%" align="center" border="0" >
<tr> <td align="center" bgcolor="#33cccc" style="height: 19px">
<asp:Label ID="lblWelcome" runat="server" Text="Registration Form" Font-Bold="true"
ForeColor="#0000ff">
</asp:Label>
</td></tr>
<tr><td height="5px"> </td></tr>
<tr><td>
<asp:Label ID="lblSucessfullyAdded" runat="server" Text="SucessFully Added"
Visible="false" ForeColor="green" Width="170px"> </asp:Label>
</td></tr>
<tr><td><table width="100%" background=BackGround.jpg>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblName" runat="server" Text="First Name" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtFirstName" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="LblMiddleName" runat="server" Text="Middle Initial" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtMiddleName" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblLastName" runat="server" Text="Last Name" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtLastName" runat="server"> </asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblwebPage" runat="server" Text="Web Page Name" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtWebPage" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td> <asp:Label ID="lblEMail" runat="server" Text="E-Mail" Width="170px" Font-Bold="true"
ForeColor="blue"></asp:Label>
<asp:TextBox ID="txtEMail" runat="server" Enabled="false">
</asp:TextBox>
</td></tr>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblAboutYourSelf" runat="server" Text="About YourSelf" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtAboutAyourSelf" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblInterest" runat="server" Text="Interest" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtInterest" runat="server"> </asp:TextBox>
</td></tr>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblFavouritePassTime" runat="server" Text="Favourite Pass Time"
Width="170px" Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtFavouritePassTime" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblFavouriteMovie" runat="server" Text="Favourite Movie" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtFavouriteMovie" runat="server"> </asp:TextBox>
</td></tr>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblFavouriteActor" runat="server" Text="Favourite Actor" Width="170px" Font-Bold="true" ForeColor="blue"></asp:Label>
<asp:TextBox ID="txtFavouriteActor" runat="server"></asp:TextBox>
</td></tr>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblFavouriteActress" runat="server" Text="Favourite Actress"
Width="170px" Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtFavouriteActress" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"> </td>
<td>
<asp:Label ID="lblBestPlaceToLive" runat="server" Text="
<asp:TextBox ID="txtBestPlace" runat="server"></asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblUnforgettableMoment" runat="server" Text="UnForgettable Moment"
Width="170px" Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtUnForgettableMoment" runat="server" TextMode="MultiLine">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblAddressLine1" runat="server" Text="Address Line 1" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtAddressLine1" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblAddressLine2" runat="server" Text="Address Line 2" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtAddressLine2" runat="server">
</asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblCity" runat="server" Text="City" Width="170px" Font-Bold="true"
ForeColor="blue"> </asp:Label>
<asp:TextBox ID="txtCity" runat="server"> </asp:TextBox>
</td></tr>
<tr><td width="25%"></td>
<td>
<asp:Label ID="lblCountry" runat="server" Text="Country" Width="170px"
Font-Bold="true" ForeColor="blue"> </asp:Label>
<asp:dropdownlist id="DdlistCountry" runat="server" CssClass="NormalDropDown" BackColor="White" Width="206px">
<asp:ListItem Value="Not Applicable">--Select--</asp:ListItem>
<asp:ListItem Value="Not Applicable">--Select--</asp:ListItem><asp:ListItem Value="
<asp:ListItem Value="
<asp:ListItem Value="
</asp:dropdownlist>
</td></tr>
<tr><td height="10px"></td></tr>
</table></td></tr>
<tr><td align="center">
<asp:Label ID="lblRegisterHere" runat="server" Text="For Register Click Here "
Font-Bold="true" Width="190px">
</asp:Label>
<asp:Button ID="btnRegister" runat="server" Text="Register" OnClick="RegisterMe_Click"
Font-Bold="true" Width="190px" ForeColor="Blue" />
</td></tr>
<tr><td height="10px"></td></tr>
</table>
</div>
</form>
</body>
</html>
SelfRegister.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;








Dilip ChoudharyPosted Jul 5, 2014, 11:52 PM
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
ani bhaiPosted Oct 14, 2012, 1:36 AM
hello rahul i need u to plzz help me regarding the db connection can u plzz send me the report or a readme of wht is actually going on in the rnetwoking project og yours ,, and ur work is rfabulous ..my email [email protected]
ram kumarPosted Jul 19, 2010, 7:39 AM
dear sir i downloaded your rahulfriendnetwork project and tried it . its very nice but how can we add user as my friend as there is no add friend request options . and if cant add any user as a friend then it will allways show one in our friends list. please help me by adding this functionality and uploading the updated project as it will we very helpful for the newcummers like me. Thanks one more thing left , if you have any shopping cart web application then pls upload that too . m waiting for that for a while. Thanks again.
Nikhil KumarPosted Jan 15, 2010, 2:23 AM
I am trying to access the db of (Rnetworkingsite) Rahuls article but not able can you please send its tables in .txt format at [email protected] Thanks !@
peter mPosted Jun 19, 2007, 11:18 PM
looks like a nice app But ... cant connect to or open the DB with SQL Express - says ldf cant be rebuilt as mdf file not closed properly pjm