Sunteți pe pagina 1din 45

DEPARTMENT OF COMPUTER SCIENCE ALIGARH MUSLIM UNIVERSITY

ALIGARH (INDIA) Session 2009-2010

Project Report
DISTANCE LEARNING SYSTEM
(In ASP.NET with VB.NET and SQL Server)

Under the able guidance of:

Ms. PRITI BALA and Mr. ARMAN RASOOL FARIDI


Submitted by:

SANJEEV AGARWAL 07 MCA 17

GB 3286
Table Of Contents
1. Acknowledgement 2. Introduction about Project 3. System Study 3.1 About .NET Framework 3.2 About ASP.NET 3.3 About Visual Basic.NET 3.4 Feasibility Study -Economical -Technical -Operational 4. System Analysis 5. System Design -Use Case Diagrams -Database Design -Table Structure 6. Forms Layout 7. Sample Coding 8. System Testing -Testing -Implementation 9. References

ACKNOWLEDGEMENT
It is customary to preface such work as the present one without formal acknowledgement of guidance and help received from respected teachers but in fact these few words of thanks are not sufficient to express gratefulness to our teachers. At the outset, I would like to extend my heartfelt gratitude to Ms. PRITI BALA and Mr. ARMAN RASOOL FARIDI, for their wholehearted support. A special thanks to Ms. ARSHIA JALAL, for her help without which the project would not have been completed. I would also like to extend my thanks to honorable Mr S. MAHESHWARI, Chairman, Department of Computer Science, AMU Aligarh, for regular guidance and encouragement throughout my project. Last but not the least I would like to thanks the affordable cooperation and companionship of my friends and my parents. At last the greatest of all I thank the ALMIGHTY for his blessings and wishes that remains with me always.

(SANJEEV AGARWAL)

INTRODUCTION
The aim of this project (Distance Learning System) is to design and develop an automated package for managing the distance learning process via Internet. It provides access to various computer courses and resources for students and teachers. It provides online classes for the registered students for their subject of interest and also helps the students in analyzing their progress and understanding towards their subject through online test. It also generates certificate on the successful completion of the course along with the grade corresponding to the marks secured by the candidate in online tests. The purpose of this system is to help those unable to be on location for the learning process and recognize various new technologies. This project is developed in ASP.NET(VB.NET) and SQL server2005 (as back end).

Overview of .NET framework


The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives:

To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semitrusted third party. To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Webbased applications. To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.

The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of

reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services.

About ASP.NET
ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop ASP.NET applications that benefit from the common language runtime, type safety, inheritance, and so on. ASP.NET includes:

A page and controls framework The ASP.NET compiler Security infrastructure State-management facilities Application configuration Health monitoring and performance features Debugging support An XML Web services framework Extensible hosting environment and application life cycle management An extensible designer environment

In addition to the usual Web applications, ASP.NET allows you to create other types, which enables you to extend your applications' reach to new customers and business partners. For example, XML Web services enable sharing of data across the Internet regardless of the operating system and the programming language. We use ASP.NET Web pages as the programmable user interface for our Web application. An ASP.NET Web page presents information to the user

in any browser or client device and implements application logic using server-side code. ASP.NET Web pages are:

Based on Microsoft ASP.NET technology, in which code that runs on the server dynamically generates Web page output to the browser or client device. Compatible with any browser or mobile device. An ASP.NET Web page automatically renders the correct browser-compliant HTML for features such as styles, layout, and so on. Alternatively, you can design your ASP.NET Web pages to run on a specific browser such as Microsoft Internet Explorer 6 and take advantage of browserspecific features. Compatible with any language supported by the .NET common language runtime, including Microsoft Visual Basic, Microsoft Visual C#, Microsoft J#, and Microsoft JScript .NET. Built on the Microsoft .NET Framework. This provides all the benefits of the framework, including a managed environment, type safety, and inheritance. Flexible because you can add user-created and third party controls to them.

Components of ASP.NET Web Pages


In ASP.NET Web pages, user interface programming is divided into two pieces: the visual component and the logic. If you have worked with tools like Visual Basic and Visual C++ in the past, you will recognize this division between the visible portion of a page and the code behind the page that interacts with it. The visual element consists of a file containing static markup such as HTML or ASP.NET server controls or both. The ASP.NET Web page works as a container for the static text and controls you want to display. The logic for the ASP.NET Web page consists of code that you create to interact with the page. The code can reside either in a script block in the page or in a separate class. If the code is in a separate class file, this file is referred to as the code-behind file. The code in the code-behind file can be written in Visual Basic, Visual C#, Visual J#, or JScript .NET. ASP.NET Web pages are compiled into a dynamic-link library (.dll) file. The first time a user browses to the .aspx page, ASP.NET automatically generates a .NET class file that represents the page and then compiles it. The .dll file runs on the server and dynamically produces the HTML output for your page. Web application programming presents challenges that do not typically arise when programming traditional client-based applications. Among the challenges are:

