ADO.NET
Question:-How ADO.NET come into existence?
Answer: DAO (data access model) is the first Data Access Model that is created for local databases which contains built-in Jet engine which overcome with some problem like performance and functionality issues. After this RDO (Remote Data Object) and
| Question: What is Asynchronous Database Commands? |
Optimistic:-In this if two user works on the same data and one change that data first then second user cannot change that same data becasue the which he have using is allready changed so he cannot do the change becasue change apply to another data that is changed by first user.
Question: How to get result from two table in Sql DataReader ?
Answer: string str="Select * from table1;Select * from table2"; cmd.commandtext=str; dr=cmd.executereader();
Question: What is Ref Cursor in .NET and how it is link with ExecuteReader ?
Answer: Ref cursor play its role when doing with the oracle database these comes in ODP.NET. Ref Cursors are objects that link to Oracle server-side cursors.These Ref Cursor can be converted in oracle datareader with this Ref cursor we can get result with query written to pl/sql and the result can be get in .net.Now the question arise why we use Ref Cursor when we have an option of ExceuteReader reson is simple when we need more query in pl/sql means our work is done in pl/sql then we need this ref cursor for getting result set because doennot have direct connection to that table.Becasue advantage of pl/sql we can take two opertion in one query.
Question: Define tool Manage Statistics in SQL Serevr 2000 query ?
Answer: SQL Server creates internal statistics on the rows in all of our tables that is used by the Query Optimizer to select the optimal execution plan for our query. And Query Optimizer helps in doing this.Soome time when statistics isnot maintains then this is done by tool Manage Statistics.We can add,edit or delete for statistics that is maintained by SQL Server.We can experiment with different sets of statistics and see how it affects the query otimizer execution plans.
Question: Some important instruction regarding ADO.NET connection string ?
Answer: When we are making connection string always use Server's IP address not the DNS name if we use IP address it will reduce the time taken for connection to establish.Becasue server IP address is used to get a default or named instance of Sql Server that ls running. if we are running the cluster we have to use the Virtual SQL Server IP address.
Question: How to get database schema information when connection object is establish in ADO.NET ?
Answer: There is a method that helps in getting schema information that is GetSchema() and this method is called in three different ways first way when we call this method without any parameter its return the metadata(table, view, stored procedure.indexes etc).When method is called by passing metadata collection name and filter criteria returns the items from the collection after applying the filter criteria and last way is when we called by passing a metadata collection name returns information about items found in the specified collection.
Question: Which one is better WebServices and Remoting?
Answer: Both of these have little difference WebServices help full where the user who is using Web Service does not have the .NET platform. On the otherside for remoting we need .Net platform on the both side so from both of this remoting is faster then webservice.So keep in mind which of these are you using if you have .net plateform or other.
Question:-What is DataGrid wheater its a Server Control or something else ?
Answer:DataGrid is Web server control a powerful tool for displaying information from a data source. we can display editable data in a professional-looking grid by setting only a few properties. The grid has a sophisticated object model that provides you with great flexibility in how you display the data.
Question:-Define different execute methods of ADO.NET command object ?
Answer: ExecuteScalar:- This method returns a single value from the first row and first column of the result get from the execution of SQL query.
ExecuteNonQuery:- This method executes the DML SQL query just like insert, delete or update and then returns the number of rows affected by the action.
ExecuteReader:- This method returns DataReader object which is a forward-only resultset.
ExecuteXMLReader:- This method is available for SQL Server 2000 or later. Upon execution it builds XMLReader object from standard SQL query.
Question:-What DataReader class do in ADO.NET?
Answer: To get read-only and forward only access to data we use DataReader .the DataReader object reduces the system overhead because one row at a time is taken into memory so it is quite lightweight. To get second object connection is reconnected. We can create a DataReader object by execute Execute readre() method. There are two Data Reader class one is SqlDataReader and other is OleDbDataReader.
Question:-Why is ADO.NET serialization slower than
Answer:
Question:-Is XML is a component of ADO.NET ?
Answer: The answer of this question is always Yes because XML is an important component of ADO.NET architecture .ADO.NET use XML to store and transfer data.We not have to convert data to XML format.Datasets helps XML to integrate with ADO.NET. XML schema plays a role to get table definition,column,datatypes and constraints helps DataSet.
Question:- How to check if the Dataset has records ?
Answer:
if (ds.Tables(0).Rows.Count= 0 )
{
'No record
else
'record found
}
Question:- What is the significance of CommandBehavior.CloseConnection ?
Answer: To avoid having to explicitly close the connection associated with the command used to create either a SqlDataReader or and OleDbDataReader, pass the CommandBehavior.CloseConnection argument to the ExecuteReader method of the Connection.
dr= cmd.ExecuteReader(CommandBehavior.CloseConnection);
The associated connection will be closed automatically when the Close method of the Datareader is called. This makes it all the more important to always remember to call Close on your datareaders.
Question:-Which method do you invoke on the DataAdapter control to load your generated dataset with data?
Answer: The Fill() method.
Question:-What is Dataset and Diffgram?
Answer: When sending and retrieving a Dataset from an XML Web service, the DiffGram format is implicitly used. Additionally, when loading the contents of a DataSet from XML using the ReadXml method, or when writing the contents of a DataSet in XML using the WriteXml method, you can select that the contents be read or written as a DiffGram. For more information, see Loading a DataSet from XML and Writing a DataSet as XML Data. While the DiffGram format is primarily used by the .NET Framework as a serialization format for the contents of a DataSet, you can also use DiffGrams to modify data in tables in a Microsoft SQL Server™ 2000 database.
Question:-What is typed dataset?
Answer: A typed dataset is very much similar to a normal dataset. But the only difference is that the sehema is already present for the same. Hence any mismatch in the column will generate compile time errors rather than runtime error as in the case of normal dataset. Also accessing the column value is much easier than the normal dataset as the column definition will be available in the schema.
Question:-How can you provide an alternating color scheme in a Repeater control?
Answer: AlternatingItemTemplate Like the ItemTemplate element, but rendered for every other row (alternating items) in the Repeater control. You can specify a different appearance for the AlternatingItemTemplate element by setting its style properties.
Question:-What are good ADO.NET object(s) to replace the
Answer: There are alot...but the base once are SqlConnection, OleDbConnection, etc...
Question:-Can you explain the difference between an ADO.NET Dataset and an
Answer:Valid answers are:
- A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
- A DataSet is designed to work without any continuing connection to the original data source.
- Data in a DataSet is bulk-loaded, rather than being loaded on demand.
- There's no concept of cursor types in a DataSet.
- DataSets have no current record pointer You can use For Each loops to move through the data.
- You can store many edits in a DataSet, and write them to the original data source in a single operation.
- Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
Question:-What are the differences between Datalist DataGrid and datarepeater ?
Answer:DataList
- Has table appearence by default
- Has no autoformat option
- has no default paging & sorting options
- can define separators between elements using template
DataGrid - Has a grid appearence by default
- has a autoformat option
- has default paging and sorting
- has no separator between elements
DataRepeater - simple,read-only output, has no built in support for selecting or editing items, has no DEFAULT APPEARENCE, has no default paging.
0 comments:
Post a Comment
plzz give the comment