I have a ASPX page which needs to make several writes to a database,
using data from a form. I am using an MS Access db.
Currently, I am managing my connections/writes as follows..
myConnection = New OleDBConnection(connectionString)
myConnection.Open()
sql = "first sql statment"
myCommand = New OleDbCommand(sql, myConnection)
myReader = myCommand.ExecuteReader()
myReader.Close()
sql = "2nd sql stmt"
myCommand = New OleDbCommand(sql, myConnection)
myReader = myCommand.ExecuteReader()
myReader.Close()
sql = "3rd sql stmt"
myCommand = New OleDbCommand(sql, myConnection)
myReader = myCommand.ExecuteReader()
myReader.Close()
etc etc.. Is this the optimal way of doing writes to database? The
repeated creation of teh command object seems "not so right" to me..
Thoughts?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!