Web Application Development with ASP.NET and C# XXXXXXXXXXCEIL-865 LAB #7– Database access with ADO.NET Student: ______________________ Purpose:The purpose of this Lab assignment is to: Become...

1 answer below »
This is just a weekly lab assignment.


Web Application Development with ASP.NET and C# CEIL-865 LAB #7– Database access with ADO.NET Student: ______________________ Purpose:The purpose of this Lab assignment is to: Become familiar with ADO.NET Design and write ASP.NET applications that use ADO.NET References: Textbook. Lecture notes This assignment may be completed individually by all the students. Submit the solution in a zip file using assignment link on blackboard. The file and project must be named according as indicated in previous labs. Exercise #1 Develop an ASP.NET web page that will allow the students to submit information about themselves, and the courses that they are taking on-line. The information will be stored in an MS-SQL Server Express 2008 database, named College, which contains the following tables: Use the following names and column types for the tables and their columns: Table Course contains course codes and course names as is shown in the following picture: Your web interface should provide the necessary web controls that will allow the user to enter and display the data. You will use ADO.NET to implement the following operations: Insert student information into Student table and course information for this student into StudentAndCourse table. Update the existing information for a student (given student_id) Display in a GridView web control, all the courses that a student is taking (given student_id). Use parameterized queries to insert information for a new student. Use the ExecuteNonQuery method to update student information. Use the ExecuteReader method to display the classes that a student is taking. Use the exact names for tables and columns as shown in the pictures above. You can attach the College.mdf database to your project (in App_Data directory) by using for example the following connection string (or any other suitable method you may have come across - commonly a configuration file setting): myConn.ConnectionString = "Data Source=" + @".\SQLEXPRESS;AttachDBFilename=|DataDirectory|\College.mdf;Integrated Security=True; User Instance=True;"; Lab #7 Page 3 of 3
Answered 3 days AfterJul 28, 2021

Answer To: Web Application Development with ASP.NET and C# XXXXXXXXXXCEIL-865 LAB #7– Database access with...

Shweta answered on Jul 31 2021
145 Votes
88719/CollegeWebsite/.vs/CollegeWebsite/config/applicationhost.config

    
    
        
            
            
            
            
            
            
            
            
        
        
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
                
                
                
                    
                    
                    
                    
                    
                    
                
                
                
                
                
                
            
            
            
            
            
                
                
            
            
            
            
                
                
                
            
            
                
                
                
                
                
                
            
            
            
    
    
        
            
            
            
        
    
    
        
            
            
            
            
            
            
                
            
        
        
        
            
        
        
            
                
                    
                
                
                    
                
            









            
                
                
                
            
            
            
        
        
    
    
        
        
            
            
        
        
        
        
        
            
                
                
                
                
                
                
            
        
        
        
        
        
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            

        
        
            
            
                
                
                
                
                
            
            
                
                
                
                
                
                
                
            
        
        
            
            
            
            
            
            
            
            
            
        
        
        
            
                
                
            
            
                
            
        
        
        
        
            
            
            
            
            
        
        
        
            
            
                
            
            
                
                
                
                
                
                
                
                    
                        
                        
                    
                
            
            
                
            
            
            
                
                
                
                
            
            
                
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                
                
                
                    
                    
                    
                    
                    
                    
                    
                    
                
            
        
        
        
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
        
        
            
                
                    
                        
                        
                        
                        
                    
                    
                
            
            
                
                    
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        

                    
                
                
                    
                        
                    
                
                
                    
                        
                    
                
                
                    
                        
                        
                        
                        
                    
                
            
        
        
        
        
            
                
                    
                
                
                    
                
            
            
                
            
            
        
        
        
    
    
        
            
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                

            
            
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
            
        
    
88719/CollegeWebsite/.vs/CollegeWebsite/v16/.suo
88719/CollegeWebsite/CollegeWebsite/AddView.aspx



        
        

        
        

        
        

        
        

        
        

        
        

        
        

        

        


                
88719/CollegeWebsite/CollegeWebsite/AddView.aspx.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CollegeWebsite
{
public partial class AddView : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\College.mdf;Integrated Security=True");
con.Open();
string com = "Select * from Course";
SqlDataAdapter adpt = new SqlDataAdapter(com, con);
DataTable dt = new DataTable();
adpt.Fill(dt);
course_code.DataSource = dt;
course_code.DataBind();
course_code.DataTextField = "course_name";
course_code.DataValueField = "course_code";
course_code.DataBind();
con.Close();
}
}
protected void ButtonId_Click(object sender, EventArgs e)
{
SqlConnection con = null;
try
{
con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\College.mdf;Integrated Security=True");
con.Open();
SqlCommand cm = new SqlCommand("select count(*) as studentID from student", con);
// Executing the SQL query
SqlDataReader sdr = cm.ExecuteReader();
sdr.Read();
int currentStudentID = Convert.ToInt32(sdr["studentID"].ToString()) + 1;
string courseCode = course_code.SelectedItem.Value ;
sdr.Close();
SqlCommand cmd = new SqlCommand("Insert into Student(student_id, firstname, lastname, address, city, province, postal_code, phone_number)Values" +
"(@StudentID,@FirstName,@LastName,@Address,@City,@Province,@PostalCode,@PhoneNumber)", con);
// Add the parameters for the InsertCommand.
cmd.Parameters.AddWithValue("@StudentID", currentStudentID);
cmd.Parameters.AddWithValue("@FirstName", firstname.Text);
cmd.Parameters.AddWithValue("@LastName", lastname.Text);
cmd.Parameters.AddWithValue("@Address", address.Text);
cmd.Parameters.AddWithValue("@City", city.Text);
cmd.Parameters.AddWithValue("@Province", province.Text);
cmd.Parameters.AddWithValue("@PostalCode", postal_code.Text);
cmd.Parameters.AddWithValue("@PhoneNumber", phone_number.Text);
cmd.ExecuteNonQuery();
SqlCommand cm1 = new SqlCommand("select count(*) as studentCourseID from studentcourse", con);
// Executing the SQL query
SqlDataReader sdr1 = cm1.ExecuteReader();
sdr1.Read();
int currentStudentCourseID = Convert.ToInt32(sdr1["studentCourseID"].ToString()) + 1;
sdr1.Close();
SqlCommand cmd1 = new SqlCommand("Insert into StudentCourse(student_course_id,student_id,course_code)Values" +
"(@StudentCourseID,@StudentID,@CourseCode)", con);
cmd1.Parameters.AddWithValue("@StudentCourseID", currentStudentCourseID);
cmd1.Parameters.AddWithValue("@StudentID", currentStudentID);
cmd1.Parameters.AddWithValue("@CourseCode", courseCode);
cmd1.ExecuteNonQuery();
Response.Redirect("Home.aspx");
}
catch (Exception ex)
{
Console.WriteLine("OOPs, something went wrong." + ex);
}
// Closing the connection
finally
{
con.Close();
}
}
}
}
88719/CollegeWebsite/CollegeWebsite/AddView.aspx.designer.cs
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//

//------------------------------------------------------------------------------
namespace CollegeWebsite
{
public partial class AddView
{
///
/// form1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.HtmlControls.HtmlForm form1;
///
/// GridView1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.GridView GridView1;
///
/// firstname control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox firstname;
///
/// lastname control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox lastname;
///
/// address control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox address;
///
/// city control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox city;
///
/// province control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox province;
///
/// postal_code control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox postal_code;
///
/// phone_number control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox phone_number;
///
/// course_code control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.DropDownList course_code;
///
/// ButtonId control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.Button ButtonId;
}
}
88719/CollegeWebsite/CollegeWebsite/App_Data/College.mdf
88719/CollegeWebsite/CollegeWebsite/App_Data/College_log.ldf
88719/CollegeWebsite/CollegeWebsite/bin/CollegeWebsite.dll
88719/CollegeWebsite/CollegeWebsite/bin/CollegeWebsite.dll.config











88719/CollegeWebsite/CollegeWebsite/bin/CollegeWebsite.pdb
88719/CollegeWebsite/CollegeWebsite/bin/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
88719/CollegeWebsite/CollegeWebsite/bin/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.xml


Microsoft.CodeDom.Providers.DotNetCompilerPlatform




Provides access to instances of the .NET Compiler Platform C# code generator and code compiler.




Default Constructor




Creates an instance using the given ICompilerSettings





Gets an instance of the .NET Compiler Platform C# code compiler.

An instance of the .NET Compiler Platform C# code compiler



Provides settings for the C# and VB CodeProviders




The full path to csc.exe or vbc.exe




TTL in seconds




Provides access to instances of the .NET Compiler Platform VB code generator and code compiler.




Default Constructor




Creates an instance using the given ICompilerSettings





Gets an instance of the .NET Compiler Platform VB code compiler.

An instance of the .NET Compiler Platform VB code compiler


88719/CollegeWebsite/CollegeWebsite/bin/roslyn/csc.exe
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/csc.exe.config












































































































































88719/CollegeWebsite/CollegeWebsite/bin/roslyn/csc.rsp
# Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
# This file contains command-line options that the C#
# command line compiler (CSC) will process as part
# of every compilation, unless the "/noconfig" option
# is specified.
# Reference the common Framework libraries
/r:Accessibility.dll
/r:Microsoft.CSharp.dll
/r:System.Configuration.dll
/r:System.Configuration.Install.dll
/r:System.Core.dll
/r:System.Data.dll
/r:System.Data.DataSetExtensions.dll
/r:System.Data.Linq.dll
/r:System.Data.OracleClient.dll
/r:System.Deployment.dll
/r:System.Design.dll
/r:System.DirectoryServices.dll
/r:System.dll
/r:System.Drawing.Design.dll
/r:System.Drawing.dll
/r:System.EnterpriseServices.dll
/r:System.Management.dll
/r:System.Messaging.dll
/r:System.Runtime.Remoting.dll
/r:System.Runtime.Serialization.dll
/r:System.Runtime.Serialization.Formatters.Soap.dll
/r:System.Security.dll
/r:System.ServiceModel.dll
/r:System.ServiceModel.Web.dll
/r:System.ServiceProcess.dll
/r:System.Transactions.dll
/r:System.Web.dll
/r:System.Web.Extensions.Design.dll
/r:System.Web.Extensions.dll
/r:System.Web.Mobile.dll
/r:System.Web.RegularExpressions.dll
/r:System.Web.Services.dll
/r:System.Windows.Forms.dll
/r:System.Workflow.Activities.dll
/r:System.Workflow.ComponentModel.dll
/r:System.Workflow.Runtime.dll
/r:System.Xml.dll
/r:System.Xml.Linq.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/csi.exe
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/csi.exe.config






















































































































































88719/CollegeWebsite/CollegeWebsite/bin/roslyn/csi.rsp
/r:System
/r:System.Core
/r:Microsoft.CSharp
/r:System.ValueTuple.dll
/u:System
/u:System.IO
/u:System.Collections.Generic
/u:System.Console
/u:System.Diagnostics
/u:System.Dynamic
/u:System.Linq
/u:System.Linq.Expressions
/u:System.Text
/u:System.Threading.Tasks
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.Build.Tasks.CodeAnalysis.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.CodeAnalysis.CSharp.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.CodeAnalysis.CSharp.Scripting.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.CodeAnalysis.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.CodeAnalysis.Scripting.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.CodeAnalysis.VisualBasic.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.CSharp.Core.targets





$(NoWarn);1701;1702



$(NoWarn);2008



$(AppConfig)

$(IntermediateOutputPath)$(TargetName).compile.pdb










88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.DiaSymReader.Native.amd64.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.DiaSymReader.Native.x86.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.Managed.Core.targets


















false







true




true













true








,$(PathMap)

@(_TopLevelSourceRoot->'%(Identity)=%(MappedPath)', ',')$(PathMap)


88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.VisualBasic.Core.targets




true
false



$(IntermediateOutputPath)$(TargetName).compile.pdb










88719/CollegeWebsite/CollegeWebsite/bin/roslyn/Microsoft.Win32.Primitives.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.AppContext.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Collections.Immutable.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Console.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Diagnostics.DiagnosticSource.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Diagnostics.FileVersionInfo.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Diagnostics.StackTrace.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Globalization.Calendars.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.IO.Compression.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.IO.Compression.ZipFile.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.IO.FileSystem.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.IO.FileSystem.Primitives.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Net.Http.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Net.Sockets.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Reflection.Metadata.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Runtime.InteropServices.RuntimeInformation.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Security.Cryptography.Algorithms.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Security.Cryptography.Encoding.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Security.Cryptography.Primitives.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Security.Cryptography.X509Certificates.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Text.Encoding.CodePages.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Threading.Tasks.Extensions.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.ValueTuple.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Xml.ReaderWriter.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Xml.XmlDocument.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Xml.XPath.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/System.Xml.XPath.XDocument.dll
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/vbc.exe
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/vbc.exe.config












































































































































88719/CollegeWebsite/CollegeWebsite/bin/roslyn/vbc.rsp
# Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
# This file contains command-line options that the VB
# command line compiler (VBC) will process as part
# of every compilation, unless the "/noconfig" option
# is specified.
# Reference the common Framework libraries
/r:Accessibility.dll
/r:System.Configuration.dll
/r:System.Configuration.Install.dll
/r:System.Data.dll
/r:System.Data.OracleClient.dll
/r:System.Deployment.dll
/r:System.Design.dll
/r:System.DirectoryServices.dll
/r:System.dll
/r:System.Drawing.Design.dll
/r:System.Drawing.dll
/r:System.EnterpriseServices.dll
/r:System.Management.dll
/r:System.Messaging.dll
/r:System.Runtime.Remoting.dll
/r:System.Runtime.Serialization.Formatters.Soap.dll
/r:System.Security.dll
/r:System.ServiceProcess.dll
/r:System.Transactions.dll
/r:System.Web.dll
/r:System.Web.Mobile.dll
/r:System.Web.RegularExpressions.dll
/r:System.Web.Services.dll
/r:System.Windows.Forms.dll
/r:System.XML.dll
/r:System.Workflow.Activities.dll
/r:System.Workflow.ComponentModel.dll
/r:System.Workflow.Runtime.dll
/r:System.Runtime.Serialization.dll
/r:System.ServiceModel.dll
/r:System.Core.dll
/r:System.Xml.Linq.dll
/r:System.Data.Linq.dll
/r:System.Data.DataSetExtensions.dll
/r:System.Web.Extensions.dll
/r:System.Web.Extensions.Design.dll
/r:System.ServiceModel.Web.dll
# Import System and Microsoft.VisualBasic
/imports:System
/imports:Microsoft.VisualBasic
/imports:System.Linq
/imports:System.Xml.Linq
/optioninfer+
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/VBCSCompiler.exe
88719/CollegeWebsite/CollegeWebsite/bin/roslyn/VBCSCompiler.exe.config
















































































































































88719/CollegeWebsite/CollegeWebsite/CollegeWebsite.csproj




Debug
AnyCPU


2.0
{B407E904-60C1-49D6-B3CE-B70B7533EBC6}
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
Library
Properties
CollegeWebsite
CollegeWebsite
v4.7.2
true

44317








true
full
false
bin\
DEBUG;TRACE
prompt
4


true
pdbonly
true
bin\
TRACE
prompt
4






















..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll






College.mdf







AddView.aspx
ASPXCodeBehind


AddView.aspx


Home.aspx
ASPXCodeBehind


Home.aspx



UpdateView.aspx
ASPXCodeBehind


UpdateView.aspx





Web.config


Web.config



10.0
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)








True
True
61365
/
https://localhost:44317/
False
False


False






This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.





88719/CollegeWebsite/CollegeWebsite/CollegeWebsite.csproj.user


true

44317




Debug|Any CPU







CurrentPage
True
False
False
False








True
False




88719/CollegeWebsite/CollegeWebsite/Home.aspx
















                
        
88719/CollegeWebsite/CollegeWebsite/Home.aspx.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CollegeWebsite
{
public partial class Home : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\College.mdf;Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("select s.student_id as 'Student ID',s.firstname as 'First Name' ," +
"lastname as 'Last Name', Address,City,Province, postal_code as 'Postal_Code', phone_number as 'Phone Number'," +
" c.course_name from Student s inner join StudentCourse sc on " +
"s.student_id = sc.student_id inner join course c on sc.course_code = c.course_code ", con);
SqlDataAdapter Adpt = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
Adpt.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();

}
protected void ButtonId_Click(object sender, EventArgs e)
{
Response.Redirect("AddView.aspx");
}
protected void ButtonId1_Click(object sender, EventArgs e)
{
Response.Redirect("UpdateView.aspx");
}
}
}
88719/CollegeWebsite/CollegeWebsite/Home.aspx.designer.cs
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//

//------------------------------------------------------------------------------
namespace CollegeWebsite
{
public partial class Home
{
///
/// form1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.HtmlControls.HtmlForm form1;
///
/// GridView1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.GridView GridView1;
///
/// ButtonId control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.Button ButtonId;
///
/// ButtonId1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.Button ButtonId1;
}
}
88719/CollegeWebsite/CollegeWebsite/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
//
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
88719/CollegeWebsite/CollegeWebsite/obj/Debug/CollegeWebsite.csproj.CopyComplete
88719/CollegeWebsite/CollegeWebsite/obj/Debug/CollegeWebsite.csproj.CoreCompileInputs.cache
2f3e86dcba6353305714378024cccf411490c637
88719/CollegeWebsite/CollegeWebsite/obj/Debug/CollegeWebsite.csproj.FileListAbsolute.txt
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\CollegeWebsite.dll.config
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\CollegeWebsite.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\CollegeWebsite.pdb
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\csc.exe
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\csc.exe.config
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\csc.rsp
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\csi.exe
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\csi.exe.config
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\csi.rsp
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.CodeAnalysis.CSharp.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.CodeAnalysis.CSharp.Scripting.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.CodeAnalysis.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.CodeAnalysis.Scripting.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.CodeAnalysis.VisualBasic.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.CSharp.Core.targets
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.DiaSymReader.Native.amd64.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.DiaSymReader.Native.x86.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.Managed.Core.targets
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.VisualBasic.Core.targets
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\Microsoft.Win32.Primitives.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.AppContext.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Collections.Immutable.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Console.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Diagnostics.DiagnosticSource.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Diagnostics.FileVersionInfo.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Diagnostics.StackTrace.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Globalization.Calendars.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.IO.Compression.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.IO.Compression.ZipFile.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.IO.FileSystem.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.IO.FileSystem.Primitives.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Net.Http.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Net.Sockets.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Reflection.Metadata.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Runtime.InteropServices.RuntimeInformation.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Security.Cryptography.Algorithms.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Security.Cryptography.Encoding.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Security.Cryptography.Primitives.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Security.Cryptography.X509Certificates.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Text.Encoding.CodePages.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Threading.Tasks.Extensions.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.ValueTuple.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Xml.ReaderWriter.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Xml.XmlDocument.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Xml.XPath.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\System.Xml.XPath.XDocument.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\vbc.exe
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\vbc.exe.config
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\vbc.rsp
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\VBCSCompiler.exe
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\roslyn\VBCSCompiler.exe.config
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.xml
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\obj\Debug\CollegeWebsite.csprojAssemblyReference.cache
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\obj\Debug\CollegeWebsite.csproj.CoreCompileInputs.cache
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\obj\Debug\CollegeWebsite.csproj.CopyComplete
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\obj\Debug\CollegeWebsite.dll
C:\Users\Acer\source\repos\CollegeWebsite\CollegeWebsite\obj\Debug\CollegeWebsite.pdb
88719/CollegeWebsite/CollegeWebsite/obj/Debug/CollegeWebsite.csprojAssemblyReference.cache
88719/CollegeWebsite/CollegeWebsite/obj/Debug/CollegeWebsite.dll
88719/CollegeWebsite/CollegeWebsite/obj/Debug/CollegeWebsite.pdb
88719/CollegeWebsite/CollegeWebsite/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
88719/CollegeWebsite/CollegeWebsite/packages.config


88719/CollegeWebsite/CollegeWebsite/Properties/AssemblyInfo.cs
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CollegeWebsite")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CollegeWebsite")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b407e904-60c1-49d6-b3ce-b70b7533ebc6")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
88719/CollegeWebsite/CollegeWebsite/UpdateView.aspx


        
        
                

        
        

        
        

        
        

        
        

        
        

        
        

        
        

        
        


                
No record for this student id!!

88719/CollegeWebsite/CollegeWebsite/UpdateView.aspx.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CollegeWebsite
{
public partial class UpdateView : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
showdata.Style.Add("display", "none");
lblNoData.Style.Add("display", "none");
SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\College.mdf;Integrated Security=True");
con.Open();
string com = "Select * from Course";
SqlDataAdapter adpt = new SqlDataAdapter(com, con);
DataTable dt = new DataTable();
adpt.Fill(dt);
course_code.DataSource = dt;
course_code.DataBind();
course_code.DataTextField = "course_name";
course_code.DataValueField = "course_code";
course_code.DataBind();
con.Close();
}
}
protected void ButtonId_Click(object sender, EventArgs e)
{
SqlConnection con = null;
try
{
con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\College.mdf;Integrated Security=True");
con.Open();
int studentid = Convert.ToInt32(student_id.Text);
SqlCommand cm1 = new SqlCommand("select course_code from studentcourse where student_id=" + studentid, con);
// Executing the SQL query
SqlDataReader sdr1 = cm1.ExecuteReader();
sdr1.Read();
string courseCode = sdr1["course_code"].ToString();
sdr1.Close();
SqlCommand cm = new SqlCommand("select * from student where student_id="+ studentid, con);
// Executing the SQL query
SqlDataReader sdr = cm.ExecuteReader();
sdr.Read();

if (sdr.HasRows)
{
showdata.Style.Add("display", "block");
firstname.Text = sdr["firstname"].ToString();
lastname.Text = sdr["lastname"].ToString();
address.Text = sdr["address"].ToString();
city.Text = sdr["city"].ToString();
province.Text = sdr["province"].ToString();
phone_number.Text = sdr["phone_number"].ToString();
postal_code.Text = sdr["postal_code"].ToString();
course_code.SelectedItem.Value = courseCode;
}
else
{
lblNoData.Style.Add("display", "block");
}
sdr.Close();
//Response.Redirect("AddView.aspx");
}
catch (Exception ex)
{
Console.WriteLine("OOPs, something went wrong." + ex);
}
// Closing the connection
finally
{
con.Close();
}
}
protected void ButtonId1_Click(object sender, EventArgs e)
{
Response.Redirect("AddView.aspx");
}
}
}
88719/CollegeWebsite/CollegeWebsite/UpdateView.aspx.designer.cs
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//

//------------------------------------------------------------------------------
namespace CollegeWebsite
{
public partial class UpdateView
{
///
/// form1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.HtmlControls.HtmlForm form1;
///
/// student_id control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox student_id;
///
/// ButtonId control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.Button ButtonId;
///
/// showdata control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.HtmlControls.HtmlGenericControl showdata;
///
/// firstname control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox firstname;
///
/// lastname control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox lastname;
///
/// address control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox address;
///
/// city control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox city;
///
/// province control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox province;
///
/// postal_code control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox postal_code;
///
/// phone_number control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.TextBox phone_number;
///
/// course_code control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.DropDownList course_code;
///
/// Button1 control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.WebControls.Button Button1;
///
/// lblNoData control.
///

///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///

protected global::System.Web.UI.HtmlControls.HtmlGenericControl lblNoData;
}
}
88719/CollegeWebsite/CollegeWebsite/Web.config











88719/CollegeWebsite/CollegeWebsite/Web.Debug.config





88719/CollegeWebsite/CollegeWebsite/Web.Release.config






88719/CollegeWebsite/CollegeWebsite.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollegeWebsite", "CollegeWebsite\CollegeWebsite.csproj", "{B407E904-60C1-49D6-B3CE-B70B7533EBC6}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {B407E904-60C1-49D6-B3CE-B70B7533EBC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {B407E904-60C1-49D6-B3CE-B70B7533EBC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {B407E904-60C1-49D6-B3CE-B70B7533EBC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {B407E904-60C1-49D6-B3CE-B70B7533EBC6}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {AB80223E-A660-4D05-872D-B200FC27C0AB}
    EndGlobalSection
EndGlobal
88719/CollegeWebsite/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1/.signature.p7s
88719/CollegeWebsite/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1/build/net45/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Extensions.props


$(MSBuildThisFileDirectory)..\..\tools\roslyn45


88719/CollegeWebsite/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1/build/net45/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props




roslyn\%(RecursiveDir)%(Filename)%(Extension)





bin\roslyn\%(RecursiveDir)%(Filename)%(Extension)
IncludeRoslynCompilerFilesToFilesForPackagingFromProject
Run





$(WebProjectOutputDir)\bin\roslyn
$(OutputPath)\roslyn
































try
{
foreach(var p in Process.GetProcessesByName(ProcessName))
{
var wmiQuery = "SELECT ProcessId, ExecutablePath FROM Win32_Process WHERE ProcessId = " + p.Id;
using(var searcher = new ManagementObjectSearcher(wmiQuery))
{
using(var results = searcher.Get())
{
var mo = results.Cast().FirstOrDefault();
if(mo != null)
{
var path = (string)mo["ExecutablePath"];
var executablePath = path != null ? path : string.Empty;
Log.LogMessage("ExecutablePath is {0}", executablePath);
if(executablePath.StartsWith(ImagePath, StringComparison.OrdinalIgnoreCase))
{
p.Kill();
p.WaitForExit();
Log.LogMessage("{0} is killed", executablePath);
break;
}
}
}
}
}
}
catch (Exception ex)
{
Log.LogWarning(ex.Message);
}
return true;
]]>







SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here