mke denis

mke denis

  • NA
  • 1
  • 643

Additional information: conversion failed when converting th

Mar 17 2016 4:02 AM
con.Open();
SqlCommand cmd = new SqlCommand("update tblRegi set Firstname=@Firstname,Lastname=@Lastname,Username=@Username,Password=@Password,Repassword=@Repassword,Gender=@Gender,Hobbies=@Hobbies,Country=@Country,State=@State,City=@City,Secrtyque=@Secrtyque,Secrtyans=@Secrtyans where id=@id", con);
cmd.Parameters.AddWithValue("@Firstname", TxtFirstname.Text);
cmd.Parameters.AddWithValue("@Lastname", TxtLastname.Text);
cmd.Parameters.AddWithValue("@Username", TxtUsername.Text);
cmd.Parameters.AddWithValue("@Password", TxtPasswword.Text);
cmd.Parameters.AddWithValue("@Repassword", TxtRePassword.Text);
cmd.Parameters.AddWithValue("@Gender", RbtnGender.SelectedValue);
cmd.Parameters.AddWithValue("@Hobbies", ChbxHobbies.SelectedValue);
cmd.Parameters.AddWithValue("@Country", DrpCountry.SelectedValue);
cmd.Parameters.AddWithValue("@State", DrpState.SelectedValue);
cmd.Parameters.AddWithValue("@City", DrpCity.SelectedValue);
cmd.Parameters.AddWithValue("@Secrtyque", DrpScQue.SelectedValue);
cmd.Parameters.AddWithValue("@Secrtyans", TxtScAns.Text);
cmd.Parameters.AddWithValue("@id",Label1.Text);
cmd.ExecuteNonQuery();
con.Close();

Answers (2)