Implementing a rich Web user interface It can be difficult and tedious to design and implement a user interface using basic HTML facilities, especially if the page has a complex layout, a large amount of dynamic content, and full-featured user-interactive objects. Separation of client and server In a Web application, the client (browser) and server are different programs often running on different computers (and even on different operating systems). Consequently, the two halves of the application share very little information; they can communicate, but typically exchange only small chunks of simple information. Stateless execution When a Web server receives a request for a page, it finds the page, processes it, sends it to the browser, and then discards all page information. If the user requests the same page again, the server repeats the entire sequence, reprocessing the page from scratch. Put another way, a server has no memory of pages that

it has processedpage are stateless. Therefore, if an application needs to maintain information about a page, its stateless nature can become a problem. Unknown client capabilities In many cases, Web applications are accessible to many users using different browsers. Browsers have different capabilities, making it difficult to create an application that will run equally well on all of them. Complications with data access Reading from and writing to a data source in traditional Web applications can be complicated and resource-intensive. Complications with scalability In many cases Web applications designed with existing methods fail to meet scalability goals due to the lack of compatibility between the various components of the application. This is often a common failure point for applications under a heavy growth cycle.

Meeting these challenges for Web applications can require substantial time and effort. ASP.NET Web pages and the ASP.NET page framework address these challenges in the following ways:

Intuitive, consistent object model The ASP.NET page framework presents an object model that enables you to think of your forms as a unit, not as separate client and server pieces. In this model, you can program the page in a more intuitive way than in traditional Web applications, including the ability to set properties for page elements and respond to events. In addition, ASP.NET server controls are an abstraction from the physical contents of an HTML page and from the direct interaction between browser and server. In general, you can use server controls the way you might work with controls in a client application and not have to think about how to create the HTML to present and process the controls and their contents. Event-driven programming model ASP.NET Web pages bring to Web applications the familiar model of writing event handlers for events that occur on either the client or server. The ASP.NET page framework abstracts this model in such a way that the underlying mechanism of capturing an event on the client, transmitting it to the server, and calling the appropriate method is all automatic and invisible to you. The result is a clear, easily written code structure that supports event-driven development. Intuitive state management The ASP.NET page framework automatically handles the task of maintaining the state of your page and its controls, and it provides you with explicit ways to maintain the state of application-specific information. This is accomplished

without heavy use of server resources and can be implemented with or without sending cookies to the browser. Browser-independent applications The ASP.NET page framework enables you to create all application logic on the server, eliminating the need to explicitly code for differences in browsers. However, it still enables you to take advantage of browser-specific features by writing client-side code to provide improved performance and a richer client experience. .NET Framework common language runtime support The ASP.NET page framework is built on the .NET Framework, so the entire framework is available to any ASP.NET application. Your applications can be written in any language that is compatible that is with the runtime. In addition, data access is simplified using the data access infrastructure provided by the .NET Framework, including ADO.NET. .NET Framework scalable server performance The ASP.NET page framework enables you to scale your Web application from one computer with a single processor to a multi-computer

About Visual basic.NET


Visual Basic and C# both have RAD (rapid-application development) support in Visual Studio .NET, with project templates, designers, and other features of the development environment. Both languages use the .NET Framework base classes. Visual Basic .NET, the next generation of the Visual Basic language, is designed to be a fast and easy way to create .NET applications, including XML Web services and ASP.NET Web applications. Visual Basic .NET has many new and improved features such as inheritance, interfaces, and overloading that make it a powerful object-oriented programming language. Other new language features include free threading and structured exception handling. Visual Basic .NET fully integrates the .NET Framework and the Common Language Runtime, which together provide language interoperability, garbage collection, enhanced security, and improved versioning support.

Feasibility Study
The viability of the system is checked. The check is done under the following heads. (A) Technical (B) Operational (C) Economical Technical:This is a study with respect to the machines to be used for the new system. Whether with the hardware/software available with the user the new system can be developed or not. The user is to be told what new hardware/softwares are to be procured. The user is to be given a set of options from which best on is chosen. At times the user needs to be guided by the system team for such selection. Operational:-Deals with the human aspect of the organization. It is seen whether with the existing manpower, the new system can be handled efficiently of not. If the users are not taken into confidence, resentment from them is inevitable. The users are to be convinced about the advantages of the new system. Economical:It is seen whether the expenditure incurred for developing the new system will be cost effective or not. This basically involves the top level management of the company who are the decision makers. At the end of the feasibility study, a report is prepared and submitted to the user for his approval. It is highly probable that the initial report does not come up to with in the possible limit till it is approved by the user. A repeated study is done till the system become feasible for both, the user and the system development team.

