By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,677 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,677 IT Pros & Developers. It's quick & easy.

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

P: n/a
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



Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.