private void UndeletableComments(LinqDataSourceUpdateEventArgs e)
{
//get a reference to the currently saved item ****NOTE (State) is the ClassName. It’s a table of states in this test database
var currentData = ((MyData)e.OriginalObject).Notes;
// make a copy of whatever is in the edit field and strip out the previous comments
var newData = ((MyData)e.NewObject).Notes.Replace(currentData, string.Empty);
//check both values for nulls
if (currentData != null && newData != null)
{
newData = ((MyData)e.NewObject).Notes.Replace(currentData, string.Empty);
}
// replace the data to be stored in the database with the currentdata + the newData
// I added a datestamp to see when the new comment was added.
((MyData)e.NewObject).Notes = string.Format("{0} Added:{1} at (2) --- {3}", currentData, DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString(), newData);
// I need to see the WINDOW USERNAME by capturing who added a new comments
private void UndeletableComments(LinqDataSourceUpdateEventArgs e) { //get a reference to the currently saved item ****NOTE
Share
see the Environment.UserName