To insert, update, and delete data using a Data Adapter, you create an Ole Db Command object with INSERT, UPDATE, and DELETE statements and set the Insert Command, Update Command, and Delete Command properties of the data adapter to Ole Db Command.
You can avoid building Command objects manually by using Command Builder.
=== Message Received: Feb 23 2011, PM" id="ctl00_m_m_i_ctl00_gr_ctl05_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="4059124" / I this you need to enclose your parameters in brackets in str Sql.
Value = lng PLACE_NOa messagebox.show( lng PLACE_NOa ) Update Cmd.
Close() If you are getting errors please post them so we can see them.
Tip: You might want to back up your database before you run an update query.
You cannot undo the results of an update query, and making a backup helps make sure that you can reverse your changes if you change your mind.
You cannot use an update query to add new records to a database, or to delete entire records from a database.
To add new records to a database you use an append query, and to delete whole records from a database you use a delete query. As a best practice, there are two main steps that you must follow to create and run an update query: create a select query that identifies the records that you want to update, and then convert that query to an update query that you can run to update the records.A data provider is used for connecting to a database, executing commands and retrieving data, storing it in a dataset, reading the retrieved data and updating the database. Net consists of the following four objects: Data Adapter This is integral to the working of ADO.Net since data is transferred to and from a database through a data adapter. Close() Waiting for Reply Sanju Di Best is to step through your code to see what values you are actually passing especially to know what your str SQL really is and the values you are passing to your parms: what is lng PLACE_NOa ? Second best if you won't step through your code is to place a couple of messageboxes to make sure the data you think you are passing to the command is indeed what you are passing to it: dim str SQL as string Dim con As Ole Db Connection = New Ole Db Connection(conn STRING) con. Create Command ' Sql Update Statement str SQL = " UPDATE tbl PLACE SET " str SQL = str SQL & " PLACE_NAME = @PLACE_NAME, " str SQL = str SQL & " PLACE_NAMEH = @PLACE_NAMEH " str SQL = str SQL & " WHERE PLACE_NO = @PLACE_NO" Dim Update Cmd As New Ole Db Command(str SQL, con) (str SQL) ' 2. Var Char, 50, " PLACE_NAMEH") Update Cmd. Value = lng PLACE_NOa messagebox.show( lng PLACE_NOa ) Update Cmd. When you need to update data from one table to another, consider the following rule: the data types for the source and destination fields must either match or be compatible.