Skip to main content

ADO.Net

ADO.Net Components:
Connection, Command, DataReader, DataAdapter

Differentiate between DataSet and RecordSet:
1) DataSet is entire relation DB in memory. Table/Relation/Views While RecordSet is representation of Table. It do not contain information on relationships, Constraints, Keys.
2) DataSet is designed to work in disconnected mode.
3) There’s no concept of cursor-types in a DataSet
4) DataSet has no record pointer.
5) You can store many edits in a DS and write them in Original DataSource in a single call.
6) DataSet internally represents data with XML and can be serialized. Thus you can easily retrieve data from a DB and then write directly to XML file or reverse.

DataSet is always disconnected?
True


What is advantage of DataReader over DataSet?
DataReader is readonly stream of data returned from the DB as the query executes. It contains one row of data at a time and is restricted to forward-only. Supports to a access multiple result sets but only one at a time and in order retrieved. DataReader needs connection to DB throughout its usage. DataReader is faster than DataSet.

Typed DataSet?
Data access is normally done using indexes on collection in object model. In ADO.Net it is possible to create a variation on a Dataset that supports syntax like DataSet.TableName.Rows(0).ColumnName . Errors in syntax are detected during compile time rather than runtime.
Advantages: Data Designer generates typed ds. When we type ds. We get all table names and column names on row. We do not need to remember.

How to reflect updation of data in dataset to database?
Dim ds As New (Typed)DataSet
Dim da As New SqlDataAdapter(“Select Command”)
Dim cd As New SqlCommandBuilder(da)
da.Update(DataTable/DataSet, srcTable)
If SELECT command is SP and to update/insert/delete we have created SPs
We can create SqlCommand Objects in Code and assign it to InsertCommand,
UpdateCommand and DeleteCommand Property of adapter.

What are Different types of command can be executed?
ExecutedNonQuery, ExecuteScaler, ExecuteReader (In Execute NonQuery we can use transaction. In other Scaler and Reader we can not use transaction. We do not need to assign transaction to every command if connection string has ENLIST=true; it automatically assigns current transaction in the Context to the command being executed.

How to Set DataRelation between in two columns:
ds.Relations.Add(DataRelation Object)
New DataRelation(ParentColumns(),childColumns())
New DataRelation("RelationName", ParentColumn, childColumn)
New DataRelation("RelationName", ParentColumn, childColumn, CreateConstraint = True)
New DataRelation("RelationName",ParentColumns(),childColumns(),CreateConstraint=True)

How do we sort the data from a DataTable:
DataTable.Select(strFilter, strSort) As DataRow()
New DataView(DataTable) and DataView.Sort = “Column1,Column2,...)

How do we get only edited/deleted/inserted records from a DataTable:
DataTable.GetChanges(DataRowState.Added Or
DataRowState.Deleted Or
DataRowState.Modified Or
DataRowState.Detached Or
DataRowState.Unchanged)


How does DataAdapter.Fill Work?
Executes the Execute Reader method and gets the reader.
Reads Each ResultSet using NextResultSet of DataReader From the and Fills the DataTable form the reader. Also creates DataTable if MisingSchemaAction is Add/AddWithKey.

Difference between HTML and XML?
XML : User defined tags. Content driven, End tags required , case sensitive. Quotes required around attributes. Slash required in Empty Tags.

What is XSLT and its usage?
XSL Transformations. Used to transform XML document to any other text format such as HTML, text, XML etc.


Comments

Popular posts from this blog

Top Open Source Web-Based Project Management Software

This is an user contributed article. Project management software is not just for managing software based project. It can be used for variety of other tasks too. The web-based software must provide tools for planning, organizing and managing resources to achieve project goals and objectives. A web-based project management software can be accessed through an intranet or WAN / LAN using a web browser. You don't have to install any other software on the system. The software can be easy of use with access control features (multi-user). I use project management software for all of our projects (for e.g. building a new cluster farm) for issue / bug-tracking, calender, gantt charts, email notification and much more. Obviously I'm not the only user, the following open source software is used by some of the biggest research organizations and companies world wild. For example, NASA's Jet Propulsion Laboratory uses track software or open source project such as lighttpd / phpbb use re...

Google products for your Nokia phone

Stay connected with Gmail, Search, Maps and other Google products. Check products are available for your Nokia phone Featured Free Products Search - Find the information you need quickly and easily Maps - Locate nearby businesses and get driving directions Gmail - Stay connected with Gmail on the go YouTube - Watch videos from anywhere Sync - Synchronize your contacts with Google

DotNetNuke Overview

DotNetNuke is the leading Web Content Management Platform for Microsoft .NET. DotNetNuke can be used as a web content management system (CMS) for simple websites or as a powerful application development framework which enables businesses to quickly build and deploy feature-rich, interactive websites and applications in Microsoft .NET. An intuitive, menu-driven interface allows non-technical users to easily create new sites or extend the functionality and features of their existing web site when used as a web CMS. An open API and the availability of over 6,000 third-party add-on modules available through Snowcovered.com allow web development professionals to create complex web sites for demanding applications. Installing new modules or skins is quick and easy, allowing users to deploy new functionality on their web sites in just minutes. DotNetNuke is the world’s most widely adopted framework for building web solutions on Microsoft Windows Server. DotNetNuke powers o...