update command within For loop in ASP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vanithapraveen
    New Member
    • Oct 2008
    • 2

    update command within For loop in ASP

    I gave update command inside for loop.. and the query values are perfectly correct..but when i give con.execute(upd ateqry) i end up with an error....
    Please help me...
  • shivasusan
    New Member
    • Oct 2008
    • 67

    #2
    Hi!

    You try this, after your update query

    1. response.end
    2. my_Conn.Execute (updateSql)

    for ex:
    UPDATE tbl_data SET STATNAME='NOWIN SKA NATALIA GRACJA', H1subj1='CL', H1subj2='-', H1subj3='-', H2subj1='CHEM', H2subj2='ECONS' , H2subj3='MATH', H2subj4='PHY' WHERE IDNO='F1781667P ';

    3. Now you check the fieldname is correct and check the value is correct.
    4. If the field value and fieldname is correct you copy this query and test directly in your database. Its run successfully... .
    5. In query no mistake.
    6. so you check your table fieldname and your html form the text box or combo box id or name is same.

    for ex:
    table fieldname = username;
    &
    Text box<input type=text id="username" name="username" >

    Comment

    • DrBunchman
      Recognized Expert Contributor
      • Jan 2008
      • 979

      #3
      Hi vanithapraveen,

      What's the error?

      Dr B

      Comment

      • vanithapraveen
        New Member
        • Oct 2008
        • 2

        #4
        Hi ma...

        just i receive internal server error... i executed the query directly in mssql...it is working...but after i give execute i end up with an error...

        Comment

        • DrBunchman
          Recognized Expert Contributor
          • Jan 2008
          • 979

          #5
          And what is the actual error???? If you print it here there's far more chance of you getting some help!

          Dr B

          Comment

          Working...