Click here to Skip to main content
13,005,192 members (65,652 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Dear sir I want to make registration form in (C#) and I wanna use html controls(input(text,password),radio,cheackbox,and submit button) and save it in sql database.
please give me complete code for undrstanding.
Posted 11-Dec-12 0:54am
Updated 11-Dec-12 1:00am
Vani Kulkarni 11-Dec-12 7:01am
What have you tried till now? Where are you stuck?
Milind_T 11-Dec-12 7:09am
huh? Thats not how CP work Dear Sir.
You try your best, you stuck, others pour in their ideas.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Does google[^] broken at your place?

A simple search for your question gives 4,080,000 results, many of those threads will solve your question for sure.

Try something by your side first and then post your question if you get stuck somewhere around.

This is not at all appropriate.
saurabh bhaedwaj 12-Dec-12 1:39am
when I make it with the help of asp server control but now i'm tryin with html control but everything is complete but my data not saved .my checkbox is fine work. but data not saved in database. I attach my code to you.

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;
using System.Drawing;

public partial class allrishteymaster : System.Web.UI.MasterPage
string constr = ConfigurationManager.ConnectionStrings["constr"].ToString();
protected void Page_Load(object sender, EventArgs e)
//start making session
Session["email"] = Textmail;
Session["password"] = Textpassword;
Session["profilefor"] = profilefor;
Session["name"] = Textusername;
Session["gender"] = Radiomale;
Session["gender"] = Radiofemale;
Session["dd"] = dd;
Session["mm"] = mm;
Session["yy"] = yy;
Session["religion"] = religion;
Session["mothertongue"] = mothertongue;
Session["livingin"] = livingin;
//end making session
protected void regissub_Click(object sender, EventArgs e)
SqlConnection con = new SqlConnection(constr );
SqlCommand cmd = new SqlCommand("insert into userregisteration" + "(uid,email,password,username,poprfilefor,gender,dob,religion,mothertongue,livingin,registrationdate)" + "values" + "(@uid,@email,@password,@username,@poprfilefor,@gender,@dob,@religion,@mothertongue,@livingin,@registrationdate)",con);
if (Checkbox1.Checked == true)
cmd.Parameters.Add(new SqlParameter("@email", Textmail));
cmd.Parameters.Add(new SqlParameter("@password", Textpassword));
cmd.Parameters.Add(new SqlParameter("@username", Textusername));
cmd.Parameters.Add(new SqlParameter("@poprfilefor", profilefor.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@gender", Radiomale.ToString()));
cmd.Parameters.Add(new SqlParameter("@gender", Radiofemale.ToString()));
cmd.Parameters.Add(new SqlParameter("@dob", dd.SelectedIndex + "-" + mm.SelectedIndex + "-" + yy.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@religion", religion.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@mothertongue", mothertongue.SelectedIndex));
cmd.Parameters.Add(new SqlParameter("@livingin", livingin.SelectedIndex));

error.Text = "Check Privacy And T&C";



This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100