.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Compare retrieved fields with "updated" fields

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

I have a web app that allows users to update their public facing information (bio, profile pics, etc).  Once a user updates a piece of information, it needs to be held "pending" until an authorized admin user "approves" the change.  I was thinking that I'd keep a table (called something like PendingHistory) which would hold the "pending" changes, then once approved (which requires TWO admin user to approve), I'll dump this data into the "real" tables that's responsible for displaying information to the public.  Is there a way (I'm sure there has to be) to only store those fields that were changed?  Some sort of comparison of the original field vs "new" so I don't have to save everything.  I was hoping to make it as easy as possible for the admin crew, so that they could just get a view of "pending changes" vs the entire row of data.  So basically I need something like this:

September 15, 2010  John Doe requested to change: First Name to Fred; Last Name to Flinstone

[Date Updated]          [user]                                    

View Complete Post

More Related Resource Links

Create ID (uniqueid?) from two fields when data is entered


I need to create an ID from two fields when they are entered into the db for the first time.  I thought Uniqueidentifer would do this, but it looks like uniqueidentifier is random and i have no control of the process. 

My user will enter 4 letters into a column called INIT and 4 numbers into a column called NUMB.  What I would like to do is create an id by combining those fields.

How can I do this?



LINQ with GridView and edit fields


My project includes a grid view which displays information of inventory items (Assets), data is quried from AssetTable. The GridView has a command field to allow editing, below is a description of the tables and how data is displayed


BuildingTable: (BuildingID, BuildingName)

AssetTable: (BuildingID,..,....,....)


ItemTemplate: Using a LINQ query I join the two table and displays in a label control a string which includes BuildingID and BuildingName (5 North Building)

 EditItemTemplate: Using a LINQ query I populate a DropDownList with strings of BuildingID and BuildingName same as above.
Here  issue which I need to resolve:
1.  ItemTemplate display the correct information (BuildingID BuildingName) but when I switch to EditItemTemplate the pair that is 
displayed is the first one on the list, how do I make is scroll to the item which was displayed in the label ?
<asp:CommandField ShowEditButton="True" >
                    <ControlStyle Wi

I want Er Diagram for Fees System of small institution ,can u plz guide me what fields are necessary


I want Er Diagram for Fees System of small institution ,can u plz guide me what fields are necessary to store Fees information ...


Cutting Edge: Custom Data Control Fields


In ASP. NET 2. 0, the GridView and DetailsView controls are designed to work together. They don't merely provide complementary services, they also share a number of helper classes and components. The output of the GridView control consists of a sequence of rows, each with a fixed number of columns.

Dino Esposito

MSDN Magazine January 2006

Using Ajax AutoCompleteExtender on dynamic fields



I have quite a problem with a form that contains an autocomplete function. The page is an aspx page with c# codebehind.

On the form there is an address field that the user can type in any string address. This field is using an Ajax autocomplete extender, which suggests roadnames to the user. This works fine.
Furthermore the user has the option to add multiple address fields when clicking a button. This works fine now with Jquery. Jquery copies the table which contains, besides other fields, the address field, and "paste" it underneath the existing adress field.

Problem is, how do I attach the Ajax autocomplete extender to the address fields that gets added? Or is there another workaround to make all these fields have this autocomplete function?

Here is my simplfied code:

aspx page:

<td width="200">
  <asp:TextBox ID="TextBoxStopRoadName" runat="server" Width="200"></asp:TextBox>
      <asp:AutoCompleteExtender runat="server"

Enable Go Button after entering data in all fields using javascript funtion


Hi friends,

My page is having one gridview with check boxes,two textboxes and one button just like this see this link now i want to enable go button whenever user has select checkbox in gridview and he needs to enter text in two textboxes. i have written onkeyup event for two textboxes to test whether user enter text in textboxes or not but i am unable to write javascript function to check whether user has selected checkbox in gridview or not to enable go button .My requiremnet is user need to enter three inputs select atleast one checkbox in gridview and he needs to enter text in two textboxes.please friends pls tell me how to write javascript function to find whether user has selected the checkbox in gridview or not

Delete spaces created by combining 2 fields


Howdy, this is kind of a continuation of an answer I got from this thread:  http://forums.asp.net/t/1592766.aspx

My users will enter a city/station where an incident occured, and the date.  The trigger below does work, but it will occasionally put spaces between the citystation and the date.  I think this happens when the citystaion name is not very long, but not sure.

(ex: city____08242010)

How can I make sure that if the incidentid is going to have spaces, that sql deletes those spaces?  I need the id to be space free.





TRIGGER [dbo].[tr_AddID1] ON [dbo].[tblIncidents] INSTEAD

Linq join fields for return data


  how would I join fields together?

           return (from c in storedb.Product_Categories

                         where c.Category_Name.Contains(searchText)
                         orderby c.Category_Name
                         select new {
                                    c.Category_Key && " ;" && c.Category_Name // HOW CAN I DO THIS.....

Linq to SQL returns null for DateTime fields.


I have a linq to sql entity class in which I declared some DateTime fileds like this:

[Column(DbType = "smalldatetime")]
public DateTime? StartDate { get; set; }

And this is how I fetch data form repository:

return repository.Logs.OrderByDescending(l => l.LogID).FirstOrDefault();

All non DateTime fields are filled properly but all datetimes are null.

[Column(DbType = "smalldatetime")]

        public DateTime? StartDate { get; set; }

Crystal Reports can grow fields with large amounts of text layout problem


A can grow field in the details section of a crystal report may have so much text that the section will be larger than the remaining space available on the page (the space below the previous record).  The section has vertical lines on it with Extend to bottom of section when printing set to true.  The section starts on a new page (and may continue on the following one).  I want it to start on the page where the last record was laid out, and continue to the new page without leaving a gap with vertical lines on it.  I'm using Crystal Reports 9 and I can't work out how to do it. Has anyone got a solution?

Send an Email with User fields data entered in the form


Hi All,

          I have a form which have some user input fields(like textboxes,dropdownlists,textarea etc) fields and a submit button.

on click i need to send email with body contents as all the details entered by user in the form

Can anyone suggest how i should approach to this in sharepoint..

any code examples would be appreciated.


calculate fields in a list



how do I go about generating formulas for something like this.

I have a field( choice ) that has three choices (Low, Medium and High ). If I choose Low, I need to add 5 days to the current date( excluding weekends ) and place it in the Target date field, the same goes for Medium = 3 days( exclude weekends) , High = 1 day, exclude weekends.



Dataview CrossList problems if Person fields are Accounts instead of Name with Presence


I tried to create a CrossList DataView of all my tasks lists in a site collection. The problem is that the tasks don't show up in the data view if the "AssignedTo" column of a list is set to display the Account instead of the Name (with presence). The DataView simply seems to filter those items out.

Just to give you a background on this: for some of my lists I changed the AssignedTo column settings to display the "Account Name" of the person the task has been assigned to, instead of the default "Name with Presence". The reason why I changed it is because I use a third party software that automatically sets access permissions to my tasks based on the account name a task is assigned to.

However, as soon as I change the column to Account Name, the tasks disappear off my CrossList DataView. If I switch it back to "Name with Presence" they appear.

Any ideas why this is and how I could fix it?

How to access the refrenced table fields in Ilist object of table MVC asp.net



I have 2 tables, master, detail. 1.master table have fields (id, username, plan)-->id is primary key (PK) 2. detail table have fields (srNo,id, worksummary, ... )--> srNo is PK.

I have created foreign key relationship from detail to .master table for "id" field.

the code is:

IList<detail> objDetail=new List<detail> (); 
IList<master> objMaster = new List<master> ();
string[] sarray = queryFields.Split('|');//

for (int i = 0; i < sarray.Length; i++)
string[] sfields = sarray[i].Split(',');

if (sfields[0] != "")

objDetail.Add(new _detail { Id = count , modify = sfields[1].ToString(), verified = sfields[2], I});


I have problem to add fields in "objDetail" using Add method. But I am unable to access the reference field "Id" , rest of the field of detail table can be accessed using objDetail.

How can I access the "Id" field from objDetail object to add in IList.

I want to solve this problem

Need to pass parameters from URL to fields in Custom List


I have a complex customized list and I need to pass parameters of two fields so that when the 'Questionnaire' is completed and subsequentially opened after initial submission, it will retrieve the Number and GUID automatically in respective fields. I send an email out with a link to the 'Form' that carries the parameters. I am trying to use the following javaScript but am unsure as to where to place this on the SharePoint page for it to work.



<script type="text/javascript">

function loadFormVars()
getQuerystring('CustodianGUID', 'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_ff46_1'); ///replace
customerGUID and form field name
'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_FormField11_ctl00_ctl00_TextField'); ///replace customerGUID
and form field name

alert("it works");

function getQuerystring(key, field)
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
document.getElementById(field).value = qs[1];


When editing a list item the fields are not blank.


This is a recent issue that I have in which I have a "Issue Tracking" List that maintains the workflow of contract renewals.

When an person goes to edit an existing list entry, the description field (standard) has the original text in the box. Prior to this the original - or any older text from a prior change was listed outside and just below the box - and non editable.

That's not the case anylonger.

Any thoughts?



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend