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

  • Published on
    27-Jul-2015

  • View
    4.577

  • Download
    6

Embed Size (px)

Transcript

<p> C# ADO .NET , 08080165 . . . . </p> <p> 2009</p> <p> 681.3(075) 22.18 7 P 13: (. . .-. , . . ); , . . . - </p> <p>P 13</p> <p> 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 ( )) , , .</p> <p> 681.3(075) 22.18 7</p> <p>ISBN 978-5-9795-0475-9</p> <p> . ., . ., , 2009 . , 2009 2</p> <p> ..................................................................................................................................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</p> <p>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 .................................................................................................................157 ArrayList ...................................................................................................................158 4.5. 4...................................................................160 ...................................................................................................................................162 ...............................................................................................................167 .......................................................................................................170</p> <p>4</p> <p> 080801065 ( ) , ( ). ..03</p> <p> (). . . . . . . XML-. . . . . . (L). . L-. , . . . . . . . : , , - . - : - ; ; ; ; ; ; . . . , . ; ; . . . . . ; .</p> <p>..04</p> <p> (), , (L-) ADO (ActiveX Data Objects) .NET C#.</p> <p>5</p> <p> - . ADO .NET . , # Windows .NET. # Windows .NET. Windows- .NET C#, . 4- . . : ( ), , , , , . ., , . . SQL (Structured Query Language) SQL Management Studio. Visual Studio 2008 . , , . ADO .NET. ADO .NET, : . C#. [11, 8]. , , , ( ). .6</p> <p>1. 1.1. () , , , , . , , , , . , . (, , , ), (, , , ). . ( ), (. 1). (, , , ). . , .</p> <p>. 1. 7</p> <p> (). : ( ); ; . , . (, ) . . : ; ; ; , . . , . , (SQL Structured Query Language). , .</p> <p>1.2. , , , , . , , , . ., . , , , . . . : , .8</p> <p> . , . . () . . . . , (), , . , , .</p> <p>1.2.1. . , , . . , . 1. 1 9</p> <p> , . , , , , , . , , , , . , , : , 2 , , 2 7 . , 3 . . . , , , , . . . , , , . , . .</p> <p>1.2.2. ER- ER- (Entity-Relationship -). , , . 5 : 10</p> <p> : () . ( , , , ). . . ER, . 2. ER- . 2. </p> <p>, . , , . , , . 2. 2 </p> <p> , . , . , . , , . ER- 11</p> <p>, , , . - . . relation () relationship ( ). , . () , . , . (), , . . . (). , ( ) . , , . , ( ) . , . (. 3). , . , , , . 3 </p> <p>12</p> <p> , . , , , . , , ( ) ( ). , , . , . , . (). (1) . , , , . (2) , . , . (3) . (4) . 1, . 2, ( , . .), 2 . . , . , . . , ?13</p> <p> . , , , (. 3). , -, , . - .</p> <p> 1 1 1 1 1</p> <p>. 3. </p> <p> , . , , 2 --. , , , , . , , : , , , , . 3. . , (, , ., ), , . , . ? 2 . ( ), ( ), . , .14</p> <p>1.2.3. . , Oracle, , , , , . Microsoft Access Microsoft SQL Server 2005 Express Edition.</p> <p>1.3. Microsoft Access 1.3.1. Microsoft Access (. 4).</p> <p>. 4. </p> <p>. 5. 15</p> <p>. 6. </p> <p> 1: , . (. 5). , . (. 6). Microsoft Access 4. 4</p> <p> Microsoft Access , , , , , , , . 255 . (FieldSize) , , 255 . 65 535 . (Text) , , , . (, . .). MEMO , , ( ). 1, 2, 4 8 . (FieldSize) / . 8 . 8 ( 1) . 4 , , , /, /, ./.. Null . 1 . OLE (, Microsoft Word, OLE Microsoft Excel, , ) ( )16</p> <p> 4</p> <p> . URL. 64 000 , , . . 4 </p> <p>...</p>

Recommended

View more >