1 / 66

Ado fundamentals

Ado.net fundamentals. Beginning asp.net 3.5 in c# . What is ADO.net. ADO.NET is the technology that .NET applications use to interact with database. Data binding is a powerful and practical feature Not easy, must have solid grasp of ADO.NET fundamentals. Understanding data management.

crete
Télécharger la présentation

Ado fundamentals

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 fundamentals Beginning asp.net 3.5 in c#

  2. What is ADO.net • ADO.NET is the technology that .NET applications use to interact with database. • Data binding is a powerful and practical feature • Not easy, must have solid grasp of ADO.NET fundamentals

  3. Understanding data management

  4. The role of the database • Adding database to VS2013

  5. Ado.net bAsics

  6. Two groups of classes • Contain and manage data • DataSet, DataTable, DataRow, and DataRelation • Generic • Connect to specific data source • Connection, Command, and DataReader • Data providers

  7. Data Namespaces

  8. Data provider classes • Data classes can’t accomplish much • Data access is needed see table below

  9. Direct data access • The easiest to connect to the database • Steps • Create Connection, Command, and DataReader objects. • Use the DataReader to retrieve information from the database, and display it in a control on a web form. • Close your connection. • Send the page to the user. At this point, the information your user sees and the information in the database no longer have any connection, and all the ADO.NET objects have been destroyed. To add or update information, follow these steps: • Create new Connection and Command objects. • Execute the Command (with the appropriate SQL statement).

  10. Namespaces needed using System.Data; using System.Data.SqlClient;

  11. Creating a connection • SQL Server through the OLE DB provider • Using SqlConnection object from the SQL Server

  12. The Connection String • Data source – name of the server • Initial catalog – name of the database • Integrated security – using Windows user account, SSPI (security support provider interface) or SQL server user id and password • Connection Timeout – how long your code will wait before generating an error

  13. Storing the connection string • Using a constructor • Store in web.config

  14. Import it

  15. Gridview example with mdf file

  16. Drag GridView

  17. Bind a data source

  18. Download the file from douap.uap.asia

  19. The name to be added in the web.config

  20. Shows the columns of the database table

  21. Test the connection

  22. Adding/modifying the properties

More Related