System Analysis
The need for developing a new system arises due to the following reasons. (A) Lack of satisfaction on the performance and effectiveness of the present system. (B) Anticipation of future information requirements. It is the study of the existing system. It is done to find out the facilities being offered by the system as well as its short comings in it. This is necessary because the user would expect that the new system will not have these shortcomings in it. To meet this objective, it is essential that the people who actually handle the system/would be handling the new system are involved in this analysis. This is done at the following two levels. (a) Preliminary Analysis (b) Detailed Analysis

Preliminary Analysis:It is done at the initial stage of the systems study. It does not deal with the detailed study of the system. Basic working of the system and the problems faced are found out. It is extremely important to note that no solutions to the problems are given at this stage. It helps the user to decide whether to go for the development of the new system or to continue with the current one.

Detailed Analysis:Once the approval from the user id obtained for the development of the system, the detailed analysis commences. The existing system is studied in the maximum possible details. The analysis is very effective if the user is fully aware of the potential of the system currently in use. At times the solution to the problem being faced by the user lies in the system itself and the user is quite unaware of the fact. If the system analyst is also aware of the Line of Business of the user then the understanding/analysis of the system becomes rather simple. However, under all the circumstances the user should be ready with the problems being faced in the current system and also the expectations from the new system. Future analysis to be more

result oriented, it is advisable that all the direct users who are handling the system presently should be involved in the study to obtain the first hand information. It is done in a structured manner and all the information related to the system is incorporated in the study. Some specific tools are used to perform the study. They are (A) Decision Table (a)Limited Entry Decision Table (b)Extended Entry Decision Table (c)Mixed Entry Decision Table (B) Decision Tree (C) Structured English--- Three steps involved in this (a)Sequence (b)Selection (c)Iteration

Use-case Diagrams

For Student

Course Details
extends

BackLevel to Previous

Level Qualification Test ________________________ not qualified

Student Registration Student

Student Login

E Classes

Payment

For Administrator

Student Details

Faculty Details

Certificate Generation

Administrator

Library Management

Payment

For Lecturer

E Classes

Level Qualification Test Lecturer


uses

Test Paper Updation

System Design
The phase of system design comes after the Analysis.It is a schedule or plan a new system i.e. the Analyst plans the input and output of the new system its logic and physical devices to receive data generate information and store the result. It is specified how to meet requirements of the user as pointed out during the System Analysis phase. Since System design involves all the aspects of the system. It is indeed a very exhaustive design for all kind of the system. Consequently; the designing needs to be done module wise. When the design involves the input, output, files and procedures used to achieve the objectives of the system. It is called the Logical Design. When the design involves the actual implementation of the system programs to accomplish the task. It is called the Physical Design. System design is divided into three heads. (A) Input Design (B) Output Design (C) File Design Input Design:-It consists of data preparation, data capture and data entry. Care is taken to minimize the data to be captured. No redundant data is to be captured. The layout of the input document should be such that it is easily understandable by the operator. Output Design:The objective of the output design is to produce timely, accurate and relevant information in an user understandable manner. It is most direct method of communication the result of the system to the user. File Design:-In this it is seen which data items need to be stored. What will be length of the record in a file. The arrangements of the records in a file is ascertained. It may be noted here that the actual storage (physical records) will differ form the way the user wants to view then (logical records).

Database Design
During file design, the files are designed individually with respect to the data items, records structure, storage etc. Database is repository of data which has all the files physically stored in it.It is also called the data bank. In the conventional file storage, files were created separately for applications which has lots of data in common but stored separately leading to a waste of disk space. Database should not have nay redundancy present in it, nor should have incomplete or contradictory data. The program which stores, organizes and retrieves data from database known as DBMS.

Normalization:--Normalization is the process of putting things right making them normal. In a relational database the term also has a specific mathematical meaning having to do with separating elements of data (such as names, address). Normalization means to reduce the complexity of data. Some of the common type of the normal forms are given below. (A) First Normal Form (B) Second Normal Form (C) Third Normal Form

First Normal Form:-Un-normalized data is put into the two separate tables to normalize. In this form we see that data should not be repeated.

Second Normal Form:All non-key attributes (fields) should depend upon the key attribute, in other words functional dependency must be maintained.

Third Normal Form:All non-key attributes should depend only upon the key attribute, in other words transitional dependency is to be removed.

