8-Create A Database For Student and Insert Value in Database Using SQL Server in Dot Net? ANS
8-Create A Database For Student and Insert Value in Database Using SQL Server in Dot Net? ANS
}
protected void Button2_Click(object sender, EventArgs e)
{
string sql;
sql = "update student set name=' " + name.Text + " ' where rollno=' " + rollno.Text + " '";
SqlConnection conn = null;
try
{
conn = new SqlConnection();
conn.ConnectionString =
ConfigurationManager.ConnectionStrings["mydatabase"].ConnectionString.ToString();
conn.Open();
SqlCommand cmd = null;
cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = sql;
cmd.ExecuteNonQuery();
message1();
}
catch (SqlException exp)
{
Response.Write("<hr>" + exp.Message.ToString() + "<hr>");
}
finally
{
conn.Close();
}
}
void message1(){
Response.Write("<hr>RECORD UPDATED SUCCESSFULLY<HR>");
rollno.Text = null;
name.Text = null;
branch.Text = null;
address.Text = null;
}
}
11. Show that grid view control for the above database?
ANS:-
12. Delete the some values form he above database by using sql delete
commond?
ANS:-
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
LAB REPORT
OF
“ASP DOT NET”
Submitted To:
The Microsoft .NET Framework is a software framework that can be installed on computers running
Microsoft Windows operating systems. It includes a large library of coded solutions to common
programming problems and a virtual machine that manages the execution of programs written specifically
for the framework. The .NET Framework is a Microsoft offering and is intended to be used by most new
applications created for the Windows platform. The .NET Framework family also includes two versions
for mobile or embedded device use. A reduced version of the framework, the .NET Compact Framework,
is available on Windows CE platforms.
Developer(s) Microsoft
Initial release February 13, 2002
Stable release 4.0.30319.1 (4.0) / 12 April 2010; 17 days ago
Windows XP SP3, Windows Vista SP1, Windows 7, Windows Server
Operating system
2008
Type Software framework
License MS-EULA, BCL under Microsoft Reference Source License
Website msdn.microsoft.com/netframework
What is .NET?
Since quite some time each person is talking about .NET, but what actually is .NET? In this Article i will
explain you the meaning and the advantages of .NET. The .NET Framework introduces a completely new
model for the programming and deployment of applications..NET is Microsoft's vision of "software as a
service", a development environment in which you can build, create, and deploy your applications and the
next generation of components, the ability to use the Web rather than your own computer for various
services. Microsoft introduced great technologies like COM, DCOM, COM+ etc. to enable reuse of
Software. Although these technologies are very powerful to reuse Software, they required a huge learning
curve. According to this aspect, Microsoft realized that its time to come up with a new Technology, a
better one, an easier one, a new Framework, within which each Programming Task is easy accomplished.
Microsoft changed all complex tasks with the new .NET Framework. That was a huge advantage
for all developers. Most of the Win32 API was now accessible through a very simple Object
Model. Most of the features and functions of C++ were added to Visual Basic. A new C# was
introduced, which offered flexibility and productivity. ASP.NET also called ASP+ replaced
ASP.
It provides the easiest and most scalable way to build, deploy and run web services. ASP.NET
server controls enable an HTML-like style of declarative programming that let you build great
pages with far less code than with classic ASP. VB, C++ and C# Code can be used in other
languages f.e. code written in VB can be easily used in C# or in VC++. Also an another benefit
is that the you can step between the languages in the debugger.
Web Forms provide a powerful, forms-based UI for the web. Web Services, which are perhaps the most
revolutionary, provide a mechanism for programs to communicate over the Internet using SOAP. Web
Services provide an analog of COM and DCOM for object brokering and interfacing, but based on
Internet technologies so that allowance is made for integration even with non-Microsoft platforms. Web
Forms and Web Services, comprise the Internet interface portion of .NET, and are implemented through a
section of the .NET Framework referred to as ASP.NET. The middle layer includes the next generation of
standard system services such as ADO.NET and XML. These services are brought under the control of
the framework, making them universally available and standardizing their usage across languages.
Installation
To begin with, you will need to download the following three Microsoft Office Word 2007 docx files.
Each file contains complete source code for a specific part of this project.
1. PDFCreate_aspx.docx - ASP.NET web page source code
2. ajaxPDFJScript.docx - JScript source code for communicating with the web service
3. PDFAjaxWebService_vb.docx - ASP.NET 3.5 web service source code
Please follow the step by step guide below if web services and .Net AJAX under .Net 3.5 is a fairly new
subject to you. Otherwise you may prefer to skip to the next section.
STEP
1
Open Visual Studio 2008.
(Enlarge)
STEP Under the File Menu select "New
2 Web Site".
(Enlarge)
(Enlarge)
STEP
5
From the pop-up menu, select "Rename".
(Enlarge)
STEP
6
Rename the filename to "PDFCreate.aspx".
(Enlarge)
Open "PDFCreate_aspx.docx" (the source code
file mentioned at the top of this web page) with Microsoft
Office Word 2007.
Highlight and copy the contents of the page.
STEP Highlight the source code section of
7 "PDFCreate.aspx" starting at <html> and ending after
</html>.
Paste the contents you had copied. This will
remove the default code that was generated with what is
(Enlarge) contained in the docx file.
STEP
9
Specify the folder name as "JavaScript".
(Enlarge)
Features
Interoperability
Because interaction between new and older applications is commonly required, the .NET Framework
provides means to access functionality that is implemented in programs that execute outside the .NET
environment. Access to COM components is provided in the System.Runtime.InteropServices and
System. Enterprise Services namespaces of the framework; access to other functionality is provided using
the P/Invoke feature.
The Common Language Runtime (CLR) is the virtual machine component of the .NET framework. All
.NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors
in the areas of memory management, security, and exception handling.
Language Independence
The .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all
possible data types and programming constructs supported by the CLR and how they may or may not
interact with each other conforming to the Common Language Infrastructure (CLI) specification.
The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of functionality
available to all languages using the .NET Framework.
Simplified Deployment
The .NET framework includes design features and tools that help manage the installation of computer
software to ensure that it does not interfere with previously installed software, and that it conforms to
security requirements.
Security
The design is meant to address some of the vulnerabilities, such as buffer overflows, that have been
exploited by malicious software. Additionally, .NET provides a common security model for all
applications.
Portability
The design of the .NET Framework allows it to theoretically be platform agnostic, and thus cross-
platform compatible. That is, a program written to use the framework should run without change on any
type of system for which the framework is implemented.
When you browse the Internet, you use a web browser. This is an application that runs off your local
computer, connected to the Internet. It requests web pages from distant web servers, and translates the
HTML programming language into the familiar web page that you read, with embedded pictures. What is
the difference between static and dynamic web pages?
A Static web page is one that has been written once, like a word processing document, and then saved
onto the web server. It’s like a file. If you could access the web server at a file system level, move the file
over to your computer, and then open it up locally in your web browser, it should look exactly the same
as if you looked at it through the Internet. Any changes to a static web page need to be made manually,
and then saved again.
A Dynamic web page is created on the fly. It doesn’t actually exist on the web server until a web browser
requests it. When a request is made, web server runs whatever program will create the web page. That
program creates the page dynamically and returns it to the web server, which then passes it along to the
web browser.
So the main difference between static and dynamic web pages is that static pages exist on the web server,
while dynamic pages are created on the fly when a web browser requests them.
.
Web Controls
A control is an object that can be drawn on to the Web Form to enable or enhance user interaction with
the application. Examples of these controls include the TextBoxes, Buttons, Labels, Radio Buttons etc.
All these controls are based on the System.Web.UI.Control class and the class hierarchy is as follows:
Object Control Notable properties of the Control objects are summarized in the table below:
Property Description
ClientID Gets the ASP.NET control identifier for the control
Controls Gets a collection of child controls in a control
EnableViewState Gets/Sets whether the control maintains it's state between server round trips
ID Gets/Sets the ID for the control
Page Gets the page object that contains the control
Parent Gets the control parent control
Site Gets the control's Web site
UniqueID Gets the Unique ID for the control
Visible Gets/Sets whether the control is visible or not
Object Control WebControl Notable properties of the WebControl class are summarized in the table
below:
Property Description
AccessKey Gets/Sets the access key for the control
Attributes Gets a collection of attributes used to render the control
BackColor Gets/Sets the control's background color
BorderColor Gets/Sets the controls border color
BorderStyle Gets/Sets the control's border style
BorderWidth Gets/Sets the control's border width
ControlStyle Gets the control's style
CssClass Gets/Sets the control's CSS class
Enabled Gets/Sets whether the control is enabled
Font Gets/Sets the font for the control
ForeColor Gets/Sets the control's foreground color
Height Gets/Sets the control's height
Style Gets the HTML style of the control as a collection of text attributes
TabIndex Gets/Sets the control's tab index
ToolTip Gets/Sets the control's tool tip text
Width Gets/Sets the control's width
ADO .NET
Most applications need data access at one point of time making it a crucial component when working with
applications. Data access is making the application interact with a database, where all the data is stored.
Different applications have different requirements for database access. ASP.NET uses ADO .NET
(Active X Data Object) as it's data access and manipulation protocol which also enables us to work with
data on the Internet.
8- Create a database for student and insert value in database using sql
server in dot net?
ANS:-
9. Show that grid view control for the above database?
ANS:-
10. update the above database using sql update commond ?
11. Show that grid view control for the above database?
ANS:-
12. Delete the some values form he above database by using sql delete
commond?
ANS:-
13. Show that grid view control for the above database?
ANS:-