C# VS2008 Question

hi,
what is this code for, also what is select and true about?
[System.ComponentModel.DataObjectMethodAttribute
(System.ComponentModel.DataObjectMethodType.Select, true)]

Open in new window

LVL 1
fahadmanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RPCITCommented:
could you put this in context?  maybe a few lines above and below?
0
RPCITCommented:
my guess is that this is being used at a method attribute, to make reflection easier...

link below..

http://msdn.microsoft.com/en-us/library/system.componentmodel.dataobjectmethodattribute.aspx
0
fahadmanAuthor Commented:
sorry here is the code and attached is the tutorial that use the code

ProductsBLL.cs
using System~
using System.Data~
using System.Configuration~
using System.Web~
using System.Web.Security~
using System.Web.UI~
using System.Web.UI.WebControls~
using System.Web.UI.WebControls.WebParts~
using System.Web.UI.HtmlControls~
using NorthwindTableAdapters~
3 of 13
[System.ComponentModel.DataObject]
public class ProductsBLL
{
private ProductsTableAdapter _productsAdapter = null~
protected ProductsTableAdapter Adapter
{
get {
if (_productsAdapter == null)
_productsAdapter = new ProductsTableAdapter()~
return _productsAdapter~
}
}
[System.ComponentModel.DataObjectMethodAttribute
(System.ComponentModel.DataObjectMethodType.Select, true)]
public Northwind.ProductsDataTable GetProducts()
{
return Adapter.GetProducts()~
}
[System.ComponentModel.DataObjectMethodAttribute

Open in new window

datatutorial02cs.pdf
0
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

RPCITCommented:
that's what I was thinking .. the link I provided before give some good information.
0
fahadmanAuthor Commented:
so simply what is about, my guess is that it will apear in drop downlist when i'm writing the code, am i correct, aslo what is select and true for?
0
RPCITCommented:
as far as I know.. this funcationality doesn't have anything to do with the item showing up in intellisense.  Its more for providing a "helper" for System.Reflection methods.  (for backing into an object if you don't know what it is at runtime).

argument definitions below...

C#
public DataObjectMethodAttribute(
    DataObjectMethodType methodType,
    bool isDefault
)

Parameters
methodType
Type: System.ComponentModel..::.DataObjectMethodType
One of the DataObjectMethodType values that describes the data operation the method performs.

isDefault
Type: System..::.Boolean
true to indicate the method that the attribute is applied to is the default method of the data object for the specified methodType; otherwise, false.

http://msdn.microsoft.com/en-us/library/4ad99k3d.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.