Home | HTML | Asp.Net | HTML Probe | .Net Probe
   
 www.solvingera.com 
  Contact Us |Sitemap
  
 

Data Source Controls in Asp.Net

Skip Navigation LinksHome>Asp Home>Data Source Controls
Asp.Net provides several Data Source Controls which we are discussing below:

SqlDataSource Control

The SqlDataSource control is a data source control that is used to access data from the Database (i.e. SQL, ORACLE or MS Access). This control allows server control to retrieve data from a relational database and to display or modify the data at runtime.
The SqlDataSource Control generates a connection string through Configure Data Source wizard. It is used for the interaction between Sql database and ASP.Net page.
The sqlDataSource control automatically performs all the task like it opens a database connection, executes commands, and then closes the database connection.

Some important properties of SqlDataCource Control are given below:
  • ConnectionString: Sets the ADO.NET provider-specific connection string that is used to connect to the database.

  • DataSourceMode: Sets the data retrieval mode to fetch data.

  • ProviderName: Sets the name of the .Net Framework data provider that is used to connect to the underlying data source.

  • DeleteCommand: Sets the SQL Command string that is used to delete data from the selected database.

  • InsertCommand: Sets the SQL Command string that is used to insert data into the selected database.

  • UpdateCommand: Sets the SQL Command string that is used to update data in the selected database.

  • SelectCommand: Sets the SQL Command string that is used to retrieve data from the selected database.

AccessDataSource Control

The AccessDataSource Control is used to access a Microsoft Access database. This control uses DataFile property to access the data file (i.e .mdb file) instead of connection string. In this control, there is no need to set the username and password to access the data from .mdb database.

Some important properties of AccessDataSource class are given below:
  • DataFile: Specifies the path of the Microsoft Access .mdb file.

  • DeleteQuery: Sets the SQL Query string that is used to delete data from the selected database.

  • InsertQuery: Sets the SQL Query string that is used to insert data into the selected database.

  • UpdateQuery: Sets the SQL Query string that is used to update data in the selected database.

  • SelectQuery: Sets the SQL Query string that is used to retrieve data from the selected database.

LINQ Data Source Control

LINQ is the interaction between Object-Oriented programming and relational data by applying the principles of OOPs. The LinqDataSource control is used to access data location in the relational database or in the memory data collection such as array and context object.

Some important properties of LinqDataSource class are given below:
  • GroupBy: Sets a value that is used for grouping the retrieved data.

  • Select: Sets the properties and calculated values that are included in the retrieved data.

  • TableName: Sets the name of data object that represents a data collection.

  • Where: Sets a value specifying the condition that must be true for a record to be included in the retrieved data

ObjectDataSource Control

The ObjectDataSource Control represents a middle-layer business object with the capabilities to display, edit and sort the data on a web page with minimum code.

Some important properties of ObjectDataSource class are given below:
  • TypeName: Contains the methods specified in the ObjectDataSource Control.

  • SelectMethod: Sets the method that is invoked to retrieve data.

  • SelectParameters: It is the collection of parameters that is used by the SelectMethod property.

  • UpdateMethod: Sets the method that is invoked to update data.

  • UpdateParameters: It is the collection of parameters that is used by the UpdateMethod property.

SiteMapDataSource Control

The SiteMapDataSource Control is used to configure the navigation data of a website. This control is very useful to change sitemap data at runtime based on user privilege or status.

Some important properties of SiteMapDataSource class are given below:
  • SiteMapProvider: Sets the name of the site map provider associated with the data source control.

  • StartingNodeUrl: Sets the URL of the starting node.

  • ShowStartingNode: Sets a value to Display (True) the starting node or not.

XmlDataSource Control

The XmlDataSource Control is used to bound data from the XML document.

Some important properties of XmlDataSource class are given below:
  • Data: Sets a block of XML data that the data source control bind to.

  • DataFile: Specify the name of the XML data file.
  
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top