Ado.net Multiple choice questions and answer
Jun 24, 2021
Ado.net,
ado.net mcqs,
mcqs,
ADO.NET multiple choice question and answers,
196266 Views
In this article, we will go through the Ado.net multiple choice question and answers. It will help us brush up our knowledge about Ado.net .
Are you preparing for the next job interviews in Microsoft ASP.NET MVC? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:
List of Programming Full Forms
ADO.NET MCQs (Multiple choice questions and answer)
1) To perform asynchronous data access, what must be added to the connection string?
- BeginExecute=true
- MultiThreaded=true
- MultipleActiveResultSets=true
- Asynchronous=true
Answer : 4
2) Can you use a DataView to filter rows in a DataTable
- Yes, by setting the Filter property of the DataView
- Yes, by setting the RowFilter property of the DataView
- Yes, by using the SetFilter(. method of the DataView
- No, a DataView cannot be used to filter rows in a DataTable
Answer: 2
3) Which is a property of the DataGrid control?
- DataMember
- DataSource
- DataQuery
- All of the above.
Answer: 4
4) In a connection string _____________ represents name of the database
- Data Source
- Initial Catalog
- Catalog Initial
- Database
Answer: 2
5) What are the Command Object Methods?
- ExecuteNonQuery
- ExecuteReader
- ExecuteScalar
- All of the above.
Answer: 4
6) When you create a relationship between tables in ADO.NET DataSet
- A UniqueConstraint is added to the parent table
- A ForeignKeyConstraint is added to the child table by default
- Both a and b
- None
Answer : 3
7) The first record in a dataset has a position property of:
- zero
- one
- any value defined by the programmer
- All of the above
Answer: 1
8) Which ado.net class provide a disconnected environment?
- DataReader
- DataSet
- Command
- None of the above.
Answer: 2
9) What information is specified in the Connection tab of the DataLink window?
- Database login
- Database name
- Database type
- All of the above.
Answer: 4
10) Which of the following is true for ADO.NET DataSet?
- DataSet provides a disconnected view of a data source.
- Dataset enables to store data from multiple tables and multiple sources
- We can create a relationship between the tables in a DataSet.
- All of the above is true
Answer: 4
11) Which file you should write for the connection string so that you can access it in all the web pages for the same application?
- In App_Data folder
- In Web.config file
- In MasterPage file
- None of the above
Answer: 2
12) Which of the following is not a DataReader method?
- NextResult
- GetName
- GetValue
- GetDataType
Answer: 4
13) Which database is the ADO.NET SqlConnection object designed for?
- Access
- Microsoft SQL Server
- MySQL
- Oracle
Answer: 2
14) The data is stored in a Microsoft SQL Server database on a server named Admin and the Database name is Diploma. You connect to Diploma by using Windows authentication mode. You use a SqlConnection object to connect to the database. Then which is the correct connection string from below?
- Data Source=Admin\SQLEXPRESS;Initial Catalog=Diploma;Integrated Security=True
- Data Source=Admin/SQLEXPRESS;Initial Catalog=Diploma;Integrated Security=True
- Data Source=Admin\SQLEXPRESS;Initial Catalog=Diploma;Integrated Security=False
- All of the Above
Answer: 1
15) Choose the correct option about the Integrated Security property of the connection object.
- If Integrated Security=false then User ID and Password must be specified in the connection string.
- If Integrated Security=true, then current Windows account credentials are used for authentication.
- Both A and B option are correct.
- None of the above.
Answer : 3
16) The first step of configuring a DataAdapter is to select:
- An adapter object.
- A connection object.
- A database object.
- A dataset object.
Answer: 2
17) To check the status of the connection, ____ property is useful
- ConnectionStatus
- Status
- State
- ConnectionState
Answer: 3
18) Which is not an ADO.NET DataAdapter Object?
- OleDbDataAdapter
- SQLDataAdapter
- QueryDataAdapter
- All of the above.
Answer: 3
19) Which type of object has the Generate Dataset method?
- Adapter object
- Connection object
- Database object
- Dataset object
Answer: 1
20) Which of the following illustrates the benefit of ADO.NET?
- Interoperability
- It uses DataSet to represent data in memory that can store data from multiple tables and multiple sources.
- Disconnected data access
- All of above
Answer: 4
21) Which object does the data-aware control bind to?
- Dataset
- DataAdapter
- Connection
- All of the above.
Answer: 1
22) Which object contains the Position property of the current record in a dataset?
- BindingContext
- BindingData
- DataBinding
- DataBound
Answer: 1
23) Which below is specified by the DataSource Property?
- Connection object
- DataAdapter object
- Database field
- Dataset object
Answer : 3
24) Which of the following method of the command object is best suited when you have aggregate functions in a SELECT statement?
- ExecuteScalar
- ExecuteReader
- ExecuteNonQuery
- None
Answer: 1
25) What data type is returned when calling the ExecuteScalar method of a command object?
- System.Int32
- Object
- No of affected records.
- None of the above.
Answer: 2
26)To perform Insert, Update and Delete Command which method is used?
- ExecuteScalar
- ExecuteReader
- ExecuteNonQuery
- None
Answer: 3
27) Which DataAdapter Query Type can be used with the Access database?
- Use SQL statements.
- Create a new stored procedure.
- Use existing stored procedure.
- All of the above.
Answer: 1
28) What is the proper code to put data into the dataset called EmployDataset using the EmployDataAdapter object?
- EmployDataset.Fill(EmployDataAdapter)
- EmployDataAdapter.Fill(EmployDataset)
- EmployDataset.Load(EmployDataAdapter)
- EmployDataAdapter.Load(EmployDataset)
Answer: 2
29) Which of the following is the method provided by the DataSet object to generate XML?
- ReadXML
- WriteXML
- 3.GetXML
- All of the above
Answer: 4
30) The default timeout for SqlCommand.Command timeout property
- 10 Seconds
- 20 Seconds
- 30 Seconds
- 40 Seconds
Answer : 3
More Interview Questions and Answers:
- Top 15 Python Interview Questions
- React Interview Question
- C# Interview Questions and Answers
- Top 10 IoT Interview Questions
- DotNet Core Interview Questions and Answers
- Angular Interview Questions with Answers
- Interview questions for Asp.Net and .Net
- OOPs Interview Questions and Answers
- Blazor Interview Questions and Answer
- Top 10 Interview Questions and Answered for Web Developer of 2020
- OOPs Interview Questions and Answers in C#
- GoogleCloud Interview Questions
- Asp.net MVC Interview Questions and Answers
- Interview Questions and Answers On Selenium Webdriver