Работа с базами данных на C#

  • View
    4.588

  • Download
    6

Embed Size (px)

Text of Работа с базами данных на C#

C# ADO .NET , 08080165 . . . .

2009

681.3(075) 22.18 7 P 13: (. . .-. , . . ); , . . . -

P 13

C#. DO .NET: / . . . , . . . : , 2009. 170 .ISBN 978-5-9795-0475-9 ADO (ActiveX Data Object) .NET #. Microsoft Access Microsoft SQL Server; SQL, ADO .NET. , ( 080801 ( )) , , .

681.3(075) 22.18 7

ISBN 978-5-9795-0475-9

. ., . ., , 2009 . , 2009 2

..................................................................................................................................5 1. ......................................................................................................7 1.1. .............................................................................7 1.2. .............................................................8 1.2.1. .................................................................................................9 1.2.2. .........................................................................................................10 ER- ......................................................................................................................10 , ...............................................................................................11 .......................................................................................................................13 1.2.3. ........................................................................................................15 1.3. Microsoft Access ...............................................................................15 1.3.1. ..........................................................................................................................15 1.3.2. ..............................................................................................................................17 1.3.3. ...............................................................................................................................18 1.4. Microsoft SQL Server........................................................22 1.4.1. .........................................................................23 1.4.2. Microsoft SQL ...........................................28 1.5. 1.....................................................................30 2. SQL ....................................................................................................................32 2.1. SQL-......................................................................................33 2.2. SQL ...................................................................................36 2.3. like ........................................................................................37 2.4. SQL .........................................................................38 2.5. DML ...........................................................................39 2.6. 2.....................................................................41 3. ..........................................................................................42 3.1. ..................................................................42 3.2. ADO .NET ..................................................................................................53 3.2.1. DataSet..............................................................................................53 3.2.2. ( DataTable DataColumn) ..................................................53 3.2.3. DataRelation ....................................................................................................53 3.2.4. ( DataRow)..............................................................................................53 3.2.5. DataAdapter .....................................................................................................................54 3.2.6. DBConnection DBCommand .......................................................................54 3.3. Server Explorer .......................................................................................................................54 3.4. ...................................................................56 3.5. 3.....................................................................58 4. ADO .NET...................................................................................................................59 4.1. .................................................................................................59 4.1.1. ConnectionString ........................................................59 4.1.2. . Connection ............................................................60 4.1.3. Connection.........................................................................................61 4.1.4. .................................................................................................64 MS SQL ..........................................................................................................64 MS Access ......................................................................................................65 4.1.5. ...........................................................................................65 4.2. ...........................................................................................................67 4.2.1. ...........................................................................................68 4.2.2. ...................................................................................................70 3

4.2.3. ...............................................................................74 4.2.4. Management Studio..................................................80 4.2.5. Visual Studio 2008 ...................................................82 4.3. .........................................................................................................85 4.3.1. SQL- CommandText...........................................................85 4.3.2. Command ...........................................................................................................86 .................................................................................................86 CommandType CommandText..........................................................................88 ExecuteNonQuery......................................................................................................89 ExecuteScalar.............................................................................................................93 ExecuteReader ...........................................................................................................95 4.3.3. ....................................................................................97 ExecuteNonQuery ..........................................................................98 ExecuteScalar ...............................................................................104 ExecuteReader..............................................................................104 4.3.4. .........................................................................................108 ...........................................................108 ...................................112 SQL-...............................................113 4.3.5. ....................................................................................................................115 ADO .NET ...................................................................................................119 4.4. ...............................................................................................123 4.4.1. DataSet, DataTable DataColumn................................................................123 DataTable DataColumn ...........................................124 PrimaryKey .........................................................................................................126 UniqueConstraint ForeignKeyConstraint..................................................127 , .............................................................128 .........................................................................130 .....................................................................................................132 4.4.2. DataRow ...........................................................................................................133 ....................................133 RowState .............................................................................................................137 RowVersion ........................................................................................................138 DataTable ..............................................................................................143 4.4.3. DataGridView...................................................................................................145 DataGridView.........................145 DataGridView ..................................149 4.4.4. DataView ..........................................................................................................149 ...........................................................................................................150 ............................................................................................................151 .....................................................................................................................152 4.4.5. ............................................................................................157 HashTable .................................................................