1 / 18

Understanding ADO.NET: Connection Strings, DataAdapters, and DataTables

This overview of ADO.NET covers essential components like connection strings, command objects, and data retrieval methods. It explains key aspects such as the absence of a username or password in a connection string, the use of DataAdapter to manage data, and how to access data using methods like ExecuteScalar and Fill. Additionally, it addresses the importance of DataRow state and provides insights on binding controls to DataTables. With a focus on practical usage, this guide is suitable for developers looking to enhance their understanding of ADO.NET functionality.

lev-joyce
Télécharger la présentation

Understanding ADO.NET: Connection Strings, DataAdapters, and DataTables

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ADO.NET Review

  2. The connection string does not contain the following • Username • Password • SQL • Provider • Datasource

  3. To return only one value from a query, use the ___________ method. • ExecuteNonQuery • ExecuteReader • ExcecuteItem • ExecuteScalar

  4. The DataAdapter object • Is used to store Table results • Contains the Select, Update, Delete and Insert SQL • Is the translator for the client SQL • Is used when accessing multiple tables

  5. To use the DataTable.Load method, you need a • DataReader object • DataAdapter • DataExecutive • DataDATAtool

  6. To get data using a DataAdapter use this method • Get • Fill • Retrieve • Execute

  7. The DataRow.RowState tells us • If the row is unchanged • If the row is inserted • If the row is deleted • If the row is proposed • All of the above

  8. To get rows of a table that have changed, use • .Changes • .Update • .GetChanges • .HasChanges

  9. To check if there are any rows of a table that have changed, use • .Changes • .Update • .GetChanges • .HasChanges

  10. To access a specific field in a table, code the following • table.current.col • table.rows.col.item • table.rows(x).col(“FieldName”) • table.rows(x).item(“FieldName”)

  11. DataSets hold • Sets • DataAdapters • DataSet Objects • DataTables

  12. The CurrencyManager objects is derived from the____________ class. • BindingContext • ContextManager • BindingManager • DataContext

  13. A command object requires • SQL and a Connection Object • SQL • A Connection • A DataReader

  14. The unique identifier for a record in a table is • The Primary Index • The Foreign Key • The Primary Key • The Foreign Index

  15. The connection may be used by • a DataAdapter • a Command Object • Neither • Both

  16. When using a datareader, to get the contents of the second column of a datatable (of type string) use... • rdr.GetString(2) • rdr.GetValue(2,”String”) • rdr.GetString(1) • rdr.Read(1)

  17. Datatables are made up of • DataSets • DataRows and DataColumns • DataAdapters • Hopes and Dreams

  18. To bind a Combox to a DataTable, set the following... • DataSource, DisplayMember & ValueMember • DataSource • DisplayMember • ValueMember

More Related