Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# 2.0 Return DataReader object
Message
From
09/03/2012 18:41:05
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01537785
Message ID:
01537876
Views:
31
An interface says what a class can do, but not how it does it. For example, IDataReader has a Read method that takes no parameters and returns a bool. IDataReader doesn't say how it does the read, but any class that implements IDataReader will have that method. Classes that implement the interface such as SqlDataReader provide the details on how the Read is actually done.

Programming to an interface means that you use the interfaces instead of the classes. Since anything that implements the interface will have the same set of functions and properties, you can do things like substitute the SqlDataReader with an OleDbDataReader with minimal adjustments to your code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform