Lists sharing classes and database-specific classes in ADO. net.
Answer: sharing class: dataset, datatable, datarow, datacolumn, datarealtion, constraint, datacolumnmapping, datatablemapping
Specific classes: (x) connection, (x) command, (x) commandbuilder, (x) dataadapter, (x) datareader, (x) parameter, (x) Transaction
In C #, string STR = NULL and string STR = "". Try to use text to describe the differences.
A: String STR = "" space allocation for initialization objects, while string STR = NULL: initialization object
Similarities and differences between class and struct in. net
A: The structure and class share almost all the same syntaxes, but the structure is more restrictive than the class: although the static fields of the structure can be initialized, the structure instance field declaration still cannot use the Initial Value Setting item.
The default constructor (constructor without parameters) or destructor cannot be declared in the structure. The structure copy is automatically created and destroyed by the compiler, so the default constructor and destructor are not required. In fact, the compiler assigns default values to all fields (see the default table) to implement the default constructor. The structure cannot be inherited from a class or other structure.
Structure is a value type -- if an object is created from the structure and assigned to a variable, the variable contains all the values of the structure. When copying a variable that contains a structure, all data will be copied, and any modifications made to the new copy will not change the data of the old copy. Because the structure does not use references, the structure is not identified-two value-type instances with the same data cannot be distinguished. All value types in C # are essentially inherited from valuetype, and the latter is inherited from object. The compiler can convert the value type to the reference type in a process called packing.
The structure has the following features:
The structure is the value type, and the class is the reference type.
When a structure is passed to a method, the structure is passed by passing values, rather than being passed as a reference.
Unlike classes, the new operator can be used for structure instantiation.
The structure can declare constructors, but they must contain parameters.
A structure cannot inherit from another structure or class, and cannot be the base of a class. All structures are directly inherited from system. valuetype, and the latter is inherited from system. object.
Structure can implement interfaces.
It is incorrect to initialize the instance field in the structure.
What is an application? Program Domain? What is managed Code ? What is a strong system? What is packing and unpacking? What is overload? What are the explanations of CTS, CLS, and CLR?
A: application domain:
Application domains provide isolation boundaries for security, reliability, version control, and uninstallation of an assembly. The application domain is often created by the runtime host, which directs the Common Language Runtime Library before running the application. The application domain provides a safer and more useful processing unit, which can be used by the Common Language Runtime Library to provide isolation between applications.
Managed code:
Code developed using a language compiler based on the Common Language Runtime Library is called managed code. managed code has many advantages, such: cross-language integration, cross-language Exception Handling, enhanced security, version control and deployment support, simplified component interaction model, debugging and analysis services, etc.
Packing and unpacking:
Binning and unboxing enable value types to be considered objects. Binning the value type package it into an instance of the object reference type. This allows the value type to be stored in the garbage collection heap. The value type is extracted from the object.
Overload:
Each type of member has a unique signature. A Method signature consists of a method name and a list of parameters (the order and type of parameters. As long as the signature is different, you can define multiple methods with the same name in one type. When two or more methods with the same name are defined, they are called overload.
CTS common type system ):
A specification that determines how the Runtime Library of a common language defines, uses, and manages the types.
CLR Common Language Runtime Library :.
. NET Framework provides a runtime environment called a Common Language Runtime Library. It runs code and provides services that make the development process easier.
CLS public language specifications:
To fully interact with other objects, regardless of the language in which these objects are implemented, objects must only disclose the common functions of all languages they must interact. To this end, the public language specification (CLS) is defined, which is a set of basic language functions required by many applications.
Strong type:
C # is a strongly typed language. Therefore, each variable and object must have a declaration type.
What is the difference between the value type and the reference type?
A: A value type-based Variable directly contains a value. When a value type variable is assigned to another value type variable, the included values are copied. This is different from the value assignment of the referenced type variable. The value assignment of the referenced type variable only copies the reference of the object, rather than the object itself. All value types are implicitly derived from system. valuetype. Different from the reference type, the new type cannot be derived from the value type. But what is the same as the reference type is that the structure can also implement interfaces. Unlike the reference type, the value type cannot contain null values. However, the null type function allows null to be assigned to the value type. Each value type has an implicit default constructor to initialize the default value of this type.
The value type consists of two types: Structure and enumeration.
The structure can be divided into the following types: Numeric (numeric type), integer, floating point type, decimal, bool, and user-defined structure.
Variables of the reference type, also known as objects, can store references to actual data. Declare the keyword of the reference type: Class, interface, Delegate, built-in reference type: object, string
How to Understand Delegation
A: The delegate is similar to the C ++ function pointer, but it is type-safe. The delegate allows passing methods as parameters. A delegate can be used to define a callback method. The delegate can be linked together. For example, multiple methods can be called for an event. The method does not need to be exactly matched with the delegate signature. For more information, see covariant and inverter. C #2.0 introduces the concept of anonymous methods, which allow passing code blocks as parameters instead of Individually Defined methods.
What are the similarities and differences between interfaces and classes in C.
A: The interface cannot be instantiated directly. The interface does not contain the implementation of methods. Interfaces, classes, and structures can be inherited from multiple interfaces. However, C # only supports single inheritance: the class can only be inherited from one base class. Class definition can be split between different source files.
Same: interfaces, classes, and structures can be inherited from multiple interfaces. An interface is similar to an abstract base class: any non-Abstract type that inherits an interface must implement all the members of the interface. Interfaces can contain events, indexers, methods, and attributes. A class can implement multiple interfaces.
What are the authentication methods of Asp.net?
A: Windows Authentication provider:
Provides information on how to use Windows Authentication with Microsoft Internet Information Service (IIS) authentication to ensure the security of ASP. NET applications.
Forms authentication provider:
Provides information about how to use your own code to create an application-specific logon form and perform authentication. One easy way to use forms authentication is to use ASP. net membership and ASP. net login controls, which provide a way to collect, verify, and manage user creden。 with little or no code.
Passport Authentication provider:
Provides information about the centralized authentication service provided by Microsoft, which provides single logon and core configuration for member sites
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service