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 Home : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ASPNETDB2per1"].ConnectionString);
SqlCommand cmd = new SqlCommand();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnReg_Click(object sender, EventArgs e)
{
con.Open();
cmd.Connection = con;
cmd.CommandText = "insert into registerUser values('" + txtFname.Text + "','" + txtLname.Text + "','" + txtLname.Text + "','" + txtDOB.Text + "','" + txtMbl.Text + "','" + txtPass.Text + "','" + txtEmail.Text + "','" + txtLname.Text + "','" + ddlState.SelectedItem.Text + "')";
cmd.ExecuteNonQuery();
con.Close();
Session["usersession"] = txtMbl.Text;
Response.Redirect("about.aspx");
}
}
for clarity here is the attachment of my code. check it.

New Topic/Question
Reply



MultiQuote




|