What are the three possible settings for the CommandType property of a SqlCommand object or an OleDbCommand object, and what does each mean?

1 Answer

Answer :

A Command object can have a CommandType property setting of Text, StoredProcedure, or TableDirect. When set to Text, the command executes the SQL string that is stored in the Command object’s CommandText property. When set to StoredProcedure, the command accesses a procedure stored on the database and returns the results. A CommandText setting of TableDirect indicates that the command should return the entire contents of the table indicated by the CommandText property. 

Related questions

Description : Given part of a stack trace: aspnet.debugging.BadForm.Page_Load(Object sender, EventArgs e) +34. What does the +34 mean?

Last Answer : It is an actual offset (at the assembly language level) – not an offset into the IL instructions. 

Description : Briefly explain encapsulation and why it is important in object-oriented - programming.

Last Answer : Encapsulation is the principle that all of the data and functionality required by an object be contained by that object. This allows objects to exist as independent, interchangeable units of functionality without maintaining dependencies on other units of code.

Description : What size is a .NET object?

Last Answer : Each instance of a reference type has two fields maintained by the runtime - a method table pointer and a sync block. These are 4 bytes each on a 32-bit system, making a total of 8 bytes ... bytes, even for classes with no data (e.g. System.Object). Values types have no equivalent overhead. 

Description : What does the Dispose method do with the connection object? 

Last Answer : Deletes it from the memory. To Do: answer better. The current answer is not entirely correct.

Description : Is object destruction deterministic?

Last Answer : No

Description : object is an alias for what? 

Last Answer : System.Object 

Description : How do you dereference an object? 

Last Answer : Set it equal to null. 

Description : Does an object need to be made to run main?

Last Answer : No

Description : What does the Dispose method do with the connection object? 

Last Answer : Deletes it from the memory. To Do: answer better. The current answer is not entirely correct.

Description : Is C# object-oriented?

Last Answer : Yes, C# is an OO language in the tradition of Java and C++.

Description : Is C# is object oriented?

Last Answer : Yes, C# is an OO language in the tradition of Java and C++.

Description : What does the keyword “virtual” declare for a method or property? 

Last Answer : The method or property can be overridden. 

Description : What’s the implicit name of the parameter that gets passed into the set method/property of a class?

Last Answer : Value. The data type of the value parameter is defined by whatever data type the property is declared as.

Description : Can a property be a ref or out parameter?

Last Answer : A property is not classified as a variable – it can’t be ref or out parameter. 

Description : What happens if you make a property static?

Last Answer : They become class properties. 

Description : What does the keyword “virtual” declare for a method or property? 

Last Answer : The method or property can be overridden.

Description : What’s the implicit name of the parameter that gets passed into the set method/property of a class?

Last Answer : Value. The data type of the value parameter is defined by whatever data type the property is declared as.

Description : What’s the C# syntax to catch any possible exception?

Last 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 {}.

Description : List some custom attribute scopes and possible targets. 

Last Answer : Assembly – assembly Class – type Delegate - type, return

Description : What’s the C# syntax to catch any possible exception?

Last 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 {}.

Description : What are the four major parts of a SQL SELECT statement? Briefly describe each one.

Last Answer : The four major parts of a SELECT statement are SELECT, FROM, WHERE, and ORDER BY. SELECT specifies the fields to be retrieved. FROM specifies the table from which the records are to be retrieved. WHERE ... the records to be retrieved, and ORDER BY allows you to specify a sort order for the records.

Description : What are the major components of a Data Provider, and what function does each fulfill?

Last Answer : An ADO.NET Data Provider is a suite of components designed to facilitate data access. Every Data Provider minimally includes a Connection object that provides the actual connection to the data ... only, read-only access to a database, and a DataAdapter that facilitates disconnected data access.

Description : What are the two kinds of multidimensional arrays? Briefly describe each.

Last Answer : Multidimensional arrays can be either rectangular arrays or jagged arrays. A rectangular array can be thought of as a table, where each row has the same number of columns. Rectangular arrays with ... dimensional jagged array is like a table where each row might have a different number of columns.

Description : Briefly describe the major components of the .NET Framework and describe what each component does.

Last Answer : The .NET Framework consists of two primary parts: the common language runtime, which manages application execution, enforces type safety, and manages memory reclamation, and the .NET base class library, which consists of thousands of predeveloped classes that can be used to build applications.

Description : Describe an operator from each of these categories:

Last Answer : Arithmetic: + Logical (boolean and bitwise): & String concatenation: + Increment, decrement: ++ Shift: >> Relational: == Assignment: = Member access: . Indexing: [] Cast: () ... : + Object creation: new Type information: as Overflow exception control: checked Indirection and Address: *

Description : Briefly describe the three types of user-developed controls and how they differ.

Last Answer : The three types of user-developed controls are inherited controls, user controls, and custom controls. An inherited control derives from a standard Windows Forms control and inherits the ... inherit only generic control functionality. All specific functionality must be implemented by the developer.

Description : What are three test cases you should go through in unit testing?

Last Answer : 1. Positive test cases (correct data, correct output). 2. Negative test cases (broken or missing data, proper handling). 3. Exception test cases (exceptions are thrown and caught properly).

Description : Explain the three services model commonly know as a three-tier application.

Last Answer : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

Description : What are the names of the three types of operators? 

Last Answer : Unary, binary, and conversion. 

Description : What are three test cases you should go through in unit testing? 

Last Answer : 1. Positive test cases (correct data, correct output). 2. Negative test cases (broken or missing data, proper handling). 3. Exception test cases (exceptions are thrown and caught properly).

Description : Explain the three services model commonly know as a three-tier application.

Last Answer : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources). 

Description : What do u mean by Satellite Assemblies ?

Last Answer : Answer: The assemblies which contains only culture information are known as satellite assemblies.This assembly is used to get language specific resources for an application .

Description : What does the term immutable mean?

Last Answer : The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

Description : What does marshalling mean?

Last Answer : The process of packing one or more items of data into a message buffer, prior to transmitting that message buffer over a communication channel. The packing process not only collects together ... data of different types into a standard representation agreed with the recipient of the message.  

Description : Is constructor or destructor inheritance explicit or implicit? What does this mean?

Last Answer : Constructor or destructor inheritance is explicit…. Public Extended : base() this is called the constructor initializer.

Description : What does operator order of precedence mean? 

Last Answer : Certain operators are evaluated before others. Brackets help to avoid confusion. 

Description : Strings are immutable, what does this mean?

Last Answer : Any changes to that string are in fact copies. 

Description : What does the term immutable mean?

Last Answer : The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory. 

Description : What does the keyword virtual mean in the method definition? 

Last Answer : The method can be over-ridden. 

Description : What si the difference between interface and abstractclass Select Answer:  1. interface contain only methods  2. we can't declare a variable for interface  3. interface contain only events  4. None  5. All

Last Answer : Ans : 2 The only Difference between Interface and Abstract class is we can declare a variable in abstract class but we can't declare in variable interface

Description : What is the lifespan for items stored in ViewState? Select Answer:  1. Item stored in ViewState exist for the life of the current page  2. Item stored in ViewState exist for the life ... of the current Applicaiton  4. Item stored in ViewState exist for the life of the current configuration

Last Answer : 1. Item stored in ViewState exist for the life of the current page AS any web application works on request and response basis ,so on every post backs, The data in control gets lost. To retain page ... control with data. The life cycle of the view state exist for life of current running page only. 

Description : Which one of the following tools is used to view the metadata information contained in a .NET assembly? Select Answer:  1. al.exe  2. ilasm.exe  3. vbx.exe  4. csc.exe  5. ildasm.exe

Last Answer :  5. ildasm.exe

Description : How would you ensure that all relevant registry entries were removed in the event that installation of your application failed?

Last Answer : You can ensure that registry entries are removed, as well as perform any other “clean-up” tasks, by creating an Installer class and writing the appropriate code in the Rollback event handler. Then create a new Custom Action and set the InstallerClass, and EntryPoint properties to appropriate values.

Description : Describe a general strategy for creating a setup project that terminates installation if a specific file is not already installed on the target machine.

Last Answer : First, create a file search to search the file system for the specific file. Then create a launch condition to evaluate the results of the search. You can connect the launch condition to ... in the search's Property property in the expression specified by the launch condition's Condition property. 

Description : What is the purpose of a bootstrapper application? When do you not need to create one?

Last Answer : A bootstrapper application automatically detects if Windows Installer is installed on the target machine. If Windows Installer is not present, it installs Windows Installer before proceeding with the rest ... Installer 1.5 already installed) or have had Microsoft Installer 1.5 installed previously.

Description : What is a native image? How do you create one?

Last Answer : A native image is a precompiled version of a .NET assembly. You can create a native image of your application by using the Ngen.exe utility.

Description : Describe XCOPY deployment. Under what conditions is it useful? When can it not be used?

Last Answer : XCOPY deployment is a simple method of deployment where the DOS command XCOPY is used to copy the application directory and any subdirectories to the target machine. You can use XCOPY ... an application requires a more complex deployment or references shared assemblies, you cannot use XCOPY.

Description : What is a shared assembly? How would you create one?

Last Answer : An assembly is an assembly of which only a single copy is installed per machine. This copy can be shared by multiple applications. To make an assembly a shared assembly, you must first assign it a strong name, and then install it to the global assembly cache.

Description : Briefly highlight the differences between imperative and declarative security as they pertain to code access security.

Last Answer : Imperative security is implemented by calling methods of Permission objects in code at run time. Declarative security is configured by attaching attributes representing permissions to classes ... request assembly-wide permissions using the Assembly (assembly) directive with declarative security.

Description : Explain how to retrieve information from the configuration file at run time. How would you store information in the configuration file at design time?

Last Answer : You must first create an instance of AppSettingsReader to read the configuration file. You can then call the GetValue method to read values represented in the configuration file. To add configuration ... used to retrieve the entry. The value can be changed between executions of the application.