You are on page 1of 6

Ques1. Which keyword is used to accept variable number of parameters? Ans.

Params keyword is used to accept variable number of parameters. Ques2..Is it possible to load multiple tables in a Dataset? Ans.Yes, it is possible to load multiple tables in a single dataset.29. Which provider is used to connect MS Access, Oracle, etc.? OLEDB Provider and ODBC Provider are used to connect to MS Access and Oracle. Oracle Data Provider is also used to connect exclusively for oracle database. Ques3. Difference between OLEDB Provider and SqlClient? Ans.With respect to usage, there is no difference between OLEDB Provider and SqlClient. The difference lies in their performance. SqlClient is explicitly used to connect your application to SQL server directly, OLEDB Provider is generic for various databases, such as Oracle and Access including SQL Server. Ques4. ADO.NET Ans.ADO.NET is a very important feature of .NET Framework, which is used to work with data that is stored in structured data sources, such as databases and XML files. The following are some of the important features of ADO.NET:Contains a number of classes that provide you with various methods and attributes to manage the communication between your application and data source.Enables you to access different data sources, such as Microsoft SQL Server, and XML, as per your requirements. Ques5. fundamental objects in ADO.NET ? Ans.Datareader and Dataset Ques6. Can you give a overview of ADO.NET architecture ? Ans.The most important section in ADO.NET architecture is Data Provider . Data Provider provides access to data source (SQL SERVER, ACCESS, ORACLE). Connection. Command object(This is the responsible object to use stored procedures) Data Adapter(This object acts as a bridge between datastore and dataset). Datareader(This object reads data from data store in forward only mode). Ques7. How can you clear a Data from all the table in the dataset? Ans.using Dataset.Clear() method you can clear all the data from DataSet Ques8. what is mean by Dataset? Ans.It is an in-Memory cache of data retrieved from Data Source. Ques9. What is the difference between Execute Reader, Execute Scalar and Execute Non Query methods? Ans.Execute Reader Execute Reader will be used to return the set of rows, on execution of SQL Query or Stored procedure using command object. Execute Scalar Execute Scalar will be used to return the single value, on execution of SQL Query or Stored procedure using command object. Execute Non Query If the command or stored procedure performs INSERT, DELETE or UPDATE operations, then we use Execute Non Query method. Execute Non Query method returns an integer specifying the number of rows inserted, deleted or updated. Ques10. What are the different steps to access a database through ADO.NET? Ans.Create a connection to the database using a connection object. Open the Database Connection. Invoke a command to create a Dataset object using an adapter object. Use the Dataset object in code to display data or to change items in the database. Invoke a command to update the database from the Dataset object using an adapter object. Close the database connection.

Ques11. What are the Benefits of ADO.Net? Ans.ADO.Net offers following Benefits Interoperability: XML Format is one of the best formats for Interoperability.ADO.NET supports to transmit the data using XML format. Scalability: ADO.NET works on Dataset that can represent a whole database or even a data table as a disconnected object and thereby eliminates the problem of the constraints of number of databases being connected. In this way scalability is achieved. Performance: The performance in ADO.NET is higher in comparison to ADO that uses COM marshalling. Programmability: ADO.Net Data components in Visual studio help to do easy program to connect to the database. Ques12. What is Microsoft ADO.NET? Ans.ADO.NET is one of the component in the Microsoft.NET framework which contains following features to Windows, web and distributed applications. i. Data Access to the applications from Database in connected (Data reader object) and disconnected (Data set and data table) model. ii. Modify the data in database from application. Ques13. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? Ans.SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it's a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines. Ques14. Difference between Association rule mining and frequent itemset mining Ans.An association rule is something like "A,B ? C", meaning that C tends to occur when A and B occur. An itemset is just a collection such as "A,B,C", and it is frequent if its items tend to co-occur. The usual way to look for association rules is to find all frequent itemsets and then postprocess them into rules Ques15. Named out assemblies and corresponding namespace of all .Net framework data provider. Ans.a) .Net Framework Data Provider for SQL Server Assembly Name :- System.Data.dll NameSpace :- System.Data.SqlClient b) .Net Framework Data Provider for OLE DB Server Assembly Name :- System.Data.dll NameSpace :- System.Data.OleDb C) .Net Framework Data Provider for ODBC Assembly Name :- System.Data.ODBC D) .Net Framework Data Provider for Oracle Assembly Name :- System.Data.OracleClient.dll NameSpace :- System.Data.OracleClient Ques16. What are different .Net framework data provider. Ans.The Four main types of .net framework data provider are a) .Net framework data provider for SQL server.

b) .Net framework data provider for OLEDB c) .Net framework data provider for ODBC d) .Net framework data provider for Oracle. Ques17. List out Some feature of ADO.net Ans.The Key feature of ADO.Net are a) Disconnected Data Architecture b) Data cached in datasets c) Scalability d) Data transfer in XML format. Ques18. What is Difference between SqlCommand and SqlCommandBuilder Ans.SQLCommand is used to execute all kind of SQL queries like DML(Insert, update,Delete) & DDL like(Create table, drop table etc) where as SQLCommandBuilder object is used to build & execute SQL (DML) queries like select, insert, update & delete. Ques19. What is the Use of Connection Object ? Ans.In order to interact with any database we need a Connection . This connection enables us to know the Server Name, User-Id,Password,Database Name. These are the main requirements to connect to a Database. So in our Connection string we provide all those above mentioned properties as parameters. Different Connection objects : SqlConnection, OleDbConnection, OdbcConnection . OleDbConnection object is used with an OLE-Db Provider OleDbConnection cnn ; connetionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=DatabaseName;"; cnn = new OleDbConnection(connetionString); . SqlConnection object used the Tabular Data Services (TDS) With MS Sql Server. SqlConnection con; con = new SqlConnection("server=SERVER NAME;user id=ID;password=PASSWORD;database=DB NAME"); SqlCommand cmd; cmd = new SqlCommand("DB Query Here",con); . Using the OdbcConnection , we will create an OdbcCommand. From that command we can issue a Query and create an OdbcDataReader. OdbcConnection DbConnection = new OdbcConnection("Connection String"); OdbcCommand DbCommand = DbConnection.CreateCommand(); DbCommand.CommandText = "Db Query Here"; OdbcDataReader DbReader = DbCommand.ExecuteReader(); Ques20. What is the use of dataview? Ans.Data view is used to sort and find data in a data table. Ques21. What is the use of data adapter? Ans.These objects connect one or more Command objects to a Dataset object. They provide logic that would get data from the data store and populates the tables in the Dataset, or pushes the changes in the Dataset back into the data store. . An OleDbDataAdapter object is used with an OLE-DB provider . A SqlDataAdapter object uses Tabular Data Services with MS SQL Server. Ques22. What are the two fundamental objects in ADO.NET? Ans.Data reader and Dataset are the two fundamental objects in ADO.NET. Ques23. What are the benefits of ADO.NET? Ans.BENEFITS OF ADO.NET

1>Scalability:ADO.NET works on DataSet that can represent a whole database or even a data table as a disconnected object and thereby eliminates the problem of the constraints of number of databases being connected. In this way scalability is achieved. 2>Data Source Independence:In ADO.NET DataSet is completely independent of data source and no way DataSet is controlled by the data source as it happens in case of RecordSet. 3>Interoperability:As ADO.NET transmits the data using the format of XML which is not dependent on ADO.NET or windows platform. 4>Strongly Typed Fields:It supports strongly typed fields by using CTS. 5>Performance:The performance in ADO.NET is higher in comparison to ADO that uses COM marshalling. 6>Firewall: As in ADO.NET transmission is via XML format, therefore it can pass through firewalls. Ques24. What is GetSchemaTable() in ADO.NET Ans.The GetSchemaTable method returns a DataTable property that contains the column schema for a DataReader. The DataTable contains one row for each field in the resultset. Each column maps to a property of the field in the resultset. The ColumnName property of the DataTable column is the name of the field's property, such as the ColumnName, DataType, ColumnSize, IsKeyColumn, or IsAutoIncrement property. The value of the DataTable column is the value of the field's property, such as the FirstName value for the ColumnName property. Ques25. ado VS ado.Net Ans.*)ado is connected mode always where as ado.net is connected as well as disconnected. *)ado ---recordset whereas ado.net ---dataset *)ado---c,c++whereas ado.net---- .net framework *)ado--server based whereas ado.net client Ques26. What is Dataset? Ans.A DataSet is Disconnected Architecture,means their is no need to always open & close connection.it is cache of data retrieved from database.it is made up of collection of datatable.Dataset can be Typed & UnTyped usually,datasets are typed in Visual basic.A typed dataset is dataset which derived from dataset class & uses information in XML schema file(XSD file).An untyped dataset has no built in schema.it can contain tables,column & rows.but those are exposed only as collections Ques27. What is the default TimeOut for a SqlCommand.CommandTimeout property? Ans.The default timeOut is 30 seconds. If you want to increase the TimeOut see the below example code For example:-

