Go to DotNetFunda.com
 Online : 1480 |  Welcome, Guest!   Login
 
Home > Interview Questions > C# Interview Questions > What is Attribute Programming? What are ...

call for mock interview


C# Interview Questions


What is Attribute Programming? What are attributes? Where are they used?

Author: Rohitshah | Posted on: 10/7/2008 4:40:22 AM | Category: C# | Views:2889 |  Print | Asked In: Many Interviews



Answer:
Attributes are a mechanism for adding metadata, such as compiler instructions and other data about your data, methods, and classes, to the program itself. Attributes are inserted into the metadata and are visible through ILDasm and other metadata-reading tools. Attributes can be used to identify or use the data at runtime execution using .NET Reflection.

Found interesting? Add this to:

| More


 Response(s)
Posted by: Nandakumarpb | Posted on: 21 Aug 2010 11:30:30 PM | Points: 10

Iam trying add more here to complete.

Some attributes are : DllImport,WebMethod..etc.

This can be used in any of your entity(class) to give explanation of the information your want to give.
eg:[DllImport("user32.dll", EntryPoint = "MessageBox", CharSet = Unicode)]
This will tell the compiler to declare the function (which is in user32dll). DllImport attribute usually using for calling windows API].
You can also create custom attribute. refer below link for more ..
http://msdn.microsoft.com/en-us/library/sw480ze8(v=VS.71).aspx

Navigate to:

 Submit Interview Questions

How will you upload a file to IIS in Asp and how will you do the same in AS ...

What is the difference between Data Reader & Dataset? ...

Random Interview Questions
Help: If for some reason you are getting the same question by clicking Next Question or Previous Question, Try clicking Categories link above.

Related interview questions

More ...


Advertisement

About Us | The Team | Advertise | Contact Us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 9/3/2010 4:36:03 AM