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

B

bienwell

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top