int x=4;
char c=(char)x;
it would not print '4' on screen. It would display the ASCII corresponding value of '4'.
I tried this way...
int x=48;
string str =x.ToString();
char c=str[0];//for printing 4;
char c1=str[1];// for printing 8;
Friday, March 31, 2017
Thursday, March 30, 2017
Explain connected and disconnected architecture in ADO.NET
The ADO.net architecture, in which connection must be kept open till the end to retrieve and access data from database is called as connected architecture. Connected architecture is built on the these types -
connection, command, data reader
The ADO.net architecture, in which connection will be kept open only till the data retrieved from database, and later can be accessed even when connection to database is closed is called as disconnected architecture. Disconnected architecture of ADO.net is built on these types -
connection, data adapter, command builder and dataset and data view.Wednesday, March 29, 2017
Tell about abstract class
Abstract classes are defined as classes using the modifier "abstract". When we want a class to be base class and we don't want to instantiate we use abstract classes. Many a times abstract classes are either partially implemented or not at all implemented.
An abstract class can contain either abstract methods or non abstract methods. Abstract members do not have any implementation in the abstract class, but the same has to be provided in its derived class.
An abstract class cannot be sealed class. We can have abstract methods only in abstract classes. We should use same access modifier for an abstract method in both base class and derived class to avoid compilation errors.
An abstract method cannot have virtual as it is implicitly virtual.
An abstract class can contain either abstract methods or non abstract methods. Abstract members do not have any implementation in the abstract class, but the same has to be provided in its derived class.
An abstract class cannot be sealed class. We can have abstract methods only in abstract classes. We should use same access modifier for an abstract method in both base class and derived class to avoid compilation errors.
An abstract method cannot have virtual as it is implicitly virtual.
Tuesday, March 28, 2017
Monday, March 27, 2017
What is index and what are the uses?
Indexes are used to retrieve data from the database very fast. The users
cannot see the indexes, they are just used to speed up searches/queries.
Without an index when we run a select query on a Customer database with
three columns customername, customerage and customerphonenumber with 1000 records to
look for customer name "John”, the database software would literally look
at each and every row of the database. Even if it finds "John" it
would still look at remaining rows because there may be other customers too
with same name.
So, to make this kind of searches fast we make of indexes. Indexing is a
way of sorting several records on multiple fields. When we create an index on a
field in a table it will create another data structure which holds the field
value, and pointer to the record it relates to. This index structure is then
sorted, allowing Binary Searches to be performed on it.
Indexes are used to retrieve data from the database very fast. The users
cannot see the indexes, they are just used to speed up searches/queries.
Without an index when we run a select query on a Customer database with
three columns customername, customerage and customerphonenumber with 1000 records to
look for customer name "John”, the database software would literally look
at each and every row of the database. Even if it finds "John" it
would still look at remaining rows because there may be other customers too
with same name.
So, to make this kind of searches fast we make of indexes. Indexing is a way of sorting several records on multiple fields. When we create an index on a field in a table it will create another data structure which holds the field value, and pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.
So, to make this kind of searches fast we make of indexes. Indexing is a way of sorting several records on multiple fields. When we create an index on a field in a table it will create another data structure which holds the field value, and pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.
Explain about Triggers in SQL
A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the database.
The database trigger are executed either before or after our required code. By default it is executed after.
Example:CREATE [OR REPLACE ] TRIGGER trigger_name
{BEFORE |AFTER |INSTEAD OF}
{INSERT [OR] | UPDATE [OR] |DELETE}
[OF col_name]
on table_name
The database trigger are executed either before or after our required code. By default it is executed after.
Example:CREATE [OR REPLACE ] TRIGGER trigger_name
{BEFORE |AFTER |INSTEAD OF}
{INSERT [OR] | UPDATE [OR] |DELETE}
[OF col_name]
on table_name
Sunday, March 26, 2017
What do you mean by endpoints in WCF?
All communication with a Windows Communication Foundation (WCF) service occurs through the endpoints of the service. Endpoints provide clients access to the functionality offered by a WCF service. We expose endpoints for making our service to be consumed.
Each endpoint consists of four properties:
- Address: The address uniquely identifies the endpoint and tells potential consumers of the service where it is located. We mainly use URL as address.
- Binding: The binding specifies how to communicate with the endpoint like transport protocol, encoding for messages and necessary security requirements. WCF uses by default wsHttp binding.
- Contracts: The contract outlines what functionality the endpoint exposes to the client.There are many contracts like service, operation, data, fault and message contracts. A contract specifies:
- What operations can be called by a client.
- The form of the message.
- The type of input parameters or data required to call the operation.
- What type of processing or response message the client can expect.
- Behaviors: We can use endpoint behaviors to customize the local behavior of the service endpoint. Endpoint behaviors achieve this by participating in the process of building a WCFruntime.
Subscribe to:
Posts (Atom)
Call a function in child component from parent component in React
Consider the following parent component class Parent extends React.Component { constructor(props) { super(props); thi...
-
The process of replacing a module with generic and mostly empty object, called a mock. Advantages: Isolates our code from its dependen...
-
An object is an entity that has Properties for identifying State, Methods for behavior, Events for depicting the change of State. Data ass...
-
Common Language Runtime or CLR is the run-time execution environment of .Net Framework. Converting MS-IL into platform or OS specific code ...