20 July 2009

Issues with Creating DAL (Data Access Layer)

Some of the basic issues with creating DAL (Data Access Layer) are shared below.
  • When any TableAdapter is added in a strongly typed DataSet (name: Northwind)
    1. a namespace (name: NorthwindTableAdapters) is created for the TableAdapters in the DataSet.
  • When a TableAdapter (name: Products) is added to a DataSet (name: Northwind)
    1. A DataTable type (name: Northwind.ProductsDataTable) is created in the DataSet
    2. The created DataTable contains a collection of DataRows (name: Northwind.ProductsRow)
    3. A TableAdapter is created in the TableAdapters' namespace (name: NorthwindTableAdapters.ProductsTableAdapter)

  • SCOPE_IDENTITY() function in SQLServer returns the last identity value inserted. Details found here.

  • In case of insert query in TableAdapter, the default 'ExecutionMode' value is 'NonQuery' meaning the query will return the number of afftected rows. The ExecutionMode value 'Scalar' means that the query will return the value actually returned by the query (not number of afftected rows).

0 Comments:

 

© 2007 t!ps n tr!cks: Issues with Creating DAL (Data Access Layer)



Template unik dari rohman


---[[ Skip to top ]]---