1

Closed

This SqlCeTransaction has completed; it is no longer usable.

description

Hello!
When I try to delete the any profile (only one profile), I get a message: This SqlCeTransaction has completed; it is no longer usable.
[InvalidOperationException: This SqlCeTransaction has completed; it is no longer usable.]
System.Data.SqlServerCe.SqlCeTransaction.EnterPublicAPI() +191
System.Data.SqlServerCe.SqlCeTransaction.Rollback() +53
ErikEJ.SqlCeProfileProvider.DeleteProfiles(String[] usernames) +558
System.Web.Profile.ProfileManager.DeleteProfile(String username) +84
TopForecast.ru.Admin.ManageUsers.gvUsers_RowDeleting(Object sender, GridViewDeleteEventArgs e) +126
System.Web.UI.WebControls.GridView.OnRowDeleting(GridViewDeleteEventArgs e) +139
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +637
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +952
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +210
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Closed Jan 29, 2012 at 7:02 AM by ErikEJ
Fixed

comments

wrote Aug 4, 2011 at 6:04 PM

Fixed on changeset 9386

wrote Aug 4, 2011 at 6:04 PM

ErikEJ wrote Aug 4, 2011 at 6:05 PM

Could you try the latest source?

Lopatin wrote Aug 4, 2011 at 7:05 PM

Yes, the latest version 2.1.0.1. I use ProfileProvider from here: http://leedumond.com/blog/asp-net-profiles-in-web-application-projects/

Error in this place:
try
                {
                    conn.Open();

                    tran = conn.BeginTransaction();

                    cmd.Transaction = tran;

                    foreach (string username in usernames)
                    {
                        cmd.Parameters[0].Value = GetUserId(username);

                        rowsAffected += cmd.ExecuteNonQuery();
                    }

                    tran.Commit();

                }
                catch (SqlCeException)
                {
                    throw;
                }
                finally
                {
                    if (tran != null)
                        tran.Rollback();
                }

Lopatin wrote Aug 5, 2011 at 6:36 AM

Now it works, thanks!

ErikEJ wrote Aug 5, 2011 at 7:15 AM

Thanks for the feedback, I will issue an update

wrote Jan 29, 2012 at 7:02 AM

wrote Feb 14, 2013 at 2:32 AM

wrote May 16, 2013 at 8:12 AM