|
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class CustomObjectNC : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// this is workaround for a bug in ObjectDataSource (only happens in some cultures)
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
}
protected void ObjectDataSource1_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
}
protected void ObjectDataSource1_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
e.AffectedRows = ((int)e.ReturnValue > 0) ? 1 : 0;
lbResult.Text = String.Format("Affected Rows = {0}. Generated Id = {1}", e.AffectedRows, (int)e.ReturnValue);
}
protected void ObjectDataSource1_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
e.AffectedRows = (int)e.ReturnValue;
lbResult.Text = "Affected Rows = " + e.AffectedRows;
}
protected void ObjectDataSource1_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
{
e.AffectedRows = (int)e.ReturnValue;
lbResult.Text = "Affected Rows = " + e.AffectedRows;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Manuel Abadia had his MS Degree in Computer Science (Univ. Murcia, Spain)
He is a Freelance Software Architect/Engineer and Trainer.
He sells his own components in his webpage (http://www.manuelabadia.com).
He was the Software Architect for the MoviTAP project that won the first prize in the Microsoft and Vodafone mobile web Services contest.
He has done some external work in companies like Namco America Inc. and Gaelco SA.
He has contributed to the MAME project (http://www.mamedev.com) for some years (and continues to do so eventually).