Here is a tutorial I created about Web Development using ASP.NET. This is a "step-by-step" tutorial that will explain in detail how to create a simple website using ASP.NET and Microsoft Visual Studio 2008.
For this first tutorial I explained about the basic of creating and connecting a database in ASP.NET web page.
This tutorial will provide you the basic knowledge how to use Microsoft Visual Studio 2008 in developing your website.
In this tutorial we will use the C# language to perform some function such as connecting to database when the page is loaded. We will use the System.Data.Sql and System.Data.SqlClient class to perform this function.
We will use SqlConnection class to create an object for connecting to a Database. This can be done with code :
string connectionString = "//the connection string can be obtained in database properties";
SqlConnection connect = new SqlConnection(connectionString);
connect.Open()
In this tutorial, to read a database we will use SqlCommand and SqlDataReader class.
To read data from a table in the database can be done with the code :
SqlCommand command = new SqlCommand();
command.Connection = connect;
command.CommandText = "//this is the SQL Query needed";
SqlDataReader reader = command.ExecuteReader();
while(reader.Read())
{
//The code here..., to access a data in a field use the syntax -> reader["field_name"]
}
In this tutorial, to display a content to the web page we will use the InnerHtml attribute with this code :
string HTMLcode = "//a string that contain HTML tag to display some content";
div_ID.InnerHtml = HTMLcode;
Above, is a brief explanation about the tutorial. For a complete tutorial you can download the file in pdf format and you can download the source code from the link below :
ASP.NET Tutorial1.pdf
Source Code.rar
In the mean time I also will post a notes about Operating System - Introduction. But I still need a little time to finish it.
Best Regards,
Admin
ASP.NET Web Development - Introduction
Posted by
Lil`Gariel
Friday, July 17, 2009
at
9:42 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment