Hello All,
I am trying to add new elements to my database. I am able to add only add 1 field out of the 3 fields in the database.
Following is the code for my Button Event handler,
protected void Button1_Click(object sender, EventArgs e)
{
QuizUserDetailsDataContext context = new QuizUserDetailsDataContext(ConfigurationManager.ConnectionStrings["krs_projectConnectionString"].ToString());
krs_userdetail1 krs_user = new krs_userdetail1();
krs_user.emailid = EmailText.Text;
krs_user.uname = TextBox1.Text;
krs_user.password = TextBox2.Text;
context.krs_userdetail1s.InsertOnSubmit(krs_user);
context.SubmitChanges();
}
The database structure is as follows,
create table dbo.user_details
( uname varchar(50) not null,
password varchar(50) not null,
emailid varchar(50) not null,
primary key(uname,emailid))
When I add the elements in the DB, and when I check in the database, I can see that only the Password field is having a value, whereas the other 2 fields of the DB are blank...
Can anybody assist me in this regard !!
Many Thanks in Advance...