CLEAR ALL DATA ON THE FIELDS for data entry (ASP.NET Web program)

Discussion in 'ASP .Net' started by bienwell, Nov 17, 2005.

  1. bienwell

    bienwell Guest

    Hi all,

    I have a data entry form in ASP.NET (Web development) which has some
    fields (field1,..., fieldN) , button ADD THIS RECORD, and button CANCEL.
    In button ADD THIS RECORD, I have VB.NET Sub function to add this record
    into the table. I would like to CLEAR ALL DATA ON THE FIELDS to perform
    next data entry after adding a new record NOT BY assign the value "" for
    each field, but by one line of code.

    For example (in my code) :

    Dim myStr as string="INSERT INTO TABLE1(Col1, Col2,..., ColN)
    VALUES(field1.text, field2.text, ..., fieldN.text)"
    Dim myConnection as ODBCConnection= New ODBCConnection(strConn)
    myConnection.Open()

    myCommand = New OdbcCommand(mystr, myConnection)
    myCommand.ExecuteNonQuery()
    myConnection.Close()

    field1.text="" ' I like to use one line of code NOT by the
    assignment value for each field
    field2.text=""
    ......
    fieldN.text=""


    Could you suggest what I need to use for this purpose ? Thanks in
    advance
     
    bienwell, Nov 17, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    Clear all fields on a screen

    tshad, May 19, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,292
    tshad
    May 20, 2005
  2. Duk Lee
    Replies:
    2
    Views:
    748
    Alexey Smirnov
    Jul 23, 2007
  3. David

    Response.Clear() doesn't clear

    David, Jan 31, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    1,066
    Mark Fitzpatrick
    Jan 31, 2008
  4. Mike Owen

    Allowing entry of a Carriage Return during data entry

    Mike Owen, Jul 27, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    748
    Alessandro Zifiglio
    Jul 27, 2006
  5. InvalidLastName

    Unrecognized element 'add' after <clear></clear>

    InvalidLastName, Feb 26, 2007, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    1,004
    Steven Cheng[MSFT]
    Mar 6, 2007
Loading...

Share This Page