Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why creating ds breaks Delete method?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Why creating ds breaks Delete method?
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01343233
Message ID:
01343233
Vues:
63
Hi everybody,

I have a GridView on a page. If I add the following code:
 protected void ProfilesGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (!IsPostBack && e.Row.RowType == DataControlRowType.DataRow)
        {
            //We need to save dataset in a session variable
            System.Data.DataView dv = (e.Row.DataItem as System.Data.DataRowView).DataView;

            System.Data.DataTable dt = dv.ToTable();
            DataSet ds = new DataSet();
            ds.Tables.Add(dt);
            Session.Add("dts", ds);
        }
I'm getting the following error:
=========================================================
Server Error in '/my' Application.
--------------------------------------------------------------------------------

The GridView 'ProfilesGrid' fired event RowDeleting which wasn't handled.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The GridView 'ProfilesGrid' fired event RowDeleting which wasn't handled.

Source Error:

etc.

If I comment this code, the Delete functionality works correctly handled only in RowDeleted method.

Why adding this code breaks the Delete functionality and how can I fix it?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform