protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
Label4.Text = "共有记录:"+ e.AffectedRows.ToString()+"条";
}
错误提示:
System.Web.UI.WebControls.SQLDataSourceSelectingEventArgs 并不包含“AffectedRows的定义

解决方案 »

  1.   

    void CustomersGridView_RowUpdated(Object sender, GridViewUpdatedEventArgs e)
      {
        // Use the Exception property to determine whether an exception
        // occurred during the update operation.
        if (e.Exception == null)
        {
          // Sometimes an error might occur that does not raise an 
          // exception, but prevents the update operation from 
          // completing. Use the AffectedRows property to determine 
          // whether the record was actually updated. 
          if (e.AffectedRows == 1)
          {
            // Use the Keys property to get the value of the key field.
            String keyFieldValue = e.Keys["CustomerID"].ToString();        // Display a confirmation message.
            Message.Text = "Record " + keyFieldValue +
              " updated successfully. ";        // Display the new and original values.
            DisplayValues((OrderedDictionary)e.NewValues, (OrderedDictionary)e.OldValues);
          }
          else
          {
            // Display an error message.
            Message.Text = "An error occurred during the update operation.";        // When an error occurs, keep the GridView
            // control in edit mode.
            e.KeepInEditMode = true;
          }
        }
        else
        {
          // Insert the code to handle the exception.
          Message.Text = e.Exception.Message;      // Use the ExceptionHandled property to indicate that the 
          // exception is already handled.
          e.ExceptionHandled = true;      e.KeepInEditMode = true;
        }
      }
      

  2.   

    那我要显示gridview记录条数该怎么做?
      

  3.   

    搞一个Label,在datasource.selected事件里用你的e.XXXed改写它不就完事了