Practical Database Programming With Visual C#.NET- P13
Số trang: 50
Loại file: pdf
Dung lượng: 921.29 KB
Lượt xem: 9
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Homework6235. The _______ operator should be used as an assignment operator for the WHERE clause with a dynamic parameter for a data query in Oracle database. a. =: b. LIKE c. = d. @ 6. To test a data deleting stored procedure built in the Object Browser page in Oracle database, one can _______ the stored procedure to make sure it works. a. Build b. Test c. Debug d. Compile 7. To test a data updating stored procedure built in the Server Explorer window for the SQL Server database, one can _______ the stored procedure to make sure it works....
Nội dung trích xuất từ tài liệu:
Practical Database Programming With Visual C#.NET- P13 Homework 623 5. The _______ operator should be used as an assignment operator for the WHERE clause with a dynamic parameter for a data query in Oracle database. a. =: b. LIKE c. = d. @ 6. To test a data deleting stored procedure built in the Object Browser page in Oracle database, one can _______ the stored procedure to make sure it works. a. Build b. Test c. Debug d. Compile 7. To test a data updating stored procedure built in the Server Explorer window for the SQL Server database, one can _______ the stored procedure to make sure it works. a. Build b. Execute c. Debug d. Compile 8. To update data in an Oracle database using the UPDATE command, the data types of the parameters in the SET list should be ________. a. OleDbType b. SqlDbType c. OracleDbType d. OracleType 9. To update data using stored procedures, the CommandType property of the Command object must be equal to ___________. a. CommandType.InsertCommand b. CommandType.StoredProcedure c. CommandType.Text d. CommandType.Insert10. To update data using stored procedures, the CommandText property of the Command object must be equal to ___________. a. The content of the CommandType.InsetCommand b. The content of the CommandType.Text c. The name of the Insert command d. The name of the stored procedureIII. Exercises1. A stored procedure developed in the SQL Server database is shown in Figure 7.48. Please develop a piece of code in Visual C#.NET to call this stored procedure to update a record in the database.2. A piece of code developed in Visual C#.NET is shown in Figure 7.49. This coding is used to call a stored procedure in the Oracle database to update a record in the database. Please create the associated stored procedure in the Oracle database using the PL- SQL language.624 Chapter 7 Data Updating and Deleting with Visual C#.NET3. Using the tools and wizards provided by Visual Studio.NET and ADO.NET to perform the data updating for the Student Form in the AccessUpdateDeleteWizard project (the project file is located at the folder DBProjectsChapter 7 that can be found from the accompanying ftp site (see Chapter 1)).4. Using the runtime objects method to complete the update data query for the Student Form by using the project SQLUpdateDeleteRTObject (the project file is located at the folder DBProjects Chapter 7 found at the accompanying ftp site (see Chapter 1)).5. Using the stored procedure to complete the data updating query for the Student Form to the Student table by using the project OracleUpdateDeleteSP (the project file is located at the folder DBProjectsChapter 7 found at the accompanying ftp site (see Chapter 1)).6. Using the stored procedure to complete the data deleting query for the Student Form to the Student table by using the project OracleUpdateDeleteSP (the project file is located at the folder DBProjectsChapter 7 found at the accompanying ftp site (see Chapter 1)). It is highly recom- mended to recover those deleted records after they are deleted.Hints: Four tables are involved in this data deleting action: Student, LogIn, Course, and theStudentCourse tables. The recovery order is, first, recover the record from the parent table (Studenttable), and then recover all other records for all other tables. CREATE OR REPLACE PROCEUDRE dbo.UpdateStudent ( @Name IN VARCHAR(20), @Major IN text, @SchoolYear IN int, @Credits IN float, @Email IN text @StudentName IN VARCHAR(20)) AS UPDATE Student SET name=@Name, major=@Major, schoolYear=@SchoolYear, credits=@Credits, email=@Email WHERE (name=@StudentName) RETURNFigure 7.48 string cmdString = UpdateCourse; int intInsert = 0; OracleCommand oraCommand = new OracleCommand(); oraCommand.Connection = oraConnection; oraCommand.CommandType = CommandType.StoredProcedure; oraCommand.CommandText = cmdString; oraCommand.Parameters.Add(Name, OracleType.Char).Value = ComboName.Text; oraCommand.Parameters.Add(CourseID, OracleType.Char).Value = txtCourseID.Text; oraCommand.Parameters.Add(Course, OracleType.Char).Value = txtCourse.Text; oraCommand.Parameters.Add(Schedule, OracleType.Char).Value = txtSchedule.Text; oraCommand.Parameters.Add(Classroom, OracleType.Char).Value = txtClassRoom.Text; oraCommand.Parameters.Add(Credit, OracleType.Char).Value = txtCredits.Text; oraCommand.Parameters.Add(StudentID, OracleType.Char).Value = txtID.Text; intInsert = oraCommand.ExecuteNonQuery();Figure 7.49Chapter 8 Accessing Data in ASP.NETWe have provided a very detailed discussion on d ...
Nội dung trích xuất từ tài liệu:
Practical Database Programming With Visual C#.NET- P13 Homework 623 5. The _______ operator should be used as an assignment operator for the WHERE clause with a dynamic parameter for a data query in Oracle database. a. =: b. LIKE c. = d. @ 6. To test a data deleting stored procedure built in the Object Browser page in Oracle database, one can _______ the stored procedure to make sure it works. a. Build b. Test c. Debug d. Compile 7. To test a data updating stored procedure built in the Server Explorer window for the SQL Server database, one can _______ the stored procedure to make sure it works. a. Build b. Execute c. Debug d. Compile 8. To update data in an Oracle database using the UPDATE command, the data types of the parameters in the SET list should be ________. a. OleDbType b. SqlDbType c. OracleDbType d. OracleType 9. To update data using stored procedures, the CommandType property of the Command object must be equal to ___________. a. CommandType.InsertCommand b. CommandType.StoredProcedure c. CommandType.Text d. CommandType.Insert10. To update data using stored procedures, the CommandText property of the Command object must be equal to ___________. a. The content of the CommandType.InsetCommand b. The content of the CommandType.Text c. The name of the Insert command d. The name of the stored procedureIII. Exercises1. A stored procedure developed in the SQL Server database is shown in Figure 7.48. Please develop a piece of code in Visual C#.NET to call this stored procedure to update a record in the database.2. A piece of code developed in Visual C#.NET is shown in Figure 7.49. This coding is used to call a stored procedure in the Oracle database to update a record in the database. Please create the associated stored procedure in the Oracle database using the PL- SQL language.624 Chapter 7 Data Updating and Deleting with Visual C#.NET3. Using the tools and wizards provided by Visual Studio.NET and ADO.NET to perform the data updating for the Student Form in the AccessUpdateDeleteWizard project (the project file is located at the folder DBProjectsChapter 7 that can be found from the accompanying ftp site (see Chapter 1)).4. Using the runtime objects method to complete the update data query for the Student Form by using the project SQLUpdateDeleteRTObject (the project file is located at the folder DBProjects Chapter 7 found at the accompanying ftp site (see Chapter 1)).5. Using the stored procedure to complete the data updating query for the Student Form to the Student table by using the project OracleUpdateDeleteSP (the project file is located at the folder DBProjectsChapter 7 found at the accompanying ftp site (see Chapter 1)).6. Using the stored procedure to complete the data deleting query for the Student Form to the Student table by using the project OracleUpdateDeleteSP (the project file is located at the folder DBProjectsChapter 7 found at the accompanying ftp site (see Chapter 1)). It is highly recom- mended to recover those deleted records after they are deleted.Hints: Four tables are involved in this data deleting action: Student, LogIn, Course, and theStudentCourse tables. The recovery order is, first, recover the record from the parent table (Studenttable), and then recover all other records for all other tables. CREATE OR REPLACE PROCEUDRE dbo.UpdateStudent ( @Name IN VARCHAR(20), @Major IN text, @SchoolYear IN int, @Credits IN float, @Email IN text @StudentName IN VARCHAR(20)) AS UPDATE Student SET name=@Name, major=@Major, schoolYear=@SchoolYear, credits=@Credits, email=@Email WHERE (name=@StudentName) RETURNFigure 7.48 string cmdString = UpdateCourse; int intInsert = 0; OracleCommand oraCommand = new OracleCommand(); oraCommand.Connection = oraConnection; oraCommand.CommandType = CommandType.StoredProcedure; oraCommand.CommandText = cmdString; oraCommand.Parameters.Add(Name, OracleType.Char).Value = ComboName.Text; oraCommand.Parameters.Add(CourseID, OracleType.Char).Value = txtCourseID.Text; oraCommand.Parameters.Add(Course, OracleType.Char).Value = txtCourse.Text; oraCommand.Parameters.Add(Schedule, OracleType.Char).Value = txtSchedule.Text; oraCommand.Parameters.Add(Classroom, OracleType.Char).Value = txtClassRoom.Text; oraCommand.Parameters.Add(Credit, OracleType.Char).Value = txtCredits.Text; oraCommand.Parameters.Add(StudentID, OracleType.Char).Value = txtID.Text; intInsert = oraCommand.ExecuteNonQuery();Figure 7.49Chapter 8 Accessing Data in ASP.NETWe have provided a very detailed discussion on d ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin tin học quản trị mạng computer networkTài liệu liên quan:
-
52 trang 434 1 0
-
24 trang 360 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 321 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 312 0 0 -
74 trang 304 0 0
-
96 trang 299 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 293 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 286 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 277 0 0 -
Tài liệu hướng dẫn sử dụng thư điện tử tài nguyên và môi trường
72 trang 270 0 0