Skip to main content

Posts

Showing posts from October, 2014

Featured Post

How to use Tabs in ASP.NET CORE

I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component  public class AllViewComponent : ViewComponent     {         private readonly UserManager<ApplicationUser> _userManager;         public AllViewComponent(UserManager<ApplicationUser> userManager)         {             _userManager = userManager;         }         public async Task<IViewComponentResult> InvokeAsync()         {             List<StudentViewModel> allUsers = new List<StudentViewModel>();             var items = await _userManager.Users.ToListAsync();             foreach (var item in items)             {                 allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email });             }            

Design an algorithm to compare two numbers

Input : Two numbers that are to be compared Output : Messages of comparison COMPARE (N1, N2) [N1 and N2 are the numbers] If(N1==N2) Then : Write : 'Both the numbers are equal' Else: If (N1<N2) Then: Write : 'First number is smaller then second number' Else: Write : 'First number is bigger number than second number' [End of If] [End of If] Exit

Design an algorithm to find the sum, difference and product of two numbers

Input : From the problem definition the input to the algorithm will be two numbers. NOTE : The identification of the data type of the input is not necessary like int or float. Output : The result sum, difference and product are to be displayed. ARTH_OPNS(N1,N2) [N1 AND N2 are the numbers] RES <-- N1+N2 Write: "The Sum is'. RES RES <-- N1-N2 Write: ' The Difference is', RES RES <-- N1* N2 Write: 'The Product is', RES Exit

Design an algorithm to search a number using linear search technique

Input : A list (array) of number, number of elements in the list and key to search. Output : Returns 1 if the key is found otherwise returns 0. LSEARCH(LIST, N, KEY) [LIST is an array of numbers, N is the size of the array and KEY is the number to search] Repeat For I=0,1,2,3.....N-1   [Assuming that array index start from 0] If (KEY == LIST[I] ) Then: Return 1 [End of If] Return 0 Exit.

How to Implement User Defined Function in SQL

Similar to the stored procedures, you can also create functions to store a set of T-SQL statements permanently. These functions are also referred to as user-defined functions (UDFs). A UDF is a database object that contains a set of T-SQL statements, accepts parameters, performs an action, and returns the result of that action as a value. The return value can either be a single scalar value or a result set. UDFs have a limited scope as compared to stored procedures. You can create functions in situations when you need to implement a programming logic that does not involve any permanent changes to the database objects outside the function. For example, you cannot modify a database table from a function. UDFs are of different types: scalar functions and table-valued function. As a database developer, it is important for you to learn to create and manage different types of UDFs. Creating UDFs A UDF contains the following components: Function name with optional schema/owner name

Calling a Procedure from another Procedure: SQL

At times, you might need to use the values returned by a procedure in another procedure. For this, you can execute or call one procedure from within another procedure. A procedure that calls or executes another procedure is known as the calling procedure, and the procedure that is called or executed by the calling procedure is termed as the called procedure. You can also execute a procedure from another procedure if you need to use the functionality provide by one into another. Consider the previous example where the prcGetEmployeeDetail procedure returns the employee details for a given employee ID. You can create the prcDisplayEmployeeStatus procedure, which accepts the employee ID of an employee as input and displays the department name and shift ID where the employee is working along with the manager ID and the title employee. To perform this task, you need to call the prcGetEmployeeDetail procedure from the prcDisplayEmployeeStatus procedure, as shown in the following stateme

How to Return values from Stored Procedure: SQL

Similar to providing input values to the procedures at run time, you can also return values as output from the procedures. The values can be returned to the calling application through output parameters. To specify a parameter as the output parameter, you can use the OUTPUT keyword. The OUTPUT keyword has to be specified in both the CREATE PROCEDURE and the EXECUTE statement. If the OUTPUT keyword is omitted, the procedure will be executed but will not return any value. The syntax of the declaring an output parameter using the OUTPUT keyword is: CREATE PROCEDURE procedure_name [ { @parameter data_type} [OUTPUT] ] AS Sql_statement […n] @parameter data_type [OUTPUT] allows the stored procedure to pass a data value to the calling procedure. If the OUTPUT keyword is not used, then the parameter is treated as an input parameter. You can also return values from the stored procedure by using the RETURN statement. The RETURN statement allows the stored procedure to return o

How to Create Parameterized Stored Procedure: SQL

At times, you need to execute a procedure for different values of a variable that are provided at run time. For this, you can create a parameterized stored procedure. Parameters are used to pass values to the stored procedure during run time. These values can be passed by using standard variables. The parameter that passes the values is defined as input parameter. A stored procedure has the capability of using a maximum of 2100 parameters. Each parameter has a name, data type, direction, and a default value. The following example creates a stored procedure displaying the employee ID, the login ID, and title of the employees that have the same title provided as an input during Execution: CREATE PROC prcListEmployee @title char (50) AS BEGIN PRINT ‘List of Employees’ SELECT EmployeeID, LoginID, Title FROM HumanResources.Employee WHERE Title = @title END Execute the stored procedure, prcListEmployee, by using the following statement: EXECUTE prcListEmployee ‘Tool Desi

Guidelines to Create and Execute Stored Procedure: SQL

To create stored procedure database developer have to keep some points in mind. The following points need to be considered before creating a stored procedure: You cannot combine the CREATE PROCEDURE statement with other SQL statements in a single batch. You must have the CREATE PROCEDURE permission to create a procedure in the database and the ALTER permission on the schema, where the procedure is being created. You can create a stored procedure only in the current database. After creating a stored procedure, you can execute the procedure. You can also alter the procedure definition or drop it, if not required. Executing a Stored Procedure A procedure can be executed by using the EXEC PROCEDURE statement. The syntax of the EXEC PROCEDURE statement is: EXEC | EXECUTE PROCEDURE proc_name AS [ { LOGIN|USER} = ‘name’] Where, Proc_name , is the name of the procedure you need to execute. LOGIN|USER specifies the name of the login of another user on the same database serve

Characteristics of Programming : C Language

Now, let us see “What is programming? What are the characteristics of good programming?” Definition: The art of writing or designing the programs to provide a solution to the well-defined problem is called programming. As the saying goes ‘practice makes a man perfect’, developing such an art requires thorough practice. The following 10 characteristics if followed in a proper way will improve the quality of programming : Characteristics of good Programming: Accurate Efficient Maintainable Portable Readable Reliable Robust Usable Documentation Indentation Now, let us see, “the characteristics of programming” in detail. Accurate: The programming of a program is based on a certain problem. The problem must be pie-defined clearly with specification of requirements. It is expected from the programmer to design a program that strictly follows these requirements. So, the designed program must be accurate to perform the specified task. Such characteristic of pro

Life Cycle of applet

In the previous article, we have already learned about basics of applet . Life Cycle of applet 1 . init() : init method is used to initialize the applet. Before doing anything, must to initialized, so same thing with the applet. Like, in the games. Before play any games, must to initialized all the  drivers in the system, which is necessary for the games. In the applet, init method is invoked only once, also that method invoked after param tag, which is inside in <applet></applet> tag. 2 . start() : This is invoked after the initialization completed. It is used to start the applet, also automatic start. When user navigate to the web page, if web page contain applet code then it start automatically also start when user moves from other web pages. 3 . paint () : This method is invoked just after start() method. Actually only this method is responsible to design the applet, also responsible for repaint the browser, if applet is stooped. It has contain graph

Basics of applet

Applet is a small java program that run in browser, but JVM is required for run applet in browser. Basically applet is used where user want to put some dynamic content into html page. There are some features and advantages of Applet Features: It is a java class file, which is inherit from java.applet.Applet class. A applet class file don't take main() method for entry point. Applet codes are embedded in HTML page For run the applet code in browser, must to install JVM in the client machine During the execution of applet code in browser, code first to download in the client machine. Advantages: Very less response time because Applet designed for client machine. If applet is used for server machine then server take more time to execute applet code. More secure Platform independent, so it can run on any platform that is windows, Linux, UNIX, etc. Use for dynamic application Disadvantages of applet For run to its code in browser, must to installed JVM plugi

Forms of JavaBeans

In the previous article, we have already learn about basic concept of java bean , today i am talking about java beans forms. Java Beans can appear in two forms: Visual Non visual. Visual is more common, as the majority of Java Beans are extensions of Swing or AWT components. Some Beans may be simple GUI elements such as a specialized button or slider. Others may be sophisticated visual software components such as a diagram component offering different ways to present the bounded data. They all have in common that they can be customized at design time in a builder tool. Java Beans can also be non visual yet still be customizable using a builder-tool. They do not have to be derived from a specific class or interface, it is recommended that they implement the Serializable interface. In respect of the source code there is no real difference noticeable between a Java Bean and a “normal” Java class. Basically what differs the source code of a “normal” class from a Java Bean is that

Introduction of JavaBeans

A Java Bean is a software component that has been designed to be reusable in a variety of different environments. There is no restriction on the capability of a Bean. It may perform a simple function, such as checking spelling of a document, or a complex function, such as forecasting the performance of a stock portfolio. A Bean may be visible to an end user. One example of this is a button on a graphical user interface. A Mean may also be invisible to a user. Software to decode a stream of multimedia information in real time is an example of this type of building block. A Bean may be designed to work autonomously on a user’s workstation or to work in cooperation with a set of other distributed components. Software to generate a pie chart from a set of data points is an example of a Bean that can execute locally. A Bean that provides real-time price information from a stock or commodities exchange would need to work in cooperation with other distributed software to obtain its data.

File types, Text and Binary in C

As discussed earlier the C language provides flexibility for the programmers to write file handling programs to store and process data. Such data files contain the data effectively in two formats. So, on the basis of the format structure of the files are of two types, Text File and Binary File. Text File In a text file a stream of characters are stored sequentially without any formatting. So, it is very simple to handle but direct access is not possible because any value or character is not stored after fixed number of bytes. Even though the numbers are stored in the form of characters only and the record length is not fixed if the records are stored. Again the records are also stored in the character format of the individual fields. Similarly, since text files only process characters, generally they can only read or write data one character at a time. But the flexible C Language provides file handling functions to read and write formatted data and lines of text in a text fil

Online Movie ticket booking System project in ASP.NET

Introduction   Through this software, You can reserve your movie hall ticket online. Basically this system categories in two parts, the first part related to visitor who want to book ticket and second part is related to admin who handle all the privileges like user account, payment account etc. When visitors visit the home page of this site then they will see the first interface of the project that is movie name with full description and book now button. When visitors click on book now button then they will go to the next page that is login page. If the visitors are authenticated person then no need to register again, simply login into the account. After login they will see the seat no , visitor can reserve multiple seat at a time. Module of the project Viewer module Admin module Software requirement to run this software Visual Studio 2013 and windows 8 How to run this project 1. First to open the project in visual studio 2013  2. Click to green color of trian