Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
SqlCommand cmd = new SqlCommand("sp_userinformation", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserName", UserName);
                cmd.Parameters.AddWithValue("@Password", Password);
                cmd.Parameters.AddWithValue("@FirstName", FirstName);
                cmd.Parameters.AddWithValue("@LastName",LastName );
                cmd.Parameters.AddWithValue("@Email",Email );
                cmd.Parameters.AddWithValue("@PhoneNO", Phoneno);
                cmd.Parameters.AddWithValue("@Location", Location);
                cmd.Parameters.AddWithValue("@Created_By", Created_By);
                cmd.Parameters.Add("@ERROR", SqlDbType.Char, 500);
                cmd.Parameters["@ERROR"].Direction = ParameterDirection.Output;
                cmd.ExecuteNonQuery();
                message = (string)cmd.Parameters["@ERROR"].Value;
                con.Close();
            }
            else
            {
                Page.RegisterStartupScript("UserMsg", "<Script language='javascript'>alert('" + "Password mismatch" + "'); </script>");
            }
            lblErrorMsg.Text = message;

[EDIT -OP comment from "solution"]
C#
if (txtpwd.Text == txtcnmpwd.Text)
 {
 string UserName = txtuser.Text;
 string Password = txtpwd.Text;
 string ConfirmPassword = txtcnmpwd.Text;
 string FirstName = txtfname.Text;
 string LastName = txtlname.Text;
 string Email = txtEmail.Text;
 string Phoneno = txtphone.Text;
 string Location = txtlocation.Text;
 string Created_By = txtuser.Text;



i am declaring column name as above
Posted
Updated 22-Apr-15 7:03am
v3
Comments
Afzaal Ahmad Zeeshan 22-Apr-15 12:35pm    
Column is not named this way, make sure column names are correct.
CHill60 22-Apr-15 13:05pm    
What is in the stored procedure sp_userinformation?

Try executing your SP in the backend. It seems there is no object with the name User_information in the given database.
This is most likely a table or view that you are trying to query but does not exist.
 
Share this answer
 
if (txtpwd.Text == txtcnmpwd.Text)
{
string UserName = txtuser.Text;
string Password = txtpwd.Text;
string ConfirmPassword = txtcnmpwd.Text;
string FirstName = txtfname.Text;
string LastName = txtlname.Text;
string Email = txtEmail.Text;
string Phoneno = txtphone.Text;
string Location = txtlocation.Text;
string Created_By = txtuser.Text;




i am declaring column name as above
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900