This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Difference Between Sqlcommand And Sqlcommandbuilder? |
Answer»
|
|
| 2. |
Why Edit Is Not Possible In Repeater? |
|
Answer» It has no such FEATURE. It has no such feature. |
|
| 3. |
Does Sqlclient And Oledb Class Share The Same Functionality? |
|
Answer» No, each have its own functionality, ex : for SQL client , there is SQLCONNECTION OBJECT and for oledb client , there is OleDBConnection No, each have its own functionality, ex : for sql client , there is SqlConnection object and for oledb client , there is OleDBConnection |
|
| 4. |
What Is The Difference Between Data Reader And Data Set? |
Answer»
|
|
| 5. |
What Is The Difference Between Data Reader And Data Adapter? |
|
Answer» DataReader is an forward only and read only cursor type if you are accessing data through DataReader it shows the data on the web form/ control but you can not perform the paging feature on that record (because it's forward only type). READER is best fit to SHOW the Data (where no need to work on data) DataAdapter is not only CONNECT with the DATABSE(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected ARCHITECTURE of .NET show we can populate the records to the DataSet, where as Dataadapter is best fit to work on data. DataReader is an forward only and read only cursor type if you are accessing data through DataReader it shows the data on the web form/ control but you can not perform the paging feature on that record (because it's forward only type). Reader is best fit to show the Data (where no need to work on data) DataAdapter is not only connect with the Databse(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet, where as Dataadapter is best fit to work on data. |
|
| 6. |
What Are The Advantages And Disadvantages Of Using Datalist? |
|
Answer» Adv: The DATALIST's display is defined via templates, DataList allows for much more customization of the RENDERED HTML markup, by which it is more user-friendly displays of data. DisAdv: adding such functionality with the DataList takes more DEVELOPMENT time than with the DataGrid as,
Adv: The DataList's display is defined via templates, DataList allows for much more customization of the rendered HTML markup, by which it is more user-friendly displays of data. DisAdv: adding such functionality with the DataList takes more development time than with the DataGrid as, |
|
| 7. |
How Do You Connect To Sql Server Database Without Using Sqlclient? |
|
Answer» you can CONNECT SQL USING oledbname SPACE. you can connect sql using oledbname space. |
|
| 8. |
What Are The Steps To Connect To A Database? |
Answer»
|
|
| 9. |
How Do You Update A Dataset In Ado.net And How Do You Update Database Through Dataset? |
|
Answer» UPDATE a dataset: Dataset ds = new dataset(); SqlDataAdapter adp = new SqlDataAdapter(QUERY,connection); Adp.fill(ds); Again you can add/update Dataset as below SqlDataAdapter adp1 = new SqlDataAdapter(Query1,connection); Adp1.fill(ds);Update DATABASE through dataset. SqlCommandBuilder mySqlCommandBuilder = new SqlCommandBuilder(mySqlDataAdapter); Foreach(datarow dr in ds.table[0].rows) { Dr[“column NAME”] = “value”; mySqlDataAdapter.Update(ds); }Update a dataset: Update database through dataset. |
|
| 10. |
What Is Delegate? |
|
Answer» DELEGATE is an important ELEMENT of C# and is EXTENSIVELY used in EVERY type of .NET application. A delegate is a class WHOSE object (delegate object) can store a set of references to methods. Delegate is an important element of C# and is extensively used in every type of .NET application. A delegate is a class whose object (delegate object) can store a set of references to methods. |
|
| 11. |
What Is Connection String? |
|
Answer» CONNECTION String - a string which contains address of the DATABASE we WANT to CONNECT to. connection String - a string which contains address of the database we want to connect to. |
|
| 12. |
Which One Of The Following Objects Is A High-level Abstraction Of The Connection And Command Objects In Ado.net? |
|
Answer» DATAREADER DataSet DATATABLE DataView DataAdapter Answer: DataAdapter DataReader DataSet DataTable DataView DataAdapter Answer: DataAdapter |
|
| 13. |
What Is The Executescalar Method? |
|
Answer» Summary: Executes the QUERY, and RETURNS the first column of the first row in the result SET returned by the query. Additional columns or rows are IGNORED.
Summary: Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
|
|
| 14. |
Explain Executenonquery? |
|
Answer»
Executes a Transact-SQL STATEMENT against the connection and returns the NUMBER of rows affected. Summary: Executes a Transact-SQL statement against the connection and returns the number of rows affected. |
|
| 15. |
How Can I Retrieve Two Tables Of Data At A Time By Using Data Reader? |
|
Answer» If we execute 2 select command either in stored procedure or in select command and then executereader method FIRED of command object. it RETURN 2 tables in DATAREADER. E.g: Now it return 2 tables in datareader (dr). If we execute 2 select command either in stored procedure or in select command and then executereader method fired of command object. it return 2 tables in datareader. E.g: Now it return 2 tables in datareader (dr). |
|
| 16. |
If We Are Not Returning Any Records From The Database, Which Method Is To Be Used? |
|
Answer» There is a method called Execute NON Query. This method EXECUTES the Update, Delete etc. This does not RETURN any rows but will give the number of rows AFFECTED.
There is a method called Execute Non Query. This method executes the Update, Delete etc. This does not return any rows but will give the number of rows affected.
|
|
| 17. |
Can We Do Database Operations Without Using Any Of The Ado.net Objects? |
|
Answer» No, its not at all POSSIBLE. No, its not at all possible. |
|
| 18. |
Can We Connect Two Dataadapters To Same Data Source Using Single Connection At Same Time? |
|
Answer» yes, we can connect two dataadapters to same DATASOURCE using single connection at same TIME. for EG: cn.ConnectionString = "SERVER=(local); database=employee; integrated security=sspi; Multiple Active Result Sets=True"; yes, we can connect two dataadapters to same datasource using single connection at same time. for eg: cn.ConnectionString = "server=(local); database=employee; integrated security=sspi; Multiple Active Result Sets=True"; |
|
| 19. |
What Is A Pre-requisite For Connection Pooling? |
|
Answer» MULTIPLE PROCESSES must agree that they will share the same CONNECTION, where every parameter is the same, including the security SETTINGS. Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings. |
|
| 20. |
What Does Dispose Method Do With The Connection Object? |
|
Answer» Deletes it from the memory. |
|
| 21. |
What Is The Data Provider Name To Connect To Access Database? |
|
Answer» Microsoft.Access. Microsoft.Access. |
|
| 22. |
What Does The Parameter Initial Catalog Define Inside Connection String? |
|
Answer» The DATABASE NAME to CONNECT to. The database name to connect to. |
|
| 23. |
Why Would You Use Untrusted Verificaion? |
|
Answer» Web SERVICES MIGHT use it, as WELL as non-Windows applications. Web Services might use it, as well as non-Windows applications. |
|
| 24. |
Which One Is Trusted And Which One Is Untrusted? |
|
Answer» WINDOWS Authentication is trusted because the username and PASSWORD are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction. Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction. |
|
| 25. |
What Connections Does Microsoft Sql Server Support? |
|
Answer» Windows AUTHENTICATION (VIA Active Directory) and SQL Server authentication (via MICROSOFT SQL Server user NAME and PASSWORDS). Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server user name and passwords). |
|
| 26. |
Explain Acid Rule Of Thumb For Transactions. |
|
Answer» TRANSACTION must be Atomic (it is one unit of work and does not DEPENDENT on PREVIOUS and FOLLOWING transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been UPDATED and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after). Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after). |
|
| 27. |
What Is The Wildcard Character In Sql? Let's Say You Want To Query Database With Like For All Employees Whose Name Starts With La. |
|
Answer» The wildcard character is %, the proper query with LIKE WOULD involve ‘LA%’. The wildcard character is %, the proper query with LIKE would involve ‘La%’. |
|
| 28. |
What Is The Role Of The Datareader Class In Ado.net Connections? |
|
Answer» It RETURNS a read-only DATASET from the data SOURCE when the command is executed. It returns a read-only dataset from the data source when the command is executed. |
|
| 29. |
What Are Advantages And Disadvantages Of Microsoft-provided Data Provider Classes In Ado.net? |
|
Answer» 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 is 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. 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 is 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. |
|
| 30. |
Explain The Three Services Model (three-tier Application)? |
|
Answer» PRESENTATION (UI), BUSINESS (LOGIC and underlying code) and data (from storage or other SOURCES). Presentation (UI), business (logic and underlying code) and data (from storage or other sources). |
|
| 31. |
Can You Change The Value Of A Variable While Debugging A C# Application? |
|
Answer» Yes, if you are debugging VIA Visual Studio.NET, just GO to Immediate window. Yes, if you are debugging via Visual Studio.NET, just go to Immediate window. |
|
| 32. |
What Are Three Test Cases You Should Go Through In Unit Testing? |
|
Answer» Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are THROWN and CAUGHT PROPERLY). Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly). |
|
| 33. |
How Do You Debug An Asp.net Web Application? |
|
Answer» ATTACH the aspnet_wp.exe PROCESS to the DbgClr DEBUGGER. Attach the aspnet_wp.exe process to the DbgClr debugger. |
|
| 34. |
Where Is The Output Of Textwritertracelistener Redirected? |
|
Answer» To the Console or a TEXT FILE depending on the PARAMETER PASSED to the constructor. To the Console or a text file depending on the parameter passed to the constructor. |
|
| 35. |
Why Are There Five Tracing Levels In System.diagnostics.traceswitcher? |
|
Answer» The tracing dumps can be quite verbose and for some applications that are constantly RUNNING you run the RISK of OVERLOADING the MACHINE and the hard drive there. Five levels RANGE from None to Verbose, allowing to fine-tune the tracing activities. The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities. |
|
| 36. |
What Is The Difference Between The Debug Class And Trace Class? Documentation Looks The Same? |
|
Answer» USE DEBUG CLASS for debug BUILDS, use TRACE class for both debug and release builds. Use Debug class for debug builds, use Trace class for both debug and release builds. |
|
| 37. |
What Does Assert() Do? |
|
Answer» In debug compilation, assert TAKES in a BOOLEAN CONDITION as a parameter, and shows the error dialog if the condition is false. The program PROCEEDS WITHOUT any interruption if the condition is true. In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. |
|
| 38. |
What Does The This Window Show In The Debugger? |
|
Answer» It POINTS to the object that is POINTED to by this reference. Object is INSTANCE DATA is shown. It points to the object that is pointed to by this reference. Object is instance data is shown. |
|
| 39. |
What Debugging Tools Come With The .net Sdk? |
|
Answer» CorDBG – command-line debugger, and DbgCLR – GRAPHIC debugger. VISUAL STUDIO .NET uses the DbgCLR. To use CorDbg, you must COMPILE the ORIGINAL C# file using the /debug switch. CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch. |
|
| 40. |
Is Xml Case-sensitive? |
|
Answer» YES, so <STUDENT> and <student> are different ELEMENTS. Yes, so <Student> and <student> are different elements. |
|
| 41. |
What Is The Difference Between <c> And <code> Xml Documentation Tag? |
|
Answer» SINGLE LINE CODE EXAMPLE and multiple-line code example. Single line code example and multiple-line code example. |
|
| 42. |
How Do You Generate Documentation From The C# File Commented Properly With A Command-line Compiler? |
|
Answer» COMPILE it with a /DOC SWITCH. Compile it with a /doc switch. |
|
| 43. |
What's The Difference Between // Comments, /* */ Comments And /// Comments? |
|
Answer» Single-line, multi-line and XML DOCUMENTATION COMMENTS. Single-line, multi-line and XML documentation comments. |
|
| 44. |
What Is A Satellite Assembly? |
|
Answer» When you write a MULTILINGUAL or multi-cultural application in .NET, and want to DISTRIBUTE the core application separately from the localized MODULES, the localized assemblies that MODIFY the core application are CALLED satellite assemblies. When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies. |
|
| 45. |
What Is A Multicast Delegate? |
|
Answer» It is a DELEGATE that points to and eventually FIRES off several METHODS. It is a delegate that points to and eventually fires off several methods. |
|
| 46. |
What Is A Delegate? |
|
Answer» A delegate OBJECT encapsulates a reference to a METHOD. In C++ they were REFERRED to as function pointers. A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers. |
|
| 47. |
Why Is It A Bad Idea To Throw Your Own Exceptions? |
|
Answer» Well, if at that POINT you KNOW that an error has occurred, then why not write the proper code to HANDLE that error instead of passing a new Exception object to the catch block? Throwing your own EXCEPTIONS signifies some DESIGN flaws in the project. Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project. |
|
| 48. |
Can Multiple Catch Blocks Be Executed? |
|
Answer» No, once the proper catch CODE fires off, the CONTROL is TRANSFERRED to the finally BLOCK (if there are any), and then WHATEVER follows the finally block. No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block. |
|
| 49. |
What Is The C# Equivalent Of C++ Catch (....), Which Was A Catch-all Statement For Any Possible Exception? |
|
Answer» A CATCH BLOCK that catches the exception of type System.Exception. You can also omit the PARAMETER data type in this CASE and just write catch {}. A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}. |
|
| 50. |
Will Finally Block Get Executed If The Exception Had Not Occurred? |
|
Answer» Yes. Yes. |
|