0% found this document useful (0 votes)
4 views1 page

SQL Registration Command Example

This document contains code to insert user registration data into a SQL database table. It opens a SQL connection, defines an INSERT command with parameters for each registration field, assigns the parameter values from textboxes, executes the command, and closes the connection.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

SQL Registration Command Example

This document contains code to insert user registration data into a SQL database table. It opens a SQL connection, defines an INSERT command with parameters for each registration field, assigns the parameter values from textboxes, executes the command, and closes the connection.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

string strcon = @"Data Source=.

\sqlexpress;Initial
Catalog=CMS;Integrated Security=True;Pooling=False";
SqlConnection con = new SqlConnection(strcon);
[Link]();
SqlCommand cmd = new SqlCommand();
[Link] = con;
[Link] = [Link];
[Link] = "INSERT INTO registration
(FName,LName,UserName, Password, RePassword, SecQ,
Answer,Recovmail,Location,VerificationCode)VALUES(@FName,@LName,@UserNam
e,@Password,@RePassword,@SecQ,@Answer,@Recovmail,@Location,@Verification
Code)";
[Link]("@FName", [Link]);
[Link]("@LName", [Link]);
[Link]("@UserName", [Link]);
[Link]("@Password", [Link]);
[Link]("@RePassword", [Link]);
[Link]("@Answer", [Link]);
[Link]("@SecQ", [Link]);
[Link]("@Location", [Link]);
[Link]("@Recovmail", [Link]);
[Link]("@VerificationCode",
[Link]);
[Link]();
[Link]();

You might also like