Note that there are some explanatory texts on larger screens.

plurals
  1. POasp.net parameter update reports 1 row updated but no data in table added
    primarykey
    data
    text
    <p>I am getting an incorrect repsonse after an update to a table. In my RowUpdating event I have the following code which builds an Update Parameter to call an SP to update a table. I must be doing something wrong but everything runs fine. My rowsAffected variable reports 1 after the update, but the table never gets the data.</p> <p>Here is the relevant code behind in RowUpdating event. The values are correctly populated in the parameters as well.</p> <pre><code>itemDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("myConnString").ToString() itemDataSource.UpdateCommandType = SqlDataSourceCommandType.StoredProcedure itemDataSource.UpdateCommand = "usp_updatePTT" ' Call stored procedure 'Establishes value of Primary key and String sent to SP itemDataSource.UpdateParameters.Add("ID", updateKey) itemDataSource.UpdateParameters.Add("lang_String", updateString) Dim rowsAffected As Integer = 0 rowsAffected = itemDataSource.Update() GridView4.DataBind() </code></pre> <p>and here is the SP....</p> <pre><code>@ID int, @lang_String nvarchar(1000) AS /* SET NOCOUNT ON */ BEGIN UPDATE tblLangROOTptt SET lang_String = @lang_String WHERE (ID = @ID) END RETURN </code></pre> <p>Any suggestions would be appreciated... thanks,</p> <p>UPDATE: I found a solution that is working. On the original DataSource for the update command I needed to add the following....</p> <pre><code>UpdateCommand="EXEC usp_updatePTTrootString @ID=@original_ID, @lang_String=@lang_string" &gt; </code></pre> <p>This in essence allows the original data source to call the SP. Note: that the command type needs to stay as TEXT not Stored Procedure as one might think.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload