i want to regiater a user on my site

Jan 22 2014 5:10 AM
Dear sir
i want to register a user on our site and i want a register user can't register again ,dear sir i am proving our code to you ,sir check my code and provide correct code to me 
my registration form coding is
 registration.aspx.cs
 
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class RegistrationForm : System.Web.UI.Page
{
SqlConnection con = new SqlConnection();
Regis rs = new Regis();
//public string Output = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{

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

if (TextBox6.Text == TextBox7.Text)
{
Session["user"] = TextBox1.Text;
Session["add"] = TextBox2.Text;

rs.fullname = TextBox1.Text;
rs.Address = TextBox2.Text;
rs.MobileNo = TextBox3.Text;
if (RadioButton1.Visible == true)
{
rs.Gender = "Male";
}
else
{
rs.Gender = "Female";
}
rs.Emailaddress = TextBox4.Text;
rs.Username = TextBox5.Text;
rs.Password = TextBox6.Text;
// Output = rs.insert();
//Label1.Text = Output;
Session["user"] = TextBox1.Text;
Session["add"] = TextBox2.Text;
Response.Redirect("welcome.aspx");
}
else
{
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Password mismatch')</script>");
}
//clear();
}

public void clear()
{

//TextBox1.Text = " ";
//TextBox2.Text = " ";
//TextBox3.Text = " ";
//TextBox4.Text = " ";
//TextBox5.Text = " ";
//TextBox6.Text = " ";
//RadioButton1.Checked = false;
//RadioButton2.Checked = false;
}


}
 
my property is 
regis.cs
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.Data.SqlClient;
public class Regis
{

SqlConnection con = new SqlConnection();
public string _fullname;
public string _address;
public string _mobileno;
public string _gender;
public string _emailaddress;
public string _username;
public string _password;
public string fullname
{
get
{
return _fullname;
}
set
{
_fullname = value;
}
}
public string Address
{
get
{
return _address;
}
set
{
_address = value;
}
}
public string MobileNo
{
get
{
return _mobileno;
}
set
{
_mobileno = value;
}
}
public string Gender
{
get
{
return _gender;
}
set
{
_gender = value;
}
}
public string Emailaddress
{
get
{
return _emailaddress;
}
set
{
_emailaddress = value;

}
}
public string Username
{
get
{
return _username;

}
set
{
_username = value;
}
}
public string Password
{
get
{
return _password;
}
set
{
_password = value;
}
}


public void insert()
{
SqlConnection con = Connection.conn();
SqlCommand cmd = new SqlCommand(" reg_stor'I', '" + _fullname + "','" + _address + "','" + _mobileno+ "','" +_gender+ "','" +_emailaddress + "','" +_username+ "','" + _password+ "'", con);
con.Open();
//cmd.Parameters.Add("@ERROR", SqlDbType.Char, 500);
//cmd.Parameters["@ERROR"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
//string strMessage = (string)cmd.Parameters["@ERROR"].Value;
con.Close();
//return strMessage;
}





}

 

Answers (1)