This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy


// The IDbConnection interface defines a common



Download 21,46 Mb.
Pdf ko'rish
bet543/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   539   540   541   542   543   544   545   546   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

// The IDbConnection interface defines a common

// set of members supported by all connection objects.

public interface IDbConnection : IDisposable

{

// Methods

IDbTransaction BeginTransaction();

IDbTransaction BeginTransaction(IsolationLevel il);

void ChangeDatabase(string databaseName);

void Close();

269

C H A P T E R   9

8849CH09.qxd  10/1/07  10:41 AM  Page 269



IDbCommand CreateCommand();

void Open();



// Properties

string ConnectionString { get; set;}

int ConnectionTimeout { get; }

string Database { get; }

ConnectionState State { get; }

}



Note

By convention, .NET interface types are prefixed with a capital letter “I.” When you are creating your own

custom interfaces, it is considered a best practice to do the same.

Don’t concern yourself with the details of what these members actually do at this point. Simply

understand that the IDbConnection interface defines a set of members that are common to all

ADO.NET connection objects. Given this, you are guaranteed that each and every connection object

supports members such as Open(), Close(), CreateCommand(), and so forth. Furthermore, given that

interface members are always abstract, each connection object is free to implement these methods

in its own unique manner.

Another example: the System.Windows.Forms namespace defines a class named Control, which

is a base class to a number of Windows Forms UI widgets (DataGridView, Label, StatusBar, TreeView,

etc.). The Control class implements an interface named IDropTarget, which defines basic drag-and-

drop functionality:

public interface IDropTarget

{

// Methods

void OnDragDrop(DragEventArgs e);

void OnDragEnter(DragEventArgs e);

void OnDragLeave(EventArgs e);

void OnDragOver(DragEventArgs e);

}

Based on this interface, we can now correctly assume that any class that extends System.



Windows.Forms.Control supports four subroutines named OnDragDrop(), OnDragEnter(),

OnDragLeave(), and OnDragOver().

As you work through the remainder of this text, you will be exposed to dozens of interfaces that

ship with the .NET base class libraries. As you will see, these interfaces can be implemented on your

own custom classes and structures to define types that integrate tightly within the framework.


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   539   540   541   542   543   544   545   546   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish