Search This Blog

Saturday, February 26, 2011

Installing Oracle Express - PART 1 - SQL LESSON 4

Express Tour of SQL - PART 2 - SQL LESSON 3

Express Tour of SQL - PART 1 - SQL LESSON 2

Introduction to SQL - SQL LESSON 1

SQL Server Tutorial - Introduction to 2008 (Beginning Query lesson on Si...

Sql bacis

To create an sql database .open SQL Server Management Studio Express.click new query.copy paste the below into that window( first create a database
using create database.then create a table in that using create table
below us the queries for that.)

create database Example
use Example

selct the two lines and click execute query.always select the lines which you want to run ,then only click execute query
now you created a database.next step is to create a table



--1.MemberLogin Table

create table MemberLogin       
(
Mid int primary key identity  not null,
MName nvarchar(50),
MPassword nvarchar(50),
MType nvarchar(50)
)

--2.Course details Table

create table CourseDetails      
(
Cdid int primary key identity  not null,
CourseName nvarchar(200),
Duration nvarchar(20),
CourseFee nvarchar(15),
Offer nvarchar(200),
Tax nvarchar(15),
TotalFee nvarchar(15),
LumpSum nvarchar(15),
Instalment nvarchar(15),
CourseType nvarchar(15)
)

select from (--4.MemberLogin Table) to (CourseType nvarchar(15) )) .now click on exicute query.if you click exicute query
without select the line you will get error


now you created the tables
to see the content of these table use select query

select * from Student
select * from CourseDetails

now you can see, there is no data in these table.so we have to use 'insert' command to insert data in to tables

insert into MemberLogin values('Admin','Admin','Admin')
insert into MemberLogin values('renju','renju','Staff')

we don't have to insert mid,becaue it is the primary key.it will incriment automatically.

to see the content of these table use select query again

select * from Student

now you can see datas in this table

now if you want to update the content you can use update query

update MemberLogin set MType='faculty'where mid=2

this will update the mtype of the row which has mid =2

now if you want to delete that row you

delete from MemberLoginwhere sid=2

it will delete the 2nd row

These are the four basic commands of sql.

Tuesday, February 15, 2011

ASP.NET Grid - How to Present Data in Cards

ASP.NET Grid - How to Delete Selected Rows

ASP.NET Gridview, dropdownlist, insert (2 of 2)

ASP.NET Gridview, dropdownlist, insert (1 of 2)

FormView Web Server Control

The FormView control gives you the ability to work with a single record from a data source, similar to the DetailsView control. The difference between the FormView and the DetailsView controls is that the DetailsView control uses a tabular layout where each field of the record is displayed as a row of its own. In contrast, the FormView control does not specify a pre-defined layout for displaying the record. Instead, you create a template containing controls to display individual fields from the record. The template contains the formatting, controls, and binding expressions used to create the form.
The FormView control is typically used for updating and inserting new records, and is often used in master/detail scenarios where the selected record of the master control determines the record to display in the FormView control. For more information and an example, see Modifying Data Using a FormView Web Server Control.
The FormView control relies on the capabilities of the data source control to perform tasks such as updating, inserting, and deleting records. The FormView control renders only a single data record at a time, even if its data source exposes multiple records.
The FormView control can automatically page over the data in its associated data source one record at a time, provided that the data is represented by an object implementing the ICollection interface, or that the underlying data source supports paging. The FormView control provides the user interface (UI) for navigating between records. To enable paging behavior, set the AllowPaging property to true and specify a PagerTemplate value.
The FormView control exposes several events that you can handle to execute your own code. The events are raised before and after insert, update, and delete operations of the associated data source control. You can also write handlers for the ItemCreated and ItemCommand events. For more information, see FormView Web Server Control Events.

Data Binding with the FormView Control

The FormView control provides you with these options for binding to data:
  • Data binding using the DataSourceID property, which allows you to bind the FormView control to a data source control. This is the recommended approach because it allows the FormView control to take advantage of the capabilities of the data source control and to provide built-in functionality for updating and paging.
  • Data binding using the DataSource property, which allows you to bind to various objects, including ADO.NET datasets and data readers. This approach requires you to write the code for any additional functionality such as updating and paging.
When you bind to a data source using the DataSourceID property, the FormView control supports two-way data binding. In addition to the control displaying data, you can enable the control to automatically support insert, update, and delete operations on the bound data.
For more information, see Data Source Web Server Controls.

Creating the FormView Control User Interface

You build the user interface (UI) for the FormView control by creating templates. You specify different templates for different actions. You create an ItemTemplate template for display, insert, and edit modes. You can control paging using a PagerTemplate template, and you can customize the FormView control's header and footer using a HeaderTemplate and FooterTemplate, respectively. Using an EmptyDataTemplate, you can also specify a template to display when the data source does not return any data. For more information, see Creating Templates for the FormView Web Server Control.
The item templates that you create for the FormView control specify the content of the control. As with the DetailsView control, you can also customize the display format of the FormView control by using style properties such as the EditRowStyle, EmptyDataRowStyle, FooterStyle, HeaderStyle, InsertRowStyle, PagerStyle, and RowStyle properties.

Sunday, February 13, 2011

CSS tutorial

CSS tutorial

CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style Sheets can save a lot of work External Style Sheets are stored in CSS files
An example of a style change would be to make words bold. In standard HTML you would use the <b> tag like so:
<b>make me bold</b>This works fine, and there is nothing wrong with it per se, except that now if you wanted to say change all your text that you initially made bold to underlined, you would have to go to every spot in the page and change the tag.
Another disadvantage can be found in this example: say you wanted to make the above text bold, make the font style Verdana and change its color to red, you would need a lot of code wrapped around the text:
<font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"> <strong>This is text</strong></font> This is verbose and contributes to making your HTML messy. With CSS, you can create a custom style elsewhere and set all its properties, give it a unique name and then ‘tag’ your HTML to apply these stylistic properties:
<p>My CSS styled text</p>And in between the tags at the top of your web page you would insert this CSS code that defines the style we just applied:
<style type="text/css"> .myNewStyle { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #FF0000; } </style>In the above example we embed the css code directly into the page itself. This is fine for smaller projects or in situations where the styles you’re defining will only be used in a single page. There are many times when you will be applying your styles to many pages and it would be a hassle to have to copy and paste your CSS code into each page.
Besides the fact that you will be cluttering up your pages with the same CSS code, you also find yourself having to edit each of these pages if you want to make a style change. Like with JavaScript, you can define/create your CSS styles in a separate file and then link it to the page you want to apply the code to:
<link href="myFirstStyleSheet.css" rel="stylesheet" type="text/css">The above line of code links your external style sheet called ‘myFirstStyleSheet.css’ to the HTML document. You place this code in between the <head> </head> tags in your web page.

gridview in asp.net

The ASP.NET GridView control is the successor to the v1.x DataGrid, adding the ability to take advantage of specific capabilities of ASP.NET data source controls. Whereas the v1.x DataGrid required a page developer to write custom code to handle simple operations such as paging, sorting, editing or deleting data, the GridView control can automatically handle these operations provided its bound data source control supports these capabilities. The GridView also offers some functionality improvements over the DataGrid, such as the ability to define multiple primary key fields, and some UI customization improvements, such as new field types and templating options. It also exposes a new model for page developers to handle or cancel events.

One of the key advantages of the GridView control over other data-bound controls is its ability to automatically take advantage of data source capabilities. Instead of relying on page code to manually sort or page data, the GridView control can perform these operations automatically as long as the data source is configured to support these operationsFollowing are some important properties that are very useful.
Behavior Properties of the GridView Control
AllowPaging true/false. Indicate whether the control should support paging.
AllowSorting true/false. Indicate whether the control should support sorting.
SortExpression Gets the current sort expression (field name) that determines the order of the row.
SortDirection Gets the sorting direction of the column sorted currently (Ascending/Descending).
DataSource Gets or sets the data source object that contains the data to populate the control.
DataSourceID Indicate the bound data source control to use (Generally used when we are using SqlDataSource or AccessDataSource to bind the data, See 1st Grid example).
AutoGenerateEditButton true/false. Indicates whether a separate column should be added to edit the record.
AutoGenerateDeleteButton true/false. Indicates whether a separate column should be added to delete the record.
AutoGenerateSelectButton true/false. Indicate whether a separate column should be added to selecat a particular record.
AutoGenerateColumns true/false. Indicate whether columns are automatically created for each field of the data source. The default is true.
Style Properties of the GridView Control
AlternatingRowStyle Defines the style properties for every alternate row in the GridView.
EditRowStyle Defines the style properties for the row in EditView (When you click Edit button for a row, the row will appear in this style).
RowStyle Defines the style properties of the rows of the GridView.
PagerStyle Defines the style properties of Pager of the GridView. (If AllowPaging=true, the page number row appears in this style)
EmptyDataRowStyle Defines the style properties of the empty row, which appears if there is no records in the data source.
HeaderStyle Defines the style properties of the header of the GridView. (The column header appears in this style.)
FooterStyle Defines the style properties of the footer of GridView.
Appearance Properties of the GridView Control
CellPadding Indicates the space in pixel between the cells and the border of the GridView.
CellSpacing Indicates the space in pixel between cells.
GridLines Both/Horizontal/Vertical/None. Indicates whether GrdiLines should appear or not, if yes Horizontal, Vertical or Both.
HorizontalAlign Indicates the horizontal align of the GridView.
EmptyDataText Indicates the text to appear when there is no record in the data source.
ShowFooter Indicates whether the footer should appear or not.
ShowHeader Indicates whether the header should appear or not. (The column name of the GridView)
BackImageUrl Indicates the location of the image that should display as a background of the GridView.
Caption Gets or sets the caption of the GridView.
CaptionAlign left/center/right. Gets or sets the horizontal position of the GridView caption.
State Properties of GridView Control
Columns Gets the collection of objects that represent the columns in the GridView.
EditIndex Gets or sets the 0-based index that identifies the row currently to be edited.
FooterRow Returns a GridViewRow object that represents the footer of the GridView.
HeaderRow Returns a GridViewRow object that represents the header of the GridView.
PageCount Gets the number of the pages required to display the reocrds of the data source.
PageIndex Gets or sets the 0-based page index.
PageIndex Gets or sets the number of records to display in one page of GridView.
Rows Gets a collection of GridViewRow objects that represents the currently displayed rows in the GridView.
DataKeyNames Gets an array that contains the names of the primary key field of the currently displayed rows in the GridView.
DataKeys Gets a collection of DataKey objects that represent the value of the primary key fields set in DataKeyNames property of the GridView.
Events associated with GridView Control
PageIndexChanging, PageIndexChanged Both events occur when the page link is clicked. They fire before and after GridView handles the paging operation respectively.
RowCancelingEdit Fires when Cancel button is clicked in Edit mode of GridView.
RowCommand Fires when a button is clicked on any row of GridView.
RowCreated Fires when a new row is created in GridView.
RowDataBound Fires when row is bound to the data in GridView.
RowDeleting,RowDeleted Both events fires when Delete button of a row is clicked. They fire before and after GridView handles deleting operaton of the row respectively.
RowEditing Fires when a Edit button of a row is clicked but before the GridView hanldes the Edit operation.
RowUpdating, RowUpdated Both events fire when a update button of a row is clicked. They fire before and after GridView control update operation respectively.
Sorting, Sorted Both events fire when column header link is clicked. They fire before and after the GridView handler the Sort operation respectively.

You cannot insert data into the database using the GridView control. However, you can do so by using the DetailsView and FormsView controls which ship with ASP.NET 2.0. I will discuss these controls in a forthcoming article. You should also note that the GridView control in ASP.NET 2.0 is a replacement to the popular DataGrid control in ASP.NET 1.1. 

  • The GridView control is associated with the DataSource control through its DataSourceID property.
  • In ASP.NET 2.0 there are several DataSource controls that are designed to work with different data sources.
  • Enabling Editing and Deleting records in the GridView Control is as simple as setting the properties “AutoGenerateDeleteButton” and “AutoGenerateEditButton” as "True"
  • GridView totally supports 6 field types, they are:
1. BoundField,

2. CheckBoxField,

3. ButtonField,

4. CommandField,

5. HyperlinkField,

6. ImageField and

7. TemplateField

Creating a GridView control on a Page

1. Create a Web site

2. Open the Default.aspx page in design view and drag a GridView control onto it.


3 For fetching records from a data source we need to add a SqlDataSource Control to the website. Click on the arrow and select

4. Click Ok. The Configuration Data Source wizard appears.


5. Click on New connection or select the connection for the application from the drop down list.

6. Next specify the columns that are to be bound to the GridView from the table.

Saturday, February 12, 2011

websites useful for asp dotnet beginners

www.asp.net/(official microsoft site)
www.dotnettutorials.com/
www.w3schools.com/aspnet/default.asp
www.dotnetspider.com/tutorials/ 
www.dotnetspider.com/  

quickstarts.asp.net/
www.startvbdotnet.com/
www.intelligentedu.com › Free Training and Courses
www.dotnet-guide.com/
www.aspspider.com/tutorials/
www.codeproject.com/KB/aspnet/aspnetintro.aspx
www.itechcollege.com/courses/ASP-NET
www.computer-training-software.com/asp-net.htm 
www.aspnet101.com › Tutorials
www.logolitic.com/asp-net-beginners-tutorial-1
www.skill-guru.com

ASP.NET basic

ASP.NET is the next generation ASP, but it's not an upgraded version of ASP. ASP.NET is an entirely new technology for server-side scripting.
ASP.NET is a part of the Microsoft .NET framework, and a powerful tool for creating dynamic and interactive web pages.
.NET is a major technology change for Microsoft and the software world. Just like the computer world moved from DOS to Windows, now they are moving to  .NET.

NET technology was introduced by Microsoft, to catch the market from the SUN's Java. Few years back, Microsoft had only VC++ and VB to compete with Java, but Java was catching the market very fast. With the world depending more and more the Internet/Web and java related tools becoming the best choice for the web applications, Microsoft seemed to be loosing the battle. Thousands of programmers moved to java from VC++ and VB. This was alarming for Microsoft and many of the Microsoft fan's kept on asking "is Microsoft sleeping?". And Microsoft had the answer. One fine morning, they announced : "We are not sleeping. We have the answer for you.". And that answer was .NET.
But Microsoft has a wonderful history of starting late but catching up quickly. This is true in case of .NET too. Microsoft put their best men at work for a secret project called Next Generation Windows Services (NGWS)., under the direct supervision of Mr. Bill Gates. The outcome of the project is what we now know as .NET. Even though .NET has borrowed most of it's ideas from Sun's J2EE, it has really outperformed their competitors.

Microsoft's VC++ was a powerful tool. But it was too complex. It has too many datatypes, and developers had to learn many libraries including WIndows SDK, MFC, ATL, COM etc. There were many datatype compatibility issues while exchanging data between different layers. Visual Basic was too easy, and many serious programmers hated it just for that reason. Even though Visual basic was very easy to use, it was not very flexible to develop serious applications. SUN's Java became a very good choice for these reasons. It had the flixibility and power of C++ and at the same time easy enough to catch the attention of VB programmers.

Microsoft recognised these factors and they introducd the .NET considering all these factors. All unwanted complexities are eliminated and a pure object oriented programming model was introduced. This makes programmer's life very easy.

.NET framework comes with a single class library. And thats all programmers need to learn!! Whether they write the code in C# or VB.NET or J#, it doesn't matter, you just use the .NET class library. There is no classes specific to any language. There is nothing more you can do in a language, which you can't do in any other .NET language. You can write code in C# or VB.NET with the same number of lines of code, same performance and same efficiency, because eveyone uses same .NET class library.