Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 201–225 of 4608

Career & HR topics

By tech stack

Popular tracks

Mid PDF
Explain the process of binding a DataTable to a GridView in ASP.NET.

Short answer: To bind a DataTable to a GridView in ASP.NET: Real-world example (ShopNest) For large order exports, ShopNest uses SqlDataReader (forward-only, fast). DataSet is heavier and mainly for disconnected editing…

ADO.NET Read answer
Mid PDF
How do you handle exceptions in ADO.NET?

Short answer: ADO.NET exceptions are typically handled using try-catch blocks. This helps to capture any errors during database operations such as connection failures, query issues, or command execution errors. Example:…

ADO.NET Read answer
Junior PDF
What is the role of the SqlConnection object in ADO.NET?

Short answer: The SqlConnection object is responsible for opening a connection to a SQL Server database. It represents the physical connection to the data source and must be open before executing commands (like SqlComman…

ADO.NET Read answer
Junior PDF
What is the difference between a strongly typed and a loosely typed DataSet?

Short answer: Strongly Typed DataSet: A DataSet that is generated from an XSD (XML Schema Definition) file, which defines the structure of the data (tables, columns, relationships). Explain a bit more It provides type sa…

ADO.NET Read answer
Junior PDF
What is a transaction in ADO.NET, and how do you manage it?

Short answer: A transaction in ADO.NET is a sequence of database operations that are executed as a single unit. If one operation fails, all previous operations are rolled back. You can manage transactions using the SqlTr…

ADO.NET Read answer
Mid PDF
How do you implement multiple transactions in ADO.NET?

Short answer: You can execute multiple transactions sequentially by managing multiple SqlTransaction objects. Each transaction can either be committed or rolled back based on the success or failure of the operations. Exa…

ADO.NET Read answer
Mid PDF
What are the different types of Command objects in ADO.NET?

Short answer: In ADO.NET, the Command object is used to execute SQL queries or stored procedures. The main types of Command objects are: Real-world example (ShopNest) Always pass order ids with parameters: cmd.Parameters…

ADO.NET Read answer
Mid PDF
How do you perform asynchronous database operations in

Short answer: ADO.NET? ADO.NET supports asynchronous database operations using the async and await keywords in C#. This allows the application to remain responsive while waiting for the database operation to complete. Ex…

ADO.NET Read answer
Mid PDF
How do you perform asynchronous database operations in ADO.NET?

Short answer: ADO.NET supports asynchronous database operations using the async and await keywords in C#. Explain a bit more This allows the application to remain responsive while waiting for the database operation to co…

ADO.NET Read answer
Mid PDF
Explain the concept of stored procedures and how they are used in

Short answer: ADO.NET. A stored procedure is a precompiled set of SQL statements that are stored and executed on the database server. They can improve performance and security by encapsulating complex operations. In ADO.…

ADO.NET Read answer
Junior PDF
What is the significance of parameters in SQL commands, and how do you handle them in ADO.NET?

Short answer: way to safely and securely inject data into queries, reducing the risk of SQL injection ttacks. Explain a bit more In ADO.NET, you handle parameters using the Parameters collection of a SqlCommand object. w…

ADO.NET Read answer
Junior PDF
What is the significance of parameters in SQL commands, and how do you handle them in ADO.NET?

Short answer: Parameters are used to pass values to SQL commands or stored procedures. They provide a way to safely and securely inject data into queries, reducing the risk of SQL injection attacks. In ADO.NET, you handl…

ADO.NET Read answer
Mid PDF
How can you prevent SQL injection attacks using ADO.NET?

Short answer: SQL injection attacks can be prevented by: Real-world example (ShopNest) Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId) . Never concatenate user input into SQL. Say this…

ADO.NET Read answer
Junior PDF
What is the difference between a forward-only cursor and a static cursor in ADO.NET?

Short answer: snapshot of the data and remains unchanged even if the data in the database changes during the operation. It is slower and consumes more memory compared to forward-only cursor. Real-world example (ShopNest)…

ADO.NET Read answer
Junior PDF
What is the difference between a forward-only cursor and a static cursor in ADO.NET?

Short answer: Forward-only cursor: A cursor that allows you to read rows sequentially in a forward direction only. Explain a bit more It is fast and lightweight, but you cannot go back to previous rows. Static cursor: A…

ADO.NET Read answer
Junior PDF
What is an ADO.NET DataProvider?

Short answer: An ADO.NET DataProvider is a set of classes used to interact with different types of data sources (such as SQL Server, Oracle, etc.). It provides methods for opening connections, executing commands, and ret…

ADO.NET Read answer
Junior PDF
What is the role of the SqlParameter class in ADO.NET?

Short answer: llows you to define the name, data type, size, and value of a parameter. Explain a bit more SqlParameter is used to protect against SQL injection and to pass data to SQL queries safely. llows you to define…

ADO.NET Read answer
Junior PDF
What is the role of the SqlParameter class in ADO.NET?

Short answer: The SqlParameter class represents a parameter to a SQL command or stored procedure. It allows you to define the name, data type, size, and value of a parameter. SqlParameter is used to protect against SQL i…

ADO.NET Read answer
Mid PDF
Explain the different isolation levels in ADO.NET transactions.

Short answer: Isolation levels define the level of visibility one transaction has into the changes made by other concurrent transactions. The four isolation levels in ADO.NET are: Real-world example (ShopNest) Placing an…

ADO.NET Read answer
Mid PDF
How do you use batch processing in ADO.NET?

Short answer: Batch processing allows you to execute multiple SQL commands in a single round trip to the database, which can improve performance when you have a large number of operations to perform. You can use the SqlC…

ADO.NET Read answer
Senior PDF
What is the role of the TransactionScope class in ADO.NET?

Short answer: cross multiple data sources (e.g., SQL Server and other databases). Explain a bit more It simplifies transaction management by automatically handling the commit and rollback of transactions cross multiple r…

ADO.NET Read answer
Junior PDF
What is the role of the TransactionScope class in ADO.NET?

Short answer: The TransactionScope class in ADO.NET is used to handle distributed transactions across multiple data sources (e.g., SQL Server and other databases). It simplifies transaction management by automatically ha…

ADO.NET Read answer
Junior PDF
What is the significance of the UpdateCommand property in DataAdapter?

Short answer: dapter.UpdateCommand = new SqlCommand("UPDATE Customers SET Name = @Name WHERE CustomerID = @CustomerID", connection); dapter.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 10…

ADO.NET Read answer
Junior PDF
What is the significance of the UpdateCommand property in DataAdapter?

Short answer: The UpdateCommand property of the DataAdapter specifies the SQL command used to update the database when changes are made to the data in the DataSet. The Update() method of the DataAdapter uses the UpdateCo…

ADO.NET Read answer
Mid PDF
Explain the differences between optimistic and pessimistic

Short answer: concurrency in ADO.NET. Optimistic Concurrency: Assumes that data conflicts are rare. It allows multiple users to read and modify the data without locking the record. However, when updating, it checks if th…

ADO.NET Read answer

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: To bind a DataTable to a GridView in ASP.NET:

Real-world example (ShopNest)

For large order exports, ShopNest uses SqlDataReader (forward-only, fast). DataSet is heavier and mainly for disconnected editing scenarios.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: ADO.NET exceptions are typically handled using try-catch blocks. This helps to capture any errors during database operations such as connection failures, query issues, or command execution errors. Example: try { SqlConnection connection = new SqlConnection(connectionString); connection.Open(); SqlCommand command = new SqlCommand("SELECT * FROM Customers", connection); SqlDataReader reader = command.ExecuteReader();

Example code

} catch (SqlException ex) { Console.WriteLine("Database error: " + ex.Message); } catch (Exception ex) { Console.WriteLine("General error: " + ex.Message); }

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: The SqlConnection object is responsible for opening a connection to a SQL Server database. It represents the physical connection to the data source and must be open before executing commands (like SqlCommand) or reading data (using SqlDataReader or SqlDataAdapter).

Example code

SqlConnection connection = new SqlConnection(connectionString); connection.Open(); // Execute database commands connection.Close();

Real-world example (ShopNest)

ShopNest opens a SqlConnection only for the query, then disposes it (using). Connection pooling reuses physical connections automatically.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: Strongly Typed DataSet: A DataSet that is generated from an XSD (XML Schema Definition) file, which defines the structure of the data (tables, columns, relationships).

Explain a bit more

It provides type safety and compile-time checking. Loosely Typed DataSet: A DataSet that does not have predefined schemas, meaning you access tables and columns by name at runtime. This offers flexibility but no compile-time checking. Example: Strongly Typed: You get intellisense and type safety when accessing columns. Loosely Typed: You need to access tables and columns by name as strings, without intellisense.

Real-world example (ShopNest)

For large order exports, ShopNest uses SqlDataReader (forward-only, fast). DataSet is heavier and mainly for disconnected editing scenarios.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: A transaction in ADO.NET is a sequence of database operations that are executed as a single unit. If one operation fails, all previous operations are rolled back. You can manage transactions using the SqlTransaction object. Steps:

Real-world example (ShopNest)

Placing an order updates stock and inserts the order row in one SqlTransaction—either both succeed or both roll back.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: You can execute multiple transactions sequentially by managing multiple SqlTransaction objects. Each transaction can either be committed or rolled back based on the success or failure of the operations.

Example code

SqlConnection connection = new SqlConnection(connectionString); connection.Open(); SqlTransaction transaction1 = connection.BeginTransaction(); SqlTransaction transaction2 = connection.BeginTransaction(); try { // First transaction SqlCommand command1 = new SqlCommand("UPDATE Customers SET Balance = Balance - 100", connection, transaction1); command1.ExecuteNonQuery(); transaction1.Commit(); // Advanced ADO.NET Questions

Real-world example (ShopNest)

Placing an order updates stock and inserts the order row in one SqlTransaction—either both succeed or both roll back.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: In ADO.NET, the Command object is used to execute SQL queries or stored procedures. The main types of Command objects are:

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: ADO.NET? ADO.NET supports asynchronous database operations using the async and await keywords in C#. This allows the application to remain responsive while waiting for the database operation to complete. ExecuteNonQueryAsync: Executes a SQL command asynchronously. ExecuteReaderAsync: Executes a query and returns a SqlDataReader synchronously.………… ExecuteScalarAsync: Executes a query and returns a single value…

Explain a bit more

asynchronously. public async Task GetDataAsync() { SqlConnection connection = new SqlConnection(connectionString); wait connection.OpenAsync(); SqlCommand command = new SqlCommand("SELECT * FROM Customers", connection); SqlDataReader reader = await command.ExecuteReaderAsync(); while (await reader.ReadAsync()) { Console.WriteLine(reader["CustomerName"].ToString()); } reader.Close(); } ADO.NET? ADO.NET supports asynchronous database operations using the async and await keywords in C#. This allows the application to remain responsive while waiting for the database operation to complete. ExecuteNonQueryAsync: Executes a SQL command asynchronously. ExecuteReaderAsync: Executes a query and returns a SqlDataReader synchronously.…… ExecuteScalarAsync: Executes a query and returns a single value asynchronously.

Example code

public async Task GetDataAsync() { SqlConnection connection = new SqlConnection(connectionString); wait connection.OpenAsync(); SqlCommand command = new SqlCommand("SELECT * FROM Customers", connection); SqlDataReader reader = await command.ExecuteReaderAsync(); while (await reader.ReadAsync()) { Console.WriteLine(reader["CustomerName"].ToString()); } reader.Close(); }

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: ADO.NET supports asynchronous database operations using the async and await keywords in C#.

Explain a bit more

This allows the application to remain responsive while waiting for the database operation to complete. ExecuteNonQueryAsync: Executes a SQL command asynchronously. ExecuteReaderAsync: Executes a query and returns a SqlDataReader asynchronously. ExecuteScalarAsync: Executes a query and returns a single value asynchronously. Example: public async Task GetDataAsync()

Example code

{
SqlConnection connection = new SqlConnection(connectionString);
await connection.OpenAsync(); SqlCommand command = new SqlCommand("SELECT * FROM Customers", connection); SqlDataReader reader = await command.ExecuteReaderAsync(); while (await reader.ReadAsync()) { Console.WriteLine(reader["CustomerName"].ToString()); } reader.Close(); }

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: ADO.NET. A stored procedure is a precompiled set of SQL statements that are stored and executed on the database server. They can improve performance and security by encapsulating complex operations. In ADO.NET, stored procedures are executed using the SqlCommand object, where the CommandType property is set to CommandType.StoredProcedure.

Example code

SqlCommand command = new SqlCommand("GetCustomerDetails", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@CustomerID", customerId); SqlDataReader reader = command.ExecuteReader();

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: way to safely and securely inject data into queries, reducing the risk of SQL injection ttacks.

Explain a bit more

In ADO.NET, you handle parameters using the Parameters collection of a SqlCommand object. way to safely and securely inject data into queries, reducing the risk of SQL injection ttacks. In ADO.NET, you handle parameters using the Parameters collection of a SqlCommand object. way to safely and securely inject data into queries, reducing the risk of SQL injection ttacks. In ADO.NET, you handle parameters using the Parameters collection of a SqlCommand object. SqlCommand command = new SqlCommand("SELECT * FROM Customers WHERE CustomerID = @CustomerID", connection); command.Parameters.AddWithValue("@CustomerID", customerId); way to safely and securely inject data into queries, reducing the risk of SQL injection ttacks. In ADO.NET, you handle parameters using the Parameters collection of a SqlCommand object.

Example code

SqlCommand command = new SqlCommand("SELECT * FROM Customers WHERE CustomerID = @CustomerID", connection); command.Parameters.AddWithValue("@CustomerID", customerId);

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: Parameters are used to pass values to SQL commands or stored procedures. They provide a way to safely and securely inject data into queries, reducing the risk of SQL injection attacks. In ADO.NET, you handle parameters using the Parameters collection of a SqlCommand object.

Example code

SqlCommand command = new SqlCommand("SELECT * FROM Customers WHERE CustomerID = @CustomerID", connection); command.Parameters.AddWithValue("@CustomerID", customerId);

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: SQL injection attacks can be prevented by:

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: snapshot of the data and remains unchanged even if the data in the database changes during the operation. It is slower and consumes more memory compared to forward-only cursor.

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: Forward-only cursor: A cursor that allows you to read rows sequentially in a forward direction only.

Explain a bit more

It is fast and lightweight, but you cannot go back to previous rows. Static cursor: A cursor that allows both forward and backward navigation. It provides a snapshot of the data and remains unchanged even if the data in the database changes during the operation. It is slower and consumes more memory compared to a forward-only cursor.

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: An ADO.NET DataProvider is a set of classes used to interact with different types of data sources (such as SQL Server, Oracle, etc.). It provides methods for opening connections, executing commands, and retrieving data. The main types of DataProviders are: SqlClient (for SQL Server) OleDb (for OLE DB-compatible data sources) Odbc (for ODBC-compatible data sources) Oracle (for Oracle databases)

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: llows you to define the name, data type, size, and value of a parameter.

Explain a bit more

SqlParameter is used to protect against SQL injection and to pass data to SQL queries safely. llows you to define the name, data type, size, and value of a parameter. SqlParameter is used to protect against SQL injection and to pass data to SQL queries safely. llows you to define the name, data type, size, and value of a parameter. SqlParameter is used to protect against SQL injection and to pass data to SQL queries safely. SqlCommand command = new SqlCommand("SELECT * FROM Customers WHERE CustomerID = @CustomerID", connection); SqlParameter parameter = new SqlParameter("@CustomerID", SqlDbType.Int); parameter.Value = customerId; command.Parameters.Add(parameter); llows you to define the name, data type, size, and value of a parameter. SqlParameter is used to protect against SQL injection and to pass data to SQL queries safely.

Example code

SqlCommand command = new SqlCommand("SELECT * FROM Customers WHERE CustomerID = @CustomerID", connection); SqlParameter parameter = new SqlParameter("@CustomerID", SqlDbType.Int); parameter.Value = customerId; command.Parameters.Add(parameter);

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: The SqlParameter class represents a parameter to a SQL command or stored procedure. It allows you to define the name, data type, size, and value of a parameter. SqlParameter is used to protect against SQL injection and to pass data to SQL queries safely.

Example code

SqlCommand command = new SqlCommand("SELECT * FROM Customers WHERE CustomerID = @CustomerID", connection); SqlParameter parameter = new SqlParameter("@CustomerID", SqlDbType.Int); parameter.Value = customerId; command.Parameters.Add(parameter);

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: Isolation levels define the level of visibility one transaction has into the changes made by other concurrent transactions. The four isolation levels in ADO.NET are:

Real-world example (ShopNest)

Placing an order updates stock and inserts the order row in one SqlTransaction—either both succeed or both roll back.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: Batch processing allows you to execute multiple SQL commands in a single round trip to the database, which can improve performance when you have a large number of operations to perform. You can use the SqlCommand object to execute a batch of SQL statements separated by semicolons. Example: SqlCommand command = new SqlCommand();

Example code

command.Connection = connection;
command.CommandText = "INSERT INTO Customers (Name) VALUES ('John'); INSERT INTO Orders (OrderDate) VALUES ('2025-01-01');"; command.ExecuteNonQuery();

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: cross multiple data sources (e.g., SQL Server and other databases).

Explain a bit more

It simplifies transaction management by automatically handling the commit and rollback of transactions cross multiple resources. using (TransactionScope scope = new TransactionScope()) { SqlConnection connection1 = new SqlConnection(connectionString1); SqlConnection connection2 = new SqlConnection(connectionString2); connection1.Open(); connection2.Open(); // Execute commands on both connections scope.Complete(); // Commit the transaction if everything is successful } cross multiple data sources (e.g., SQL Server and other databases). It simplifies transaction management by automatically handling the commit and rollback of transactions cross multiple resources.

Example code

using (TransactionScope scope = new TransactionScope()) { SqlConnection connection1 = new SqlConnection(connectionString1); SqlConnection connection2 = new SqlConnection(connectionString2); connection1.Open(); connection2.Open(); // Execute commands on both connections scope.Complete(); // Commit the transaction if everything is successful }

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: The TransactionScope class in ADO.NET is used to handle distributed transactions across multiple data sources (e.g., SQL Server and other databases). It simplifies transaction management by automatically handling the commit and rollback of transactions across multiple resources.

Example code

using (TransactionScope scope = new TransactionScope()) { SqlConnection connection1 = new SqlConnection(connectionString1); SqlConnection connection2 = new SqlConnection(connectionString2); connection1.Open(); connection2.Open(); // Execute commands on both connections scope.Complete(); // Commit the transaction if everything is successful }

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: dapter.UpdateCommand = new SqlCommand("UPDATE Customers SET Name = @Name WHERE CustomerID = @CustomerID", connection); dapter.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 100, "Name"); dapter.UpdateCommand.Parameters.Add("@CustomerID", SqlDbType.Int, 4, "CustomerID"); dapter.UpdateCommand = new SqlCommand("UPDATE… Customers SET Name = @Name…… WHERE CustomerID = @CustomerID", connection);…

Explain a bit more

dapter.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 100, "Name"); dapter.UpdateCommand.Parameters.Add("@CustomerID", SqlDbType.Int, 4, "CustomerID"); dapter.UpdateCommand = new SqlCommand("UPDATE Customers SET Name = @Name WHERE CustomerID = @CustomerID", connection); dapter.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 100, "Name"); dapter.UpdateCommand.Parameters.Add("@CustomerID", SqlDbType.Int, 4, "CustomerID"); dapter.UpdateCommand = new SqlCommand("UPDATE… Customers SET Name = @Name WHERE CustomerID = @CustomerID", connection); dapter.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 100, "Name");…

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: The UpdateCommand property of the DataAdapter specifies the SQL command used to update the database when changes are made to the data in the DataSet. The Update() method of the DataAdapter uses the UpdateCommand to push changes back to the database.

Example code

SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Customers", connection); adapter.UpdateCommand = new SqlCommand("UPDATE Customers SET Name = @Name WHERE CustomerID = @CustomerID", connection); adapter.UpdateCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 100, "Name"); adapter.UpdateCommand.Parameters.Add("@CustomerID", SqlDbType.Int, 4, "CustomerID");

Real-world example (ShopNest)

Always pass order ids with parameters: cmd.Parameters.AddWithValue("@id", orderId). Never concatenate user input into SQL.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

ADO.NET ADO.NET Core Tutorial · ADO.NET

Short answer: concurrency in ADO.NET. Optimistic Concurrency: Assumes that data conflicts are rare. It allows multiple users to read and modify the data without locking the record. However, when updating, it checks if the data has been modified by another user since it was last read. Pessimistic Concurrency: Locks the data when it's being read or modified, preventing other users from accessing it until the transaction is…

Explain a bit more

complete. It can reduce conflicts but may result in performance issues.

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details