Parameter names and values are based on data fields bound to a control or alternatively on parameter objects that you define explicitly.
Parameters from a data-bound control include both values for the data operation and for key values to identify a specific row, as defined by the definitions to specify parameter order, parameter type, and parameter direction as well as additional parameters other than those based on fields bound to a control.
Do you have a way that I can track the @original Order ID and @Order Total parameter's value before the update occurs?
I dont want to sound stupid but how do you create a protected string and where is that code placed as I keep getting errors.Is there any chance you could provide the full code and I will be really greatful. For example, if you are using a events after the database operation completes.You can handle these events to determine whether an exception was thrown during the database operation, to learn how many records were affected by the operation, or to examine any output values the database operation returns.The , which means that update operations overwrite any existing values in the record without determining whether the record has been modified by another source.
This scenario is sometimes called "last writer wins." You can set the control includes all original values during the update or delete command.
) - Next project I will follow everyone's suggestion :) Thanks all Using the Default Value property passes this value to the query. I tried that before (see my commented-out code above) but I tried it again: //Update Order Table with Total of Order Sql Data Source2.
And yes, this is the last time I will be using Sql Data Source - It seems everyone recommends a different approach (DAC?
The statement can include parameters if the data source supports them.
Parameters are used to send values for insert, update, and delete operations to the data source.
I have a Transactions table which stores individual items that the user selects for purchase (item name, item price, order ID, etc) I have an Orders table which stores values for the Order (account name, order total, etc) Here is my Sql Data Source as defined in the page: " Insert Command="INSERT INTO [tbl Orders] ([Order Date], [Order Total], [Order Account], [Order Cost Centre]) VALUES (@Order Date, @Order Total, @Order Account, @Order Cost Centre); SELECT @Order New ID = SCOPE_IDENTITY()" Select Command="SELECT * FROM [tbl Orders]" Update Command="UPDATE [tbl Orders] SET [Order Date] = @Order Date, [Order Total] = @Order Total, [Order Account] = @Order Account, [Order Cost Centre] = @Order Cost Centre WHERE [Order ID] = @original_Order ID AND [Order Date] = @original_Order Date AND [Order Total] = @original_Order Total AND [Order Account] = @original_Order Account AND [Order Cost Centre] = @original_Order Cost Centre" Old Values Parameter Format String="original_" oninserting="Sql Data Source2_Inserting" oninserted="Sql Data Source2_Inserted" onupdated="Sql Data Source2_Updated" onupdating="Sql Data Source2_Updating" //Update Order Table with Total of Order //Sql Data Source2.