Saturday, November 24, 2012

HTTP request without browser

For this we use WebRequest class.This class  has a GetResponse() method that is used to send request to the address specified by URL.

Steps to be followed:
1.Start Visual Studio and open Console Application.
2.Add two namespaces using System.Net and using System.IO.
3.Add following code mentioned in the below screenshot in method
static void Main(string[] args){}

4.Run the program by pressing Ctrl+F5.Visual Studio starts a Console for us and runs the program.After a couple of moments, we can see some HTML on your screen.

Sunday, November 11, 2012

SQL Injection-An Introduction

SQL Injection is a technique to potentially impact the system of web world. It is used to take advantage of available vulnerable points of the system. It is just like inserting a SQL statement to be run on our database without information and confirmation to take full advantage of weak point. For example, in a registration or login page of a web system, instead of entering required information we used to enter SQL statement and force to run on our database to get their information from the database.
For example let's take a SQL statement
Select * from employee where first_name='"+first_name+"';
Here user is asked to enter first name and if user enter first_name as pawan then SQL statement would be similar to Select * from employee where first_name='pawan';
But if user enter first_name as pawan;drop table employee-- then SQL statement would be similar to  
Select * from employee where first_name='pawan';drop table employee--
Here the semicolon (;) denotes the end of one query and the start of another. The double hyphen (--) indicates that the rest of the current line is a comment and should be ignored. Here the modified code is syntactically correct and hence it will be executed by the server. But when SQL Server processes this statement, SQL Server will first select all records in employee where first_name is pawan. Then, SQL Server will drop table employee.


Saturday, November 10, 2012

WPF-DataBinding-Example1

Working with WPF
Steps to be followed:

1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control StackPanel to MainWidow.xaml page.

3.Place the code selected in the below screenshots in between StackPanel tag.

4.Run the application by pressing F5 and see the output according to color we selected from the ListBox as below.






Saturday, November 3, 2012

WPF-Animation(Rotating balls moving along the path of ellipses)-Part Two

Working with WPF

Steps to be followed:
1.Start Visual Studio and follow the same path as mentioned in article. http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control Canvas to MainWidow.xaml page.
3.Place the code selected in the below screenshots in between Canvas tag.


4.Change the code in the specified class as given in the below screenshot.


5.Run the application by pressing F5 and rotating ball would be output as in below screenshot.




WPF-Animation-Part One

Working with WPF
Steps to be followed:
1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control DockPanel and Ellipse to MainWidow.xaml page.

3.Place the code selected in the below screenshot in between DockPanel tag.

4.Run the application by pressing F5 and animated ouput is in as in below screenshot.




Friday, November 2, 2012

WPF-Shape Drawing(Cylinder)-Part Two

Working with WPF
Steps to be followed:
1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html

2.Drag a control Canvas to MainWidow.xaml page and give dimensions (400,500).
3.Place the code selected in the below screenshot in between Canvas tag.

4.Run the application by pressing F5 and ouput is as in below screenshot.

WPF-Shape Drawing(Indian Flag)-Part One

A Shape is a type of UIElement that provides the functionalities to draw a shape to the screen and since it is UIElement, Shape objects can be used inside Panel elements and most controls.

WPF provides a number of predefined Shape objects that are inherited from the Shape class.
The Shape objects provided by Shape class are Line, Path, Rectangle, Polygon, Polyline and Ellipse. All Shape objects share some common properties such as Stroke, StrokeThickness and Fill.
Canvas panel is used to panel. So we will be considering it most of the time.
Drawing the Indian Flag
Steps to be followed.
1.Start Visual Studio and follow the same path as mentioned in article http://www.codingnodes.com/2012/11/window-presentation-foundation.html
2.Drag a control Canvas to MainWidow.xaml page and give dimensions (300,300).
3.Place the code selected in the below screenshot in between Canvas tag.

.
4.Run the application by pressing F5 and ouput is as in below screenshot.



Window Presentation Foundation - An Introduction

It is a formative, representative and graphical user interface framework provided by Microsoft to create interactive, dynamic and rich user experience. We can say that it is next generation user interface framework. It allows developing easily window applications. It coalesces application user interfaces, 2D graphics, 3D drawing, document and multimedia into one single architectural framework. It enables us to create visually stunning user interface.
Working with WPF

Steps to be followed:
1. Start Visual Studio and go to File->New->Project


2. New Project window will populate. Select WPF Application. Change name as we have changed to WpfExample and click on button OK .


3. WpfExample window will come and we can see App.xaml and MainWindow.xaml


Notes:
1. App.xaml (corresponding code file, App.xaml.cs or App.xaml.vb) which is used to store resources and provide availability throughout the entire window in our application and hence works as a global file for application wide declarations.
2. MainWindow.xaml is same as .aspx page in ASP.NET.Here XAML is used as markup language to create UI.

4. Place the code shown in below screenshot in between  .
                          

5. Run the application by pressing F5 and we can see the output as below.


Tuesday, October 30, 2012

Crystal Report-An Introduction

In general, report is a proper formatted output. In .NET framework, we can create report with the help of inbuilt reporting tools called crystal report. Crystal Report is a business intelligence application which is used to generates reports from a various types of data sources. It allows users to graphically design report layout and data connections. It provides the ability to create interactive, presentation-quality content. When we think of a report then it is obvious that we want to do at least three things such as create, modify and run a report against a data in the data base.


While creating a report, some important things need to be remembered.
1. Table name
2. Kind of data from table.
3. Manipulation on data to get required and informative result.
4. Way to format the report etc.

Silverlight-An Introduction

It is a powerful development tool for creating interactive user interface for window, web and mobile application. It is an application framework for creating rich internet applications. The runtime environment is available for silverlight as free plug-in powered by the .NET framework and compatible with any browser, device and operating system.
Working with Silverlight

Steps to be followed:
1. Start Visual Studio and go to File->New->Website.

2.New Web Site window will populate.Select ASP.NET Web Site and click on button Ok.


3. In Solution Explorer, right click on project name Silverlight and select Add New Item.


4. Add New Item window will populate.Select Silverlight Application from template list and click on button Add.


5. Add Silverlight Application window will populate.Click on button Ok.


6. Silverlight Application projet window will populate.


Notes:

1. Whenever we create new Silverlight Application project, it always contains two files such as  MainPage.xaml and App.xaml as well as code behind class files that are associated with them.
2. The App.xaml file is used to declare resources, such as brush and style objects that are shared across the application. The Application code-behind class for the App.xaml file can be used to handle application level events – such as
     1. Application Startup
     2. Application Exit and
    3. Application_UnhandledException.
3. The Page.xaml file is by default the initial UI control that is loaded when the application activates. Within it we can use UI controls to define our user interface, and then handle events off of them within the Page code-behind class.
4. Whenever we build our project, Visual Studio will by default compile the code and .XAML markup into a standard .NET assembly file, and then package it into .xap file.
5. Xap file is a compressed result of the silverlight application which contains application manifest file, compiled output assembly and other recourses used by silverlight application

7. Drag a control TextBlock from Toolbox inside Grid. Add a text attribute to the TextBlock element and sets it a value of “Hello World.”We can see Hello World in the Grid. in the below mentioned screenshot.


8. Run the application by pressing F5 and it will launch test web page that hosts our application.


Thursday, October 25, 2012

GridView-An Introduction

GridView
Displaying tabular data is most crucial work in software development.ASP.NET provides a number of tools or controls to fulfill this purpose. GridView control is one of them. It is the supergun of .net framework. It is most rich, featured and versatile control. It is used to display, update, delete and sort data from many types of data sources such as database, Xml files and business objects.
Working with GridView control
To use a GridView control, a DataSource control has to be attached to the GridView control. The property DataSourceID of the GridView control binds the GridView control to the DataSource control.
Steps to follow:
Before working with Gridview we require to create table with the help of any database vendor like SQL Server or Oracle or MSAccess or any other vendors.Here we are using SQL Server 2005 and created table Intro



1. Drag a GridView control from the toolbox pane to the ASP page.In design view click on GridView control ,GridView task box will display.


2. Click on New data source from dropdown list, Choose a Data Source Configuration Wizard window will come.
3. Select any data source. We select Sql data source and click on button OK.
4. Configure Data Source window will come. Click on button New Connection.
5. Choose Configure Data Source window will come. Select Microsoft SQL Server. Two options will populate in Data Provider dropdown list. Select .NET Framework Data Provider for SQL Server and click on button Continue.
6. Add Connection window will come. Enter Server name. For this SQL Server should install in our system.
7. When we will enter server name, Select or enter a database name dropdown list will be enabled and database names would populated in dropdown list. Select proper database and click on button Test Connection.
8. Test connection succeeded message box will populate and then click on button OK in message box.
9. Click on button OK in Add Connection window. Flow will come again on Configure Data Source window.
10. Click on button Next and again Next. We can see the columns of the table Intro.
11. Click on button Next and we will see Test Query option in Configure Data Source window where there is a button Test Query. On clicking on button Test Query we will see the data contained in Intro table. Click on button Finish.
12. We can see the columns mentioned in the table Intro.
13. Run this program by pressing F5 and we see the data is retrieved from the table Intro in Grid form in web page.




Wednesday, October 24, 2012

DataBound Control in .NET

A web application or window application is worthy when we introduce data access in the application and its mapping with application. To map data access to our application .net framework provides DataBound control.

DataBound control is used to show data in our application with the help of DataSource control. DataBound control can be used to display data and modify data according to requirement in our application.
We can work with a DataBound control by binding it to a DataSource control such as SqlDataSource or ObjectDataSource or AccessDataSource or LinqDataSource or XmlDataSource or EntityDataSource or SiteMapDataSorce control.The DataSource control connects to a data source such as database or xml or middle tier object and then retrieves or updates data.

There are three types of DataBound controls:
1. List control
2. Tabular control
3. Hierarchical control.

List control
There are five types of list control:
1. CheckBoxList
2. RadioButtonList
3. BulletedList
4. DropDownList
5. ListBox
CheckBoxList
It is used to display a list of check boxes and multiple selections can be possible.
RadioButtonList
It is used to display a list of radio buttons and only one selection can be possible.
BulletedList
It is used to display a bulleted list of items. Each item can be displayed a text or a link button or a hyperlink.
DropDownList
It is used to display a dropdown list. Only one item in the dropdown list can be selected.
ListBox
It is used to display a list box and multiple selections can be possible but depends on configuration that we define on items.

Tabular Control
There are six types of tabular control:
1. GridView
2. DataList
3. Repeater
4. ListView
5. DetailsView
6. FormView
Notes: GridView, DataList, Repeater and ListView display multiple data items at a time whereas DetailsView and FormView display single data at a time.
GridView
It is used to display a set of data items in a HTML table.We can use this control to display all the records contained in the table. This control supports sorting, paging and editing data.
DataList
It is used to display a set of data items in an HTML table. Unlike the GridView control, more than one data item can display in a single row.
Repeater
It is used to display a set of data items using a template. Unlike the GridView and DataList controls, this control does not automatically render an HTML table.
ListView
It is used to display a set of data items using a template. Unlike the Repeater control, this control supports sorting, paging and editing data.
DetailsView
It is used to display a single data item in an HTML table. We can use this control to display a single record contained in the table. This control supports sorting, paging, adding and editing data.
FormView
It is used to display a single data item using a template. Unlike the DetailsView ,this control allows to use to layout a form by using templates.

Hierarchical control
There are two types of hierarchical control:
1. Menu
2. TreeView
Menu
It is used to display a single data item in a static or dynamic menu.
TreeViewIt is used to display a single data item in a tree.

Monday, October 22, 2012

Saturday, October 20, 2012

Can a person fly?

There is a big contention on flying a person like a bird. Is this possible? Someone says “YES” and someone says “NO”. If possible then how it would achieve? For this we have to see how bird flies and then we would target to explore the concept.

Logically, when a bird flaps its wings, air is pushed downward. According to Newton’s 3rd law, this produces an opposite force that “lifts” the bird into the air. Since a bird’s body structure and specially its wing is in the shape of an airfoil, and hence it produces some lift even when the bird is just gliding.
But there are some birds like as penguins and ostriches that are not able to fly. What are the reasons? Is it same as human being? We will discuss later.

Wednesday, October 17, 2012

Tuesday, October 16, 2012

jQuery- An Introduction



There are many JavaScript library which provides additional features based on our requirements as Manipulation, Graphics, Tools based, Ajax based, Effect, Web application based, cryptography, Widget and miscellaneous.  Now we will check the DOM-manipulation javaScript library named jQuery.

We can also see more details about javaScript library JavaScript1 JavaScript2

jQuery is a kind of JavaScript library. It has changed the way that we write JavaScript. It is simple and provides more possibilities to create interactive web application. It simplifies HTML document traversing, even handling and Ajax interaction in rapid web application. It is used to create animation and more interactive website.

Copyright © Codingnodes,2014.All Rights Reserved.