update table doesn't work

Discussion in 'C#' started by bhuppi890109, Apr 10, 2011.

  1. #1
    hi friends . i am facing a problem while updating a table in asp.net.
    i am creating a page for change password and i used the update query on click of a button to change the password but it doesn't work. i dont know why ..my query is
    update table set column='"+textbox.text+"';
     
    bhuppi890109, Apr 10, 2011 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Would question why your not using either the default or an alternative security/ membership provider rather than trying to create your own thing. Providing more of the code would also help.

    Assuming your using an SQLCommand to do the updating in an onclick event you really should have it similar to:
    
    SqlCommand.CommandText = "UPDATE tableID SET columnID = @Parameter";
    SqlCommand.Parameters.Add("@Parameter", SqlDbType.VarChar).Value = Textbox1.Text;
    
    Code (markup):
     
    AstarothSolutions, Apr 11, 2011 IP