SqlCommand cmd = new SqlCommand("select * from tablename", conn); cmd.CommandTimeout = 50; SqlDataReader dr = cmd.ExecuteReader(); Ques28. What is a DataSet? Ans.The Dataset is the central object in ADO.NET. DataSet is a nogical container of data. It represents a set of data tables referenced as one unit in the application. With this object you can get all the data you need from each table quickly, examine and change it while you are disconnected from the server and then update the server with changes in an efficient operation. Ques29. How to fill DataSet with data? Ans.To fill DataSet with data we have to use Fill() method of DataAdapter object. Fill() has several overloads. But the simple one is [CODE]Fill(DataSet, DataTable)[/CODE] The first parameter will take the name of the dataset to be filled and the second parameter specifies the name of the DataTable in the DataSet which will contain the data. Ques30. what is difference Between datareader and dataset ? Ans.DataReader =========== DataReader is like a forward only recordset. It fetches one row at a time so very less network cost compare to DataSet(Fethces all the rows at a time). DataReader is readonly so we can't do any transaction on them. DataReader will be the best choice where we need to show the data to the user which requires no transaction. As DataReader is forward only so we can't fetch data randomly. .NET Data Providers optimizes the datareader to handle huge amount of data. Dataset ======= DataSet is an in memory representation of a collection of Database objects including tables of a relational database schemas. DataSet is always a bulky object that requires a lot of memory space compare to DataReader. We can say that the DataSet is a small database because it stores the schema and data in the application memory area. DataSet fetches all data from the datasource at a time to its memory area. So we can traverse through the object to get the required data like querying database. Ques31. What are the differences between ADO and ADO.NET? Ans.ADO relied on a connection based model. In the connected approach, the client had to be connected with the server and remain connected till the whole procedure or transaction was completed. Time resources and bandwidth became major constraints on such architecture. To solve this problem the latter version of ADO used RecordSet. All the contents from the data source were copied into RecordSet. This allows clients to get disconnected from the server, work on the RecordSet and copy the changes back to the data source again. This approach did not succeed much because it requires COM marshalling to transmit disconnected data, it support only those datatypes that were defined by the COM standards and hence required type conversion.

ADO.NET can be used to access data sources using new .NET data providers as well as existing OLEDB data providers using the OLEDB.NET data provider. Ques32. What are the components of .NET DataProvider? Ans.The .NET DataProvider is a set of components that includes the Connection, Command, DataReader and DataAdapter objects. It is used for connecting to a database , executing commands and retrieving results. Using the .NET data provider we can either access database directly or use the disconnected approach. For the disconnected approach we use DataSet class. Connection Object:-It is used to connect to the data source. Data source can be any database file. The connection object contains information like the provider name, server name, datasource name, user name and password. Command Object:- It is used for connect the connection object to a DataReader or DataAdapter object. The command object allow us to execute SQL statement or a stored procedure in a data source. DataReader Object:- It is used to read the data in a fast and efficient manner from the database. It is generally used to extract one or a few records or specific field values or to execute simple SQL statement. DataAdapter Object:- It is used to fill data from the database into the DataSet object. it is use din the disconnected approach. Ques33. Which method do you invoke on the DataAdapter control to load your generated dataset with data? Ans.System.Data.Common.DataAdapter.Fill(System.Data.DataSet); Ques34. What is the use of DataSet? Ans.DataSet acts as a virtual table. The value is retrieved from the database and stores in the DataSet. Then we can pass the data to the DataGrid through DataSet. Ques35. What is Dataview in ADO Dot Net ? Ans.The DataView provides different views of the data stored in a DataTable. That is we can customize the views of data from a DataTable. DataView can be used to sort, filter, and search the data in a DataTable , additionally we can add new rows and modify the content in a DataTable. We can create DataView in two ways. Either we can use the DataView constructor, or we can create a reference to the DefaultView property of the DataTable. DataView dView = new DataView(dTbl); dView = dataSet.Tables(0).DefaultView; Ques36. Name the classes are found in System.Data.Common NameSpace? Ans.1)DataColumnMapping 2)DataTableMapping Ques37. Name the classes that are contained in System.Data NameSpace? Ans.DataSet DataTable DataColumn DataRow DataRealation Constraint

You might also like