Table Structure
The structures of the tables are as follows: TABLE NAME : Student -------------------------------------------------------------------------------------------Field Type Length Description -------------------------------------------------------------------------------------------Username Varchar 50 User Name (p) Password Varchar 50 Password Fname Varchar 50 First Name Lname Varchar 50 Last Name Fathername Varchar 50 Fathers Name Address Varchar 200 Address State Varchar 50 State Name Pincode Varchar 10 Pincode Phone Varchar 15 Phone No. Emailid Varchar 50 Email ID DOB Datetime Date of birth Qualification Varchar 50 Highest Qualification Courseid Varchar 50 Course ID Draftno Varchar 10 Draft No. Regdate Datetime Registration Date Sdate Datetime Start Date Enddate Datetime End Date Status Boolean Current Status -------------------------------------------------------------------------------------------This table stores the details of registered students. Username is primary key.

TABLE NAME : Course -------------------------------------------------------------------------------------------Field Type Length Description -------------------------------------------------------------------------------------------Courseid Varchar 50 Course Id(p) Coursename Varchar 500 Course Name Duration Numeric Course Duration Fees Numeric Course fee -------------------------------------------------------------------------------------------This table contains the details of various courses available.

TABLE NAME : Test -------------------------------------------------------------------------------------------Field Type Length Description -------------------------------------------------------------------------------------------Quesid Numeric Question ID(p) Ques Varchar 100 Question Opt1 Varchar 100 First Option Opt2 Varchar 100 Second Option Opt3 Varchar 100 Third Option Opt4 Varchar 100 Fourth Option Ans Numeric Correct option no. -------------------------------------------------------------------------------------------This table contains all questions for online test.

Forms Layout

Sample coding
Imports System.Data Imports System.Data.SqlClient Partial Class stureg Inherits System.Web.UI.Page Dim constr As String = "data source=SANJEEV\SQLEXPRESS; initial catalog=dls; integrated security=true" Dim con As New SqlConnection(constr) Dim da As New SqlDataAdapter("select * from tblstudent", con) Dim ds As New DataSet Dim dr As DataRow Dim objcom As New SqlCommand Dim objparam As New SqlParameter Dim i, flag As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (IsPostBack = False) Then For i = 1960 To 2000 ddlyear.Items.Add(i) Next For i = 1 To 31 ddlday.Items.Add(i) Next End If End Sub Protected Sub btsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btsubmit.Click If tbusername.Text = "" Then lblmsg.Text = "Enter user name.." tbusername.Focus() Else objcom.CommandText = "spDLScheckusername" objcom.Connection = con objcom.CommandType = CommandType.StoredProcedure objparam = objcom.Parameters.Add("@username", SqlDbType.VarChar) objparam.Value = tbusername.Text Try con.Open() If (CStr(objcom.ExecuteScalar) = "") Then

Student Registration

lblmsg.Text = "Congrats!!Specified Username is available for you.."


lbldatemsg.Text = "" flag = 0 ' con.Open() da.Fill(ds, "tblstudent") dr = ds.Tables("tblstudent").NewRow dr("username") = tbusername.Text dr("password") = tbpassword.Text dr("fname") = tbfname.Text dr("lname") = tblname.Text dr("fathername") = tbfathername.Text

dr("address") = tbaddress1.Text + tbaddress2.Text dr("state") = ddlstate.Text dr("pincode") = tbpincode.Text dr("phone") = tbphone.Text dr("emailid") = tbemailid.Text Try dr("dob") = CDate(ddlmonth.SelectedIndex.ToString + "/" + ddlday.Text + "/" + ddlyear.Text) Catch ex As Exception lbldatemsg.Text = "* Invalid Date" flag = 1 End Try dr("qualification") = ddlqualification.SelectedValue 'generate courseid corresponding to the coursename Dim objcom1 As New SqlCommand objcom1.CommandText = "spDLSgetcourseid" objcom1.Connection = con objcom1.CommandType = CommandType.StoredProcedure Dim objparam1 As New SqlParameter objparam1 = objcom1.Parameters.Add("@coursename", SqlDbType.VarChar) objparam1.Value = ddlcourse.Text dr("courseid") = CStr(objcom.ExecuteScalar) dr("draftno") = tbdraft.Text dr("regdate") = Today.Date dr("sdate") = Today.Date.AddDays(15) dr("edate") = Today.Date.AddDays(15).AddMonths(1) dr("status") = "false" ds.Tables("tblstudent").Rows.Add(dr) Dim obj As New SqlCommandBuilder(da) da.Update(ds, "tblstudent") Response.Cookies("username").Value = Response.Cookies("password").Value = Else Response.Redirect("afterstureg.aspx")

tbusername.Text tbpassword.Text

lblmsg.Text = "Specified Username already exists,choose another one.." tbusername.Focus() End If Catch ex As Exception If flag <> 1 Then lblmsg.Text = ex.Message End If lblmsg.Text = ex.Message End Try End If con.Close() End Sub Protected Sub linkcheck_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles linkcheck.Click

If tbusername.Text = "" Then lblmsg.Text = "Enter user name.." tbusername.Focus() Else objcom.CommandText = "spDLScheckusername" objcom.Connection = con objcom.CommandType = CommandType.StoredProcedure objparam = objcom.Parameters.Add("@username", SqlDbType.VarChar) objparam.Value = tbusername.Text Try con.Open() If (CStr(objcom.ExecuteScalar) = "") Then lblmsg.Text = "Congrats!!Specified Username is available for you.." Else lblmsg.Text = "Specified Username already exists,choose another one.." tbusername.Focus() End If Catch ex As Exception lblmsg.Text = ex.Message Finally con.Close() End Try End If End Sub End Class

Student Login
Imports System.Data.SqlClient Imports System.Data Partial Class stulogin Inherits System.Web.UI.Page Dim constr As String = "data source=SANJEEV\SQLEXPRESS; initial catalog=dls; integrated security= true" Dim con As New SqlConnection(constr) Dim objcom As New SqlCommand("spDLSstudentlogin", con) Dim objparam As New SqlParameter Dim da As New SqlDataAdapter("select * from tblstudent", con) Dim ds As New DataSet Dim dr As DataRow Dim fname As String Protected Sub btlogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btlogin.Click objcom.CommandType = CommandType.StoredProcedure objparam = objcom.Parameters.Add("@username", SqlDbType.VarChar) objparam.Value = tbusername.Text objparam = objcom.Parameters.Add("@password", SqlDbType.VarChar) objparam.Value = tbpassword.Text con.Open() fname = objcom.ExecuteScalar() da.Fill(ds, "tblstudent") If (fname <> "") Then Response.Cookies("username").Value = tbusername.Text Response.Cookies("fname").Value = fname Response.Cookies("status").Value = 1 Response.Redirect("afterstulogin.aspx") Else lblmsg.Text = "Incorrect username or password" tbusername.Focus() tbpassword.Text = "" End If con.Close() End Sub End Class

Student ProfileUpdate
Imports System.Data Imports System.Data.SqlClient Partial Class stuprofile Inherits System.Web.UI.Page Dim constr As String = "data source=SANJEEV\SQLEXPRESS; initial catalog=dls; integrated security=true" Dim con As New SqlConnection(constr) Dim da As New SqlDataAdapter("select * from tblstudent", con) Dim ds As New DataSet Dim dr As DataRow Dim objcom As New SqlCommand Dim objparam As New SqlParameter Dim i, flag As Integer Protected Sub lnkedit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkedit.Click lbldatemsg.Text = "" lblmsg.Text = "" tbfname.ReadOnly = False tblname.ReadOnly = False tbfathername.ReadOnly = False tbaddress1.ReadOnly = False ddlstate.Enabled = True tbpincode.ReadOnly = False tbphone.ReadOnly = False tbemailid.ReadOnly = False ddlday.Enabled = True ddlmonth.Enabled = True ddlyear.Enabled = True ddlqualification.Enabled = True lnkupdate.Visible = True lnkcancel.Visible = True lnkedit.Visible = False End Sub Protected Sub lnkupdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkupdate.Click lbldatemsg.Text = "" lblmsg.Text = "" da.Fill(ds, "tblstudent") For i = 0 To ds.Tables("tblstudent").Rows.Count - 1 dr = ds.Tables("tblstudent").Rows(i) If dr("username") = tbusername.Text Then Exit For End If Next dr("fname") = tbfname.Text dr("lname") = tblname.Text dr("fathername") = tbfathername.Text dr("address") = tbaddress1.Text dr("state") = ddlstate.Text dr("pincode") = tbpincode.Text dr("phone") = tbphone.Text dr("emailid") = tbemailid.Text dr("qualification") = ddlqualification.SelectedValue Try

dr("dob") = CDate(ddlmonth.SelectedIndex.ToString + "/" + ddlday.Text + "/" + ddlyear.Text) Catch ex As Exception lbldatemsg.Text = "* Invalid Date" flag = 1 End Try Try Dim obj As New SqlCommandBuilder(da) da.Update(ds, "tblstudent") lblmsg.Text = "Profile Updated..." lblname.Text = dr("fname") + " " + dr("lname") If flag <> 1 Then tbfname.ReadOnly = True tblname.ReadOnly = True tbfathername.ReadOnly = True tbaddress1.ReadOnly = True ddlstate.Enabled = False tbpincode.ReadOnly = True tbphone.ReadOnly = True tbemailid.ReadOnly = True ddlday.Enabled = False ddlmonth.Enabled = False ddlyear.Enabled = False ddlqualification.Enabled = False lnkupdate.Visible = False lnkcancel.Visible = False lnkedit.Visible = True End If Catch ex As Exception If flag <> 1 Then lblmsg.Text = ex.Message End If Finally con.Close() End Try End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If IsPostBack Then If Request.Cookies("status").Value = 0 Then Response.Redirect("stulogin.aspx") End If End If If (Not IsPostBack) Then da.Fill(ds, "tblstudent") Try

lblname.Text = dr("fname") + " " + dr("lname")


For i = 1960 To 2000 ddlyear.Items.Add(i) Next For i = 1 To 31 ddlday.Items.Add(i)

tbusername.Text = Request.Cookies("username").Value

Next For i = 0 To ds.Tables("tblstudent").Rows.Count - 1 dr = ds.Tables("tblstudent").Rows(i) If dr("username") = tbusername.Text Then Exit For End If Next lblname.Text = dr("fname") + " " + dr("lname") tbfname.Text = dr("fname") tblname.Text = dr("lname") tbfathername.Text = dr("fathername") tbaddress1.Text = dr("address") ddlstate.Text = dr("state") tbpincode.Text = dr("pincode") tbphone.Text = dr("phone") tbemailid.Text = dr("emailid") ddlqualification.SelectedValue = dr("qualification") ddlday.SelectedValue = CDate(dr("dob")).Day ddlmonth.SelectedIndex = CDate(dr("dob")).Month ddlyear.SelectedValue = CDate(dr("dob")).Year Catch ex As Exception lblmsg.Text = ex.Message End Try End If End Sub Protected Sub lnkcancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkcancel.Click tbfname.ReadOnly = True tblname.ReadOnly = True tbfathername.ReadOnly = True tbaddress1.ReadOnly = True ddlstate.Enabled = False tbpincode.ReadOnly = True tbphone.ReadOnly = True tbemailid.ReadOnly = True ddlday.Enabled = False ddlmonth.Enabled = False ddlyear.Enabled = False ddlqualification.Enabled = False lnkupdate.Visible = False lnkcancel.Visible = False lnkedit.Visible = True End Sub End Class

Student password change


Imports System.Data Imports System.Data.SqlClient Partial Class stuchangepassword Inherits System.Web.UI.Page Dim constr As String = "data source=SANJEEV\SQLEXPRESS; initial catalog=dls; integrated security=true" Dim con As New SqlConnection(constr) Dim da As New SqlDataAdapter("select * from tblstudent", con) Dim ds As New DataSet Dim dr As DataRow Dim i, flag As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (Not IsPostBack) Then Try tbusername.Text = Request.Cookies("username").Value tbpassword.Focus() Catch ex As Exception End Try End If End Sub Protected Sub bnchange_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bnchange.Click flag = 0 lblmsg.Text = "" da.Fill(ds, "tblstudent") For i = 0 To ds.Tables("tblstudent").Rows.Count - 1 dr = ds.Tables("tblstudent").Rows(i) If dr("username") = tbusername.Text And dr("password") = tbpassword.Text Then flag = 1 Exit For End If Next If flag = 1 Then dr("password") = tbnewpassword.Text Dim obj As New SqlCommandBuilder(da) da.Update(ds, "tblstudent") lblmsg.ForeColor = Drawing.Color.Chocolate lblmsg.Text = "Password Changed Successfully..." Panel2.Visible = False Else lblmsg.ForeColor = Drawing.Color.Red lblmsg.Text = "*Incorrect Password" tbpassword.Focus() End If End Sub End Class

Online Test
Imports System.Data.SqlClient Imports System.Data Partial Class newtest Inherits System.Web.UI.Page Dim constr As String = "data source=SANJEEV\SQLEXPRESS; initial catalog=dls; integrated security=true" Dim con As New SqlConnection(constr) Dim da As New SqlDataAdapter("select * from tbltest", con) Dim ds As New DataSet Dim dr As DataRow Dim obj As New classstureg Dim ans(20), i, c, w, b As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (Not IsPostBack) Then con.Open() Panel1.Visible = False Wizard1.Visible = True da.Fill(ds, "tbltest") c = Now.TimeOfDay.Seconds Mod 10 Response.Cookies("c").Value = c Response.Write(c) dr = ds.Tables("tbltest").Rows((c + 1) Mod 10) lbquesno1.Text = 1 lbques1.Text = dr("ques") rbl1.Items(0).Value = dr("opt1") rbl1.Items(1).Value = dr("opt2") rbl1.Items(2).Value = dr("opt3") rbl1.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 2) Mod 10) lbquesno2.Text = 2 lbques2.Text = dr("ques") rbl2.Items(0).Value = dr("opt1") rbl2.Items(1).Value = dr("opt2") rbl2.Items(2).Value = dr("opt3") rbl2.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 3) Mod 10) lbquesno3.Text = 3 lbques3.Text = dr("ques") rbl3.Items(0).Value = dr("opt1") rbl3.Items(1).Value = dr("opt2") rbl3.Items(2).Value = dr("opt3") rbl3.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 4) Mod 10) lbquesno4.Text = 4 lbques4.Text = dr("ques") rbl4.Items(0).Value = dr("opt1") rbl4.Items(1).Value = dr("opt2") rbl4.Items(2).Value = dr("opt3") rbl4.Items(3).Value = dr("opt4")

dr = ds.Tables("tbltest").Rows((c + 5) Mod 10) lbquesno5.Text = 5 lbques5.Text = dr("ques") rbl5.Items(0).Value = dr("opt1") rbl5.Items(1).Value = dr("opt2") rbl5.Items(2).Value = dr("opt3") rbl5.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 6) Mod 10) lbquesno6.Text = 6 lbques6.Text = dr("ques") rbl6.Items(0).Value = dr("opt1") rbl6.Items(1).Value = dr("opt2") rbl6.Items(2).Value = dr("opt3") rbl6.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 7) Mod 10) lbquesno7.Text = 7 lbques7.Text = dr("ques") rbl7.Items(0).Value = dr("opt1") rbl7.Items(1).Value = dr("opt2") rbl7.Items(2).Value = dr("opt3") rbl7.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 8) Mod 10) lbquesno8.Text = 8 lbques8.Text = dr("ques") rbl8.Items(0).Value = dr("opt1") rbl8.Items(1).Value = dr("opt2") rbl8.Items(2).Value = dr("opt3") rbl8.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 9) Mod 10) lbquesno9.Text = 9 lbques9.Text = dr("ques") rbl9.Items(0).Value = dr("opt1") rbl9.Items(1).Value = dr("opt2") rbl9.Items(2).Value = dr("opt3") rbl9.Items(3).Value = dr("opt4") dr = ds.Tables("tbltest").Rows((c + 10) Mod 10) lbquesno10.Text = 10 lbques10.Text = dr("ques") rbl10.Items(0).Value = dr("opt1") rbl10.Items(1).Value = dr("opt2") rbl10.Items(2).Value = dr("opt3") rbl10.Items(3).Value = dr("opt4")

' Response.Write("ans(3)==" + ans(3).ToString) 'Page.Controls.Add(lbquesno(c)) 'Next con.Close() End If End Sub

Public Sub showques() 'Return ans End Sub Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick Wizard1.Visible = False Wizard1.EnableViewState = False rbl1.Enabled = False rbl2.Enabled = False rbl3.Enabled = False rbl4.Enabled = False rbl5.Enabled = False rbl6.Enabled = False rbl7.Enabled = False rbl8.Enabled = False rbl9.Enabled = False rbl10.Enabled = False Panel1.Visible = True da.Fill(ds, "tbltest") c = Request.Cookies("c").Value 'Response.Write("c=" + c.ToString) For i = 0 To ds.Tables("tbltest").Rows.Count - 1 dr = ds.Tables("tbltest").Rows((c + 1 + i) Mod 10) ans(i) = dr("ans") Next c = 0 If rbl1.SelectedIndex <> -1 Then If rbl1.SelectedIndex = ans(0) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl2.SelectedIndex <> -1 Then If rbl2.SelectedIndex = ans(1) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl3.SelectedIndex <> -1 Then If rbl3.SelectedIndex = ans(2) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl4.SelectedIndex <> -1 Then If rbl4.SelectedIndex = ans(3) - 1 Then c = c + 1

Else Else

w = w + 1 End If

b = b + 1 End If If rbl5.SelectedIndex <> -1 Then If rbl5.SelectedIndex = ans(4) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl6.SelectedIndex <> -1 Then If rbl6.SelectedIndex = ans(5) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl7.SelectedIndex <> -1 Then If rbl7.SelectedIndex = ans(6) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl8.SelectedIndex <> -1 Then If rbl8.SelectedIndex = ans(7) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl9.SelectedIndex <> -1 Then If rbl9.SelectedIndex = ans(8) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If If rbl10.SelectedIndex <> -1 Then If rbl10.SelectedIndex = ans(9) - 1 Then c = c + 1 Else w = w + 1 End If Else b = b + 1 End If

' Response.Write("ans(3)=" + ans(3).ToString + "rbl4.SelectedIndex=" & rbl4.SelectedIndex.ToString) lblcorrect.Text = c lblwrong.Text = w lblunans.Text = b lblmarks.Text = 4 * c - w If (4 * c - w) >= 35 Then lblperformance.Text = "Exellent" ElseIf (4 * c - w) >= 25 And (4 * c - w) < 35 Then lblperformance.Text = "Average" ElseIf (4 * c - w) < 25 And (4 * c - w) >= 15 Then lblperformance.Text = "Poor" Else lblperformance.Text = "Very Poor..Work hard" End If End Sub Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click Response.Redirect("afterstulogin.aspx") End Sub End Class

Imports System.Data Imports System.Data.SqlClient Partial Class coursedetail Inherits System.Web.UI.Page Dim constr As String = "data source=SANJEEV\SQLEXPRESS; initial catalog=dls; integrated security=true" Dim con As New SqlConnection(constr) Dim da As New SqlDataAdapter("select * from course", con) Dim ds As New DataSet Dim dr As DataRow Dim count, i As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ddlcourse.Focus() da.Fill(ds, "course") count = ds.Tables("course").Rows.Count - 1 If (Not IsPostBack) Then ddlcourse.Items.Add("Select") For i = 0 To count dr = ds.Tables("course").Rows(i) ddlcourse.Items.Add(dr("coursename")) Next End If End Sub Protected Sub ddlcourse_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlcourse.SelectedIndexChanged da.Fill(ds, "course") For i = 0 To count dr = ds.Tables("course").Rows(i) If (ddlcourse.SelectedValue = dr("coursename") And ddlcourse.SelectedValue <> "Select") Then lbcourseid.Text = dr("courseid") lbcoursefee.Text = "Rs. " + dr("coursefee").ToString lbcourseduration.Text = dr("courseduration").ToString + " months" Page.DataBind() Label3.Visible = True Label4.Visible = True Label5.Visible = True End If Next If ddlcourse.SelectedValue = "Select" Then lbcourseid.Text = "" lbcoursefee.Text = "" lbcourseduration.Text = "" Label3.Visible = False Label4.Visible = False Label5.Visible = False End If End Sub Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click Response.Redirect("homepage.aspx") End Sub End Class

Course detail

System Testing
Although a separate phase is allotted in the SDLC for testing the system, it is to be understood that the testing takes place throughout the system development in some form or the other Generally half of the budget of the total budget is spent on Testing. Testing is generally carried out under the following phases. (A) Preparation of Testing (B) Conduct of Test (C) Evaluation of the Test Results

Testing Strategies:There are many methods to test a system. However, the prime objective of all these methods is to find out errors present in the system. Some of the commonly used strategies for testing are discussed below. (a) Alpha Testing (b) Beta Testing (c) Unit Testing (d) Integrated Testing

Alpha Testing:Simulated data are generated by the programmer and the system is tested for the correctness of the result produced. The data used might have no meaning of their own. However, the nature, length and other properties have to the same as declared in the specifications.

Beta Testing:Instead of simulated data, the actual data are taken for testing. While alpha Testing is done at developers place and the beta testing id done at the users place. It is done by the user to ensure that the testing is unbiased and satisfactory.

Unit Testing:The programs are tested separately, independent of each other. Since the check is done at the program level, it is also called Program Testing. Cases are made individually for different programs. Testing is done either from the lowermost level to the uppermost level known as Bottom Up Testing or the other way around known as Top Down Testing.

Integration Testing:---Individually tested programs do not give any assurance that they will be working well when they put together. On the contrary, all errors related to integration emerge here, which were till now undiscovered. Errors at this stage occur mainly due to non compatibility of data amongst the programs.

System Implementation
After the system is developed and tested, it is needed to be implemented. It is a complex and time consuming process as it involves more number of people. The different method of implementation are discussed below. (a) Direct (b) Parallel (c) Pilot (d) Phase

Direct:It is known as Sudden Death method or Overnight method. The old system is abandoned and the new system is inducted. It involves minimum time in changeover. It can only be used if the staff is already trained to handle the new system. It proves to be very dangerous if the new system fails soon after the installation.

Parallel:Both the old and new are run together for some time. Comparison of the result for both the system is possible. Once the staff is confident of the new system, the old system is discontinued.

Pilot:The new system is installed in one section Or Department which runs as Pilot project. The other departments continue to maintain the old system. It satisfactory results are obtained from the new system, it is installed in another department also. The organization gradually gets accustomed to the new system.

Phase:The new system is implemented for any one activity of all the departments viz. data entry, data validations etc. This phase provides a positive result, the next phase is implemented thereafter. In this way the new system is implemented phase wise. Each phase of the new system is reviewed separately and changes made, if needed.

REFERENCES

ASP.NET in 21 Days. Visual Studio Professional 2005 by Wrox publication.


Visual Basic.NET, by NIIT.

Beginning SQL Server2005


Evan Bay Ross (DBMS)

S-ar putea să vă placă și