Could someone tell me why this code isn't working? <p>So I have been stuck with this for a long time now, unable to figure why it isn't working. This is a registration page which, after submitting information, should upload the information (the one I choose, not all the registration options enter the database) into a table (called tbl) inside the database (known as Database2.mdf). This is through Visual Studio 2010. There is also a java phase that checks the information but I don't think that is what is causing the problem so I'll just post the SQL code and the HTML code, along with the names of the table lines.</p> <p>The SQL bit:</p> <pre><code>&lt;%@ Page Language="C#" %&gt; &lt;%@ Import Namespace="System.Data.SqlClient" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;script runat="server"&gt; protected void Page_Load(object sender, EventArgs e) { if (Request.Form["sub"] != null) { string fName = Request.Form["FName"]; string lName = Request.Form["LName"]; string uName = Request.Form["UName"]; string Street = Request.Form["Street"]; string City = Request.Form["City"]; string Pass = Request.Form["Password"]; string PassCon = Request.Form["PasswordConf"]; string Email = Request.Form["Email"]; string Comments = Request.Form["Comment"]; int ID = int.Parse(Request.Form["ID"]); string conStr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database2.mdf;Integrated Security=True;User Instance=True"; string cmdStr = string.Format("INSERT INTO tbl (FirstName, LastName, UserName, Street, City, Password, PasswordConfirm, Email, Comments, IdentificationNumber) VALUES (N'{0}', N'{1}', N'{2}', N'{3}', N'{4}', N'{5}', N'{6}', N'{7}', N'{8}', {9})", fName, lName, uName, Street, City, Pass, PassCon, Email, Comments, ID); SqlConnection conObj = new SqlConnection(conStr); SqlCommand cmdObj = new SqlCommand(cmdStr, conObj); conObj.Open(); cmdObj.ExecuteNonQuery(); conObj.Close(); } } &lt;/script&gt; </code></pre> <p>The HTML bit: (CheckForm is the name of the Javassript action that checks if the form matches the requirements, also Registration.aspx is the registration page obviously, and it is not linked to a master page)</p> <pre><code>&lt;form action="Registration.aspx" method="post" name="ContactForm" onsubmit="return CheckForm()"&gt; First Name: &lt;input type="text" size="65" name="FName" /&gt; &lt;br /&gt; Last Name: &lt;input type="text" size="65" name="LName" /&gt; &lt;br /&gt; Username: &lt;input type="text" size="65" name="UName" /&gt; &lt;br /&gt; Street: &lt;input type="text" size="65" name="Street" /&gt; &lt;br /&gt; City: &lt;input type="text" size="65" name="City" /&gt; &lt;br /&gt; Password: &lt;input type="password" size="65" name="Password" /&gt; &lt;br /&gt; Password Confimration: &lt;input type="password" size="65" name="PasswordConf" /&gt; &lt;br /&gt; E-mail Address: &lt;input type="text" size="65" name="Email" /&gt; &lt;br /&gt; Comments: &lt;input type="text" size="100" name="Comment" /&gt; &lt;br /&gt; Identification Number: &lt;input type="password" size="65" name="ID" /&gt; &lt;br /&gt; Mobile : &lt;input type="text" id="mobile" name="mobile" style="width: 40px;" maxlength="3" /&gt; - &lt;input type="text" name="mobile1" maxlength="7" /&gt; &lt;br /&gt; Gender: Male&lt;input type="radio" name="gender" id="gender_Male" value="Male" checked /&gt; Female&lt;input type="radio" name="gender" id="gender_Female" value="Female" /&gt; &lt;br /&gt; Which countries would you like to recieve political news for?: &lt;br /&gt; &lt;input type='checkbox' name='files[]' id='1' value='1' /&gt; Israel &lt;input type='checkbox' name='files[]' id='2' value='2' /&gt; Russia &lt;input type='checkbox' name='files[]' id='3' value='3' /&gt; Canada &lt;br /&gt; How often do you read the newspaper? &lt;br /&gt; &lt;select id="cardtype" name="sel"&gt; &lt;option value=""&gt;&lt;/option&gt; &lt;option value="1"&gt;Never&lt;/option&gt; &lt;option value="2"&gt;Everyday&lt;/option&gt; &lt;option value="3"&gt;Once a week&lt;/option&gt; &lt;option value="4"&gt;Once a year&lt;/option&gt; &lt;/select&gt; &lt;br /&gt; What can we help you with? &lt;select type="text" value="" name="Subject"&gt; &lt;option&gt;&lt;/option&gt; &lt;option&gt;Customer Service&lt;/option&gt; &lt;option&gt;Question&lt;/option&gt; &lt;option&gt;Comment&lt;/option&gt; &lt;option&gt;Consultation&lt;/option&gt; &lt;option&gt;Other&lt;/option&gt; &lt;/select&gt; &lt;br /&gt; &lt;input type="submit" value="Send" name="submit" /&gt; &lt;input type="reset" value="Reset" name="reset" /&gt; &lt;/form&gt; </code></pre> <p>The table lines are as follows:</p> <ul> <li>FirstName - nvarchar(50)</li> <li>LastName - nvarchar(50)</li> <li>UserName - nvarchar(50)</li> <li>Street - nvarchar(50)</li> <li>City - nvarchar(50)</li> <li>Password - nvarchar(50)</li> <li>PasswordConfirm - nvarchar(50)</li> <li>Email - nvarchar(50)</li> <li>Comments - nvarchar(50) - Only one that allows nulls</li> <li>IdentificationNumber - int</li> </ul> <p>I know this is A LOT to sift through but I have been stuck with it for so long and I must get it fixed very quickly, I would VERY much appreciate any help provided! Thanks in advance!</p>