Question table update and insert

TGRUM7047

New member
Joined
Jul 9, 2015
Messages
3
Programming Experience
5-10
vb.net 2013 pro
My question my seem simple and maybe it is - I have a thrid party Grid (UltraGrid) and have set a data table as its datasource which the table recieved its data from a dataset. Is there a way to just update or insert rows in an Oracle DB other than using the data adapter?

Thank you for you response in advance.

Tom
 
Why exactly do you not want to use a data adapter? There are other options but they are not necessarily better so maybe if you told us what is bad about a data adapter then we could determine what you would consider good.
 
Why exactly do you not want to use a data adapter? There are other options but they are not necessarily better so maybe if you told us what is bad about a data adapter then we could determine what you would consider good.


I guess I am trying to understand why we would use the data adapter over the following:
______________________________________________________________________-

cmd_proposal_status.Connection = conn


cmd_proposal_status.CommandText = GetOracleSQLStatement("login_updt_proposal_checkedout")


cmd_proposal_status.CommandType = CommandType.Text


cmd_proposal_status.Parameters.Add("proposal_checked_out_by", adUserID)
cmd_proposal_status.Parameters.Add("proposal_Name", wbsTemplateName)




Try
' If connection good with od01 Execute Update cm_Proposals
Dim Trans As OracleTransaction = conn.BeginTransaction()


cmd_proposal_status.ExecuteNonQuery()


Trans.Commit()


Catch ex As Exception
' Handle the exception.
MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
conn.Close()
End Try
____________________________________________________________________________-

I am sure the data adapter is better in certain circumstances and I want to make sure I take advantage of it when appropriate.

Thank you for responding
 
I guess I am trying to understand why we would use the data adapter over the following:

The point of a data adapter is to group the CRUD operations for a table together. It allows you to retrieve multiple records from a database, modify the data as you like, i.e. add, edit and delete as many rows as you like, then save all the changes in a single batch. If all you want to do is insert, update or delete a single record without first retrieving it then by all means call ExecuteNonQuery on a command. If you want to retrieve a number of records modify them and then save potentially multiple changes then use a data adapter.
 
The point of a data adapter is to group the CRUD operations for a table together. It allows you to retrieve multiple records from a database, modify the data as you like, i.e. add, edit and delete as many rows as you like, then save all the changes in a single batch. If all you want to do is insert, update or delete a single record without first retrieving it then by all means call ExecuteNonQuery on a command. If you want to retrieve a number of records modify them and then save potentially multiple changes then use a data adapter.

Thank you for the clarification - I appreciate that.
 
Back
Top