I have attached code below to achieve this.
But I agree with MRomani, you should check your design, if this is the best way to go.
Main Topics
Browse All Topics
Hi,
I have a class which has around 50 properties and the 51 property is going to be called "Compositekey".
Now i want to concatnate all these properties into compositekey.
compositekey = object.property1 + object.property2 + .............. + object.property50.
how do i do it. I will be crumbersome to concatanate one property at a time....
any thoughts would be highly appreciated.
Rithesh
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The code above is processing all 51 properties including the composite key.
Unless you are taking information out of your composite key, you can use guiid (this value is unique)
Id = Guid.NewGuid().ToString();
From MSDN:"A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated."
I understand i should review the design aspects but the issue i have is little strange...
I have to compare the value of the instance data with the value of the single row in a grid, Meaning the instance data would be (value of all the fields in the class) and the value of the row in the grid would be (all the column data in the grid for a single row) and then compare both of these, if the value is same then
i would assume there are duplicate rows in the grid.
any other better options (sure there will be), will be glad!!!!
Business Accounts
Answer for Membership
by: MRomaniPosted on 2009-11-05 at 11:37:25ID: 25753057
a quick question for you is why are you trying to concatenate all those properties?
en-us/libr ary/ms1731 83(VS.80). aspx
my suggestion (for now) to you is to do some research on reflection, thats probably gonna help you out.
a good start would be :
http://msdn.microsoft.com/
although it would help knowing a bit more on why/what you are doing with the composite key full of properties...