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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

How to change DataMember Name based on our requirements ?

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :WCF
 

Hi,

I have one Data Contract class like this.

  [DataContract()]
  public class Contract
  {
       .......
       .........
Some Properties with DataMembers Attribute.
       ............
       ..............
        
    [DataMember(Name = "Messages")]
    public string Messages
    {
      get;
      set;

    }
  }

In the above class, i need change name of the Property Messages based on the requirements. Means some times i have to return the same property with name of "ValidMessages" and in some times i have to return the same property with name of "InValidMessages". Like wise i have to change my property name based on our business requirements. I don't want to create new properties for ValidMessages and InValidMessages.

With out creating new properties in the class how to solve this type problems?

Any help greatly appreciated.




View Complete Post


More Related Resource Links

How do you change the datasource for a list based on another? ie a secondary list being a filtered

  
I'm actually using Sharepoint 2007, but am hoping this forum will help.  We want to be able to create a list based on a filtered view of another list.  I can create a Filtered List in Designer, but evidently this is saved as a query object on the server and not as another list that can be selected when using the basic Sharepoint tools.  In other words, it's only visible when in Designer.  This means that in order to use this for say a lookup column in another list object, I have to modify the datasource tags for the EditForm and NewForm.aspx pages within Designer.  Also, it means that adding a column would constantly require use of Designer.  We need this to be simple as not all those tasked with administrating pages will know how to do this.  I thought it would be easier if I could simply source a secondary list with the filtered list I created in designer.  In other words, make a secondary list source be that of a queried view of a master list.  Then this list could be used with all the simple tools provided.  Is this possible?  If so... how?

change contents of page based on choices

  
Hi,I am using AppCode and have 6 arrays of information I want to display on my web page. However I only want three to be visible at any one time. ________________________________ |                    |                       |                 | |                    |                       |                 | ________________________________      button             button            button i.e. a table like the above.   I have created the layout and the choice buttons etc I am using querystrings to pass the changes to the webpage.The problem comes however when trying to write the code for the table diplay. Now each has a slightly different layout.My initial thought was to write

bind values for the drop down based on people picker value change

  
hi, i have a two lists in my sp. list 1 name  items user1 item1 user1 item2 user2 item1   and list 2 is in this way in this i have a people picker and a drop down when ever i change the name in people picker the value should get filled from list 1 and fill in drop down list so i need to get the on text changed event of people picker and bind it in the dropdown list could some help me out in fixing thisjayaraja

bind values for the drop down based on people picker value change

  
hi, i have a two lists in my sp. list 1 name  items user1 item1 user1 item2 user2 item1   and list 2 is in this way in this i have a people picker and a drop down when ever i change the name in people picker the value should get filled from list 1 and fill in drop down list so i need to get the on text changed event of people picker and bind it in the dropdown list could some help me out in fixing thisjayaraja

Change background colour based on data key change?

  
Hi there,I have a GridView with an alternating Css style. The GridView has a column called tradeId. What I want to show is an alternating colour based on a change in the tradeId. Is this possible? It will make it easier on the eye to group trades together by colour. Here's the GridView code as it is right now:<asp:GridView             ID="dtlEntryStats"             runat="server"             DataSourceID="sdsEntryStats"             DataKeyNames="tradeId"             AlternatingRowStyle-CssClass="alternating"            GridLines="None"             CssClass="gridView"            AutoGenerateRows="false"             AutoGenerateColumns="false"             AllowPaging="true"           &n

how to change the view of SharePoint List based on field?

  

hi all,

I have different sites in my sharepoint application. in every site i have one list, this list have one field called location. When i open this list in purticular site at the time users  will see only the items where the location filed is equal to the site name.

So please suggest me how we can achieve this?

thanks.......

 


How to change the Default Value of the Parameter to "Query Based"

  

Hi I have a Report which i deployed into my localhost.

In the Report Manager, Report Parameter Properties, I unchecked the HasDefault option for which Default value is coming from some Query.

When I retry to Set the Default Value to Query Based, Its not taking.

Need Help.


Policy-Based Management and On Change - Prevent

  

All,

 

I’m working on Policy-Based management feature and I’m keen to implement some of the features. I tried to setup a Policy for a “backup device” facet based on the condition that the name starts with bkd_. I tried to set the evaluation mode to “On Change – Prevent” but unfortunately I could not find the mode at all in the Policy Screen. I also made sure the “Nested Triggers” advanced Option is set to 1.

 

I went through this  link http://blogs.msdn.com/b/sqlpbm/archive/2009/04/13/policy-evaluation-modes.aspx and checked for the execution_mode in  msdb..sysp

SSRS 2005 - Change 2nd Parameter Value based on 1st Parameter Value (Non-queried)

  

I am wanting to filter my report based on Fiscal Year.  I have the first parameter as @STARTDATE and 2nd parameter as @ENDDATE.  The values for both of these are hardcoded in non queried.  When the user selects the @STARTDATE , I want to automatically set the value for the @ENDDATE parameter.  I'm doing it this way because I'm using BETWEEEN in my SQL Query.  Ideally, I will just have the @ENDDATE value hidden if possible.

So for example:

@STARTDATE has values of 10/1/2009 and 10/1/2010.
@ENDDATE has values of 9/30/2010 and 9/30/2011.

When @STARTDATE is selected to 10/1/2009, set the @ENDDATE value to 9/30/2010.
When @STARTDATE is selected to 10/1/2010, set the @ENDDATE value to 9/30/2011.

Any idea how/if this can be accomplished?


Change UserName and Password Requirements

  

 

 How do i change the default user name and password requirements.   I wanna make the user name the person email address and i don't want it case sensitive.. I wanna make the mininum password to be 4 characters or numbers case sensitive.  The maxinum password can be 10 characters or numbers.

 

Scott


InfoPath -Validate a Field Based on ANY change in a Secondary Field

  

I would like to require a change to one field if a secondary dropdown field is changed at all.  At Minimum I would like to change the formatting or color of the field in question.

 


Change e-mail for form-based user

  

Hi, all.

I create some users with wrong e-mail, some without e-mail. When I need to give them true email address I encountered a problem: i can't do this.

I trying to change email in sql base aspnetdb, wss_content_webapp, then restart sql, restart IIS, restart server - nothing helps me.

I tried to go to user - my settings - change and didn't see e-mail form to change.

I don't need MySite collection.

Question is - how i can change all information of user when user already exist. When i create user with writing same information - all information picking up.


How to change the folder icon dynamically based on the name of folder in shared document library

  

I have created visual webpart ,through this webpart i am creating the folders dynamically in shared document library.

here my thing is if i create folder with specific name,want to set custom icon instead of default icon

please any one help me on this.

 

Advanced thanks

Venky 


How do I automaticaly change one property based on another with MVVM?

  

Hi

I have a grid connected to a ViewModel class with two properties, public Address SelectedAddress and public ObservableCollection<Address> Addresses.

Address has, among other things, int? PersonID and int? CompanyID. My validation code in the Model checks that one of them is filled, but not both.

How do I set up code in the grid or ViewModel so that whenever PersonID is filled, CompanyID is automatically set to null, and the other way?

TIA

Dennis


Change column names in report based on another dataset

  

My report displays a result set from DataSet1 which contains non-descriptive column names that are shown as my column headers.

A1, A2, A3, A4, ...

I have a second Dataset that contains 'friendly' names:

A1  Jan

A2   Feb

A3  Mar

....

How can I map the friendly names from DataSet2 to the column names that came with DataSet1?

Thank you for any help you may be able to provide.


help to change from cursor to cte or window function or set based

  
Hi i have table lots of heartbeats i need to know when heartbeat started and when it stopped, and not all the heartbeats in between. Can be multiple heartbeat stops. Thanks
set nocount on
create table #temp (id int, alive bit, checktime datetime)
go
insert #temp values (1,1,dateadd(minute,-7,GETDATE()))
insert #temp values (1,1,dateadd(minute,-6,

5 GridView Themes Based on Google's Personalized Homepage (igoogle)

  
One of the silly features I have found that I like about igoogle is how the pages color palette changes depending upon the time of day. So as the day progresses from morning to afternoon to evening the colors on the page change as well. Like I said, I know this is a silly feature, but I like it. And I have asked around a little bit and seems like other people like it to. To get a better idea of how the colors change, here are the background images from a few of the HTML elements.
Categories: 
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