Posts

Showing posts from 2012

Abstract class with example

Abstract classes are classes which does not require any implementation . What ever be the methods written in the abstract clases it should be override in the derived class . The main point regarding the abstract class is that we can not create objects for the abstract classes . So the flow is like , 1)  We are writing methods in the abstract classes. Should use the keyword Abstract for the class       and should use virtual for the methods . 2)  If we need to do any operation by default whenever a method is calling, like that operations can be written        inside the virtual methods of the abstract classes .So that from some places suppose we are calling       this      method  , automatically the common operations will occur and  we can add extra functionalities       if   needed in the calling places. ...

Simple program using WCF _example

Image
                Here we are discussing about how to write a small program using wcf service.   For this we are going to write a small program.   In that we are creating an application which will return ‘SUM’ as the result   and it using the wcf web service to get the added result .   In the above webpage we can enter the two values and when clicking on the button it will return the result . We can read the two values by Now we have to add a new wcf project to calculate the sum . we can use the wcf to read data from the databases also .   Now we have to select the wcf service  write the  method  that you want , in the interface file . Implement those method in the svc file . Write the operations that you need to do .  we have to select the url of the service  from the address bar , so we have to see the ser...

Simple program using WCF _example

Image
                Here we are discussing about how to write a small program using wcf service.   For this we are going to write a small program.   In that we are creating an application which will return ‘SUM’ as the result   and it using the wcf web service to get the added result .   In the above webpage we can enter the two values and when clicking on the button it will return the result . We can read the two values by Now we have to add a new wcf project to calculate the sum . we can use the wcf to read data from the databases also .   Now we have to select the wcf service  write the  method  that you want , in the interface file . Implement those method in the svc file . Write the operations that you need to do .  we have to select the url of the service  from the address bar , so we have to see the s...

Sample Code For DataBase Connection Using Asp.net

        protected void Page_Load( object sender, EventArgs e)         {              SqlCommand MyCommand;                SqlDataAdapter MyAdapter;                DataTable MyTable;             SqlConnection MyConnection;             MyConnection = new SqlConnection ();             MyConnection.ConnectionString = "Data Source=B406DCOK;Initial  Catalog=Akhil;Integrated Security=True" ;               MyCommand = new SqlCommand ();      ...

What is Web Services

Web services are used to retrieve datas from servers. Through the webservices we are transfering discription of some amount of datas that we have to retrieve. According to that information the datas are retrieving from the web.                                We can also use the webservices to retrieve the datas from the database also from a front end. It is very effective if we are using the webservices to retrieve the informations that, others can access the same webservices to retrieve the informations with out writing the code for that again and again.

How to display datas in a gridview in asp.net.

     data is taking from table table_3         protected void Page_Load( object sender, EventArgs e)         {              SqlCommand MyCommand;                SqlDataAdapter MyAdapter;                DataTable MyTable;             SqlConnection MyConnection;             MyConnection = new SqlConnection ();             MyConnection.ConnectionString = "Data   Source=B406DCOK;Initial      Catalog=Akhil;Integrated  Security=True" ;           ...

How to select second largest value from a table

It is easier to select second largest field from a table . Syntax :    Select * from table_name where column_name = (select MAX(column_Name) from table_name where column_name=(select MAX(column_name) from table_name)) Example:  If we are going to select the second largest field from a table "table_2" according to the value in the field Subscriber_HCID . Means we are going to select the entire row from a table having the Subscriber_HCID should be the second largest select * from t1 where id =( select MAX ( id ) from t1 where id <( select MAX ( id ) from t1 ))

What are mdf,ldf and ndf in sql server

In sql server data and log information are never stored in a single file. So we can devide the whole sql files into 3 . Primary data files Primary data file is the starting point of the database. It points to the other files in the database. Therefore, every database has one primary data file. Also, all the data in the database objects (tables, stored procedures, views, triggers.. etc.) are stored in the primary data files. This is indicated by .mdf Secondary data files You can only have one primary data file for a database. Rest made up by secondary data files. But its not necessary to have a secondary data file. Therefore some databases may not have any secondary data file. But its also possible to have multiple secondary data files for a single database. It is indicated by .ndf. Log files Log files are used to store all the log information. These log files can be used to recover databases in later.           ...

A Simple MVP Program with code

Image
             Problem Consider a Human Resource Management System (HRMS) application with functionality to manage employee information. One of the actions would be to edit the information of an existing employee. The following are the main features which be discussed in the below sections. Once the employee is selected for editing, the status should be shown in green color if the person’s retirement date is NULL There should be a mechanism to write automated unit tests against this feature.              Solution MVP pattern can be used to develop this presentation layer which will help solve the above problem. The following diagram shows the classes, interface and the relation among each. The diagram consists of the following.   IEditEmployeeView This interface will abstract all the data input elements on the View. This will also ...

Basics Of MVP

Image
   Model View Presenter Pattern Model-View-Presenter іѕ a user interface design pattern engineered to facilitate automated unit testing and improve the separation of concerns in presentation logic. One of the keys to MVP is the separation of layers introduced by the creation of a view interface. The presenter doesn't know what implementation of a view, it will be talking to; it just knows that it will be able to call any of the methods defined by those interfaces.  MVP pattern allows us to think at a higher level of abstraction and test implementations of the core interfaces without manually running the application.     The three major components of MVP are Model, View, and Presenter  Model: The model is an interface defining the data to be displayed or otherwise acted upon in the user interface. View: The view is an interface that displays data (the model) and routes user commands (events) to the presenter to act upon tha...