Answers to "ASP.NET Application Programming Design"

If you want to search, I recommend you to go to: Business Software Development Online Course Answers-pudn.com

Source file: Link: https://pan.baidu.com/s/16sOau7MOrCMyJQDxTHtxaA 
Extraction code: 8yda

1 "ASP.NET Application Programming Exercises" Contents January 2, 2021

Table of Contents Chapter 1 ASP.NET Overview ................................................ .......1

1.1 Web development technology in industry information system....................1

1.2 ASP.NET Technical Overview................................................... 1

Chapter 2 Web System Design Fundamentals................................... ..3

21 Commonly used HTML tags (Part 1) ...................................3

2.2 Commonly used HTML tags (below) ................................................. 3

2.3 HTML form creation................................................... .4

2.4 Usage of Table tab...................................4

2.5 Introduction to CSS (Part 1) ................................... ..5

2.6 Introduction to CSS (Part 2) ................................................ ..6

2.7 Javascript Concepts and Principles...................................6

2.8 Javascript Basic Syntax...................................7

JavaScript functions................................................8 

JavaScript Event Handling Mechanism....................8 

Javascript control page case study...................9

Chapter Three Website Creation Basics................................... ....10

3.1 Introduction and Installation of IIS....................................10

3.2 Installation and configuration of VS2010................................................................10

3.3 Creation of ASP.NET website....................................11

3.4 Publishing and accessing the website................................... 11

3.4.1 True or False................................................... ...11

Chapter 4 ASP.NET Programming Fundamentals................................... ..13

4.1 Basic Grammar of CSharp................................13

4.2 Csharp Object-Oriented Programming Basics (1) ................................13

4.3 Csharp Object-Oriented Programming Fundamentals (2) ......................14

4.4 Csharp Object-Oriented Programming Fundamentals (3) ......................15

4.5 Csharp Object-Oriented Programming Basics (4) ......................15

4.6 ASPNET page structure....................................15

4.7 Response object................................................16

4.8 Request object..................................................... 17

4.9 Server object..................................................... .18

4.10 Application object....................................19

4.11 Session object................................................20

4.12 Debugging Tips................................... ...twenty one

Chapter 5 Usage of Common Web Controls................................... twenty two

5.1 The use of text button type controls....................................22

5.2 Checkbox and Checkboxlist controls...................22

5.3 Radiobutton and Radiobuttonlist controls...........23

5.4 Dropdownlist and Listbox controls...................23

5.5 Required and Range Validation Controls................................24

5.6 The use of regular expression validation controls....................................25

5.7 Comparing the use of validation controls...................25

Chapter 6 Master Page................................................... ..........27

6.1 Web.sitemap and SiteMapPath hybrid navigation............ 27

6.2 TreeView Navigation Control ................................. 27

6.3 Common Site Navigation Controls Menu ................................. 28

6.4 Common webpage layout methods....................................28

6.5 Master pages and content pages................................................... ..29

6.6 Access properties, methods, and controls in the master page from the content page............ 29

Chapter 7 Installation and Use of Sqlserver Database...................31

7.1 Installation of Sqlserver2008................................................31

7.2 Start and stop of service and two login methods.....................31

7.3 Dumping Techniques for Database and Data....................................31

7.4 Creation of database and creation of tables....................................32

7.5 Addition, deletion and modification of SQL statements....................................32

7.6 Basic query statement and conditional query (1) ................................................ 33

7.7 Basic query statement and conditional query (2) ................................................ 34

7.8 Basic query statement and conditional query (3) ................................................ 34

Chapter 8 ASP.NET Database Programming................................... 36

8.1 ASP.NET web page data addition operation....................................36

8.2 ASP.NET web page data update operation....................................................36

8.3 ASP.NET web page data deletion operation....................................................37

8.4 Use GridView to undertake query data.....................38

8.5 Use DropDownList to undertake query data...................................38

8.6 Use ListBox to undertake query data..................................... 39

Chapter 1 ASP.NET Overview 

1. DOTNET development tool is a software development tool produced by Microsoft, which can be used to develop Web applications, Windows applications, and mobile phone applications. (right)

2. ASP.NET technology can be used to develop CS architecture software. (wrong)

3. ASP.NET is not a cross-windows and linux platform technology. (wrong)

4. ASP.NET technology is produced by Microsoft. (right)

 1.2 ASP.NET Technical Overview

1. Which of the following is not a common web development technology (A)

A) Android development B) ASP.NET

C)PHP               D)J2EE

2. The following are not characteristics of ASP.NET development technology (D)

A) Fast development speed B) Low learning cost

C) Abundant learning resources D) Slow development speed

3. Which of the following is the server software running ASP.NET program (A)

A)IIS            B)Websphere

C) Tomcat D) None of the above

1. What are the advantages of BS-based web applications (ABCD)

A) Support cross-regional use B) Only need to maintain the central server

C) Higher performance requirements for the server D) Lower requirements for the client

Chapter 2 Basics of Web System Design

1. Assign green value to the bgcolor attribute of the body tag in the web page, and the entire page will appear as a green background. (√)

2. Labels should be used in pairs, and the list items inside are arranged by labels. Place as many labels as you need, and write the corresponding text in the LI label. (√)

1. HR label, its function is to display a horizontal line on the web page. (√)

2. The font label FONT is used to control the effect of fonts on the web page. It has three main attributes SIZE, COLOR and FACE. (√)

3. Tags for inserting images in HTML documents. It has a main attribute src, which is used to specify the path and file name of the picture. (√)

1. In the form, action sets the url address of the program that processes the form data. Such programs are usually client programs. ( × )

2. Method has two options: get and post. The get method sends the data to the server after the address specified by the action; the post method sends the data to the server in the format of the HTTP protocol. (√)

3. In input type="Text", type is used to specify the type of client control. (√)

4. In <input type="Text" name="age" value="18" size="8" maxlength="100", since the runat attribute is not specified, such controls are executed on the client by default. (√ )

5. In <input type="Text" name="age" value="18" size="8" maxlength="100" runat="server", since there is runat="server", it means this is a server control . (√ )

1. In <tr><th></th></tr>, it means a header row with only one column. (√ )

2. If you encounter a cell in the header or a cell in a row, you need to span two columns. Then you can consider using the Colspan attribute to set it. (√ )

3. Encountered the merge of cells spanning two rows. It can be set using the Rowspan property in the cell. (√ )

1. CSS is a control technology used to control appearance, performance and other characteristics in web pages ( √ )

1. The priority of inline style, embedded style and external style, the following description is incorrect (C)

A) If there are multiple styles, and the specified styles do not conflict, superimpose.

B) If there is a conflict, consider the inline style first, if not, then consider the embedded style display, if not, use the external style at last, and if there is no other style, it will be processed according to the system default style;

C) External styles have the highest priority

D) Inline styles have the highest priority

1. Which of the following styles are there (ABC)

A) Inline styles (small scope) B) Inline styles (single page scope) 

C) external styles (site-wide) D) none of the above is correct

2. Common style selectors include ( ABCD )

A) HTML selectors

B) class selector (class selector)

C) ID selector

D) Extensions for HTML selectors

1. External style sheet, as the name implies, the style sheet is not saved in a single webpage, but is saved as an independent file in the website, a style file shared by each webpage ( √ )

2. It is the grammatical format of <LINK rel="stylesheet" type="text/css" href="style file.css"> to import an external style sheet. (√)

1. In JavaScript, there are some input and output statements, and the statement is incorrect (C)

A) The Alert statement is used to pop up a dialog box on the screen, and the content is the input parameter of the alert function.

B) The Prompt statement is used to pop up an input box. This function has two parameters. The first parameter is the prompt information, and the second parameter is the default information in the input box. If it is not filled, the input box will be empty by default. The content entered by the user in the input box will be brought back into the code by the return value of the function;

C) Prompt has only a fixed number of parameters.

D) The function of Alert is a pop-up window.

2. The statement about the browser object model (BOM) is incorrect ( E )

A) Window is the browser window and belongs to the top-level node.

B) There are three secondary nodes: history, document and location

C) history is the address of the last visited web page.

D) location is the web page to be browsed next time.

E) document is not the currently browsed web page

3. The statement about the browser object model (BOM) is incorrect ( E )

A) Window is the browser window and belongs to the top-level node.

B) There are three secondary nodes: history, document and location

C) history is the address of the last visited web page.

D) location is the web page to be browsed next time.

E) document is not the currently browsed web page

1. In javascript, there are some input and output statements, and the statement is incorrect (C)

A) The Alert statement is used to pop up a dialog box to the screen, and the content is the input parameter of the alert function

B) The Prompt statement is used to pop up an input box. This function has two parameters. The first parameter is the prompt information, and the second parameter is the default information in the input box. If it is not filled, the input box will be empty by default. The content entered by the user in the input box will be brought back to the code by the return value of the function

C) Prompt has only a fixed number of parameters

D) The function of Alert is a pop-up window

1. The function of document.getElementById("myImg") does not include (D)

A) Take control of the control on the page with the ID myImg.

B) document represents the current web page

C) getElementById is a function used to obtain the control right of the control according to its ID.

D) myImg must be an image control.

Chapter 3 Website Creation Basics

1. The abbreviation of Internet Information Services, which means Internet information services, is a basic Internet service based on running Microsoft Windows provided by Microsoft. (√)

1. IIS is a Web (web page) service component that can be used for web browsing, file transfer, news service, and mail delivery, making it easier to publish information on the Internet. (√)

1. Which of the following descriptions is correct (A)

A) ASP.NET programs can run in IIS containers.

B) ASP.NET programs cannot run in IIS containers;

C) ASP.NET programs can run in the TomCat container

D) ASP.NET programs can run in the WebSphere container

2. Which of the following is the server software running ASP.NET program (A)

A)IIS

B)Websphere

C)Tomcat

D) None of the above

1. For the following description, the correct statement is ( ABDE )

A) ASP.NET technology is a rapid development technology for Web applications produced by Microsoft.

B) The installation of VS is a whole-process wizard, but you need to control several key options yourself

C) Installing VS is a fool-like process without intervention

D) ASP.NET technology can use C# as the server scripting language

E) ASP.NET technology can use javascript as client-side scripting language

Chapter 4 ASP.NET Programming Basics

1. "//Comment Text" is a single-line comment format, and "/*Comment Text*/" is a multi-line comment format. (√)

1. Is the analysis of the following code correct? (√)

string[] carTypes = {"Ford","BMW","Yugo","Honda"};

foreach(string c in carTypes){

Response.Write(c); Response.Write("<br>");

}

The output is: Ford

BMW

Yugo

huda

2. The statement "Person myTest1=new Person("Zhang San",21,60012)" is equivalent to the statement "Person myTest1; myTest1=new Person("Zhang San",21,60012)". (√)

1 Which of the following descriptions is incorrect (D)

A) Scripts are divided into server-side and client-side.

B) The server-side script is executed on the server after the client browser requests the page and before the server returns the page to the browser. The client cannot see the operating mechanism. The server-side script of asp.net usually uses C# language;

C) The server-side script can be referenced by the tag <script runat="server"></scirpt>, and can also be included in the display block <% %>

D) The client script is the code that returns to the client browser along with the page after the client requests the page. - *Generally use <script></scirpt> quotes, note that there is no runat="server". Client script does not use javascript language

1. The following statement is incorrect (D)
A) When loading the aspx page file, the Page. Load event in the code file will be triggered and the code in it will be executed. B
) Using the IsPostBack property of the Page object, you can check whether the .aspx page is For the browser's first visit, or refresh visit
C) Only when the page is loaded for the first time, the Page. IsPostBack property is false 
D) If the Page. IsPostBack property value is true, then this page is the first time to
load The correct one is ( D )
A) When the aspx page file is loaded, the Page._Load event in the code file will be triggered, and the code in it will be executed. B
) Using the IsPostBack property of the Page object, you can check whether the aspx page is the first in the browser First visit, or refresh visit
C) Only when the page is loaded for the first time, the Page. IsPostBack property is false
D) If the Page. IsPostBack property value is true, the page is loaded for the first time

1. When a member is declared with the static modifier, it is called a static member. The static member belongs to the class and is shared by all instances of the class. Static members can only be called by the class, not by the object. ( T )
2. Members declared without the static modifier are called instance members, and instance members belong to instances of the class. (T)
3. Public declares public members, and access to public members is not restricted, and
public members can be accessed from the outside, inside and derived classes of the class. ( T )
4.7.2 Multiple-choice question
1. For the Response built-in object, the description is incorrect ( D )
A) Use the Response.write method to output text to the screen
B) Use Response.Redirect to jump to the web page
C) Use Response.IsC1 ientConnected can check the connection status between the client and the server.
D) None of the above
1. private declares private members, private members can only be accessed by members of the class, and cannot be accessed externally. (T)
2. Protected declares protected members, which can be accessed by members of the class and derived classes. (T)
3. Internal declares internal members, and internal members are accessible only in files in the same project. (T)
4. The constructor is a special member function, which is mainly used to allocate space for the object, but cannot complete the initialization work. (X)
5. The reference parameter is different from the value parameter. The reference parameter does not create a new storage unit. It is in the same storage unit as the actual parameter variable in the method call. Therefore, the modification of the formal parameter in the method is the modification of the external actual parameter variable (T)

1. Adding the out modifier before the parameter is called an output parameter. It can only pass out values ​​from the method, but cannot accept actual parameter data from the method call. The out parameter is considered unassigned in the method, so the out parameter should be assigned (T) before the method ends

1. The following statement about the built-in object of Server, the correct statement is ( ABCDEF )
A) The MachineName attribute is used to obtain the server computer name
B) The MapPath method converts the virtual path into an actual path
C) The HtmlEncode method performs HTML encoding on the string to avoid The string is interpreted as HTML syntax
D) HtmlDecode method: the inverse operation of the HtmlEncode method to decode
E) Transfer method: terminate the current webpage and execute a new webpage, that is, realize redirection
F) Server.GetLastError(): get the generated by the system Error message
1. The overloading method in the figure below is parameter number overloading (√ )

1. For the built-in object of Application, the following statements are correct (ABCDE)
A) Because the Web site is actually a multi-user application, the Application object can be regarded as a bulletin board in a public place, and any user can write to it The information can be seen by other users
B) When the first user visits the website, the 0OnStart event of the Application object will be triggered, and when the site service is terminated, the OnEnd event of the Application object will be triggered C)
In the OnStart event of the Application object In the handler, the Add method is usually used to add Application ion variables.
D) In ​​the handler of the OnEnd event of the Application object, the operation of releasing the Application variable is usually performed.
E) The Application object is to save the common information for all users of the entire website.
1. The general base class can generate subclasses through the inheritance relationship (extended class, derived class). When declaring a subclass, the subclass name is preceded by a colon, and the colon specifies the name of the base class ( X )

1. For the session built-in object, the following statements are correct (ABCDE)

A) The Session object is also used to record information. But unlike the Application object, the Session object is private to a user. This means that online user A cannot access the Seesion object of concurrently online user B

B) Session object also has its lifetime. By default, if the browser does not visit any web pages in the website within 20 minutes, the Session object established by the website will be automatically released

C) In programming practice, the Session object is usually used to transfer information for the same user between different ASP.NET web pages.

D) There are mainly two Session object events, a Session_Start event, which is activated when a new user accesses an application; the other is a Session_End event, which is triggered when the user exits the application. E) Session_Start, Session_End Handlers for both events should be placed in a file called Global.asax

 1. If a member with the same name as the base class is declared in the derived class, a conflict will arise and cannot be resolved. (X)

2. Suppose class A derives class B, and class B derives class C, then class C has members of both class A and class B ( √ )

3. Inheritance means that the derived class obtains protected and public members from the base class; but cannot obtain constructors and private members (√)

4. If the derived class needs to rewrite the member function with the same name as the base class, you can use the new keyword. The system will judge whether to call the base class function or the derived class function according to the number and type of parameters or the return value type of the function ( √ )

1. Commonly used debugging methods are ( AB )

A) Breakpoint debugging

B) Output information method debugging

C) Check the code line by line.

D) do nothing

Chapter 5 Usage of Common Web Controls

1. The TextBox control is used to receive user input, and pass the value to the background code through the text property of the control. (√)

2. The Label tag assigns a text value to the text attribute of the label in the background code, so as to transmit the information to the screen. (√)

3. The property TextMode of TextBox can make the text box into single-line text, multi-line text or password box by assigning different values. (√)

4. The Text property of the Button control determines the text value on the button, and the code corresponding to the Click event is the program code that needs to be executed after the button is clicked. (√)

1. If the user wishes to select multiple options, which of the following statements is incorrect (C)

A) Multiple CheckBoxes can be used,

B) You can use a CheckBoxList

C) When using multiple CheckBoxes, there is no need to pay attention to the Checked value of a single control

D) When using a CheckBoxList, pay attention to judging the selection of elements one by one

2. If the user wants to choose multiple options and choose one, which of the following statements is incorrect (D)

A) Multiple radiobuttons can be used

B) Can use a Radiobuttonlist

C) When using multiple radiobuttons, pay attention to the GroupName value of a single control. Only when the GroupName value is the same can a mutually exclusive radio combination be formed

D) When using a Radiobuttonlist, the options cannot be dynamically populated using the database

1. Which of the following controls can realize selection (ABCD)

A)Checkbox

B)checkboxlist

C)radiobutton

D)radiobuttonlist

E) None of the above is true

1. The ImageButton control cannot be presented as an image. (X)

2. The LinkButton control cannot be presented as a hyperlink. (X)

1. For the DropDownList control and ListBox control, the description is incorrect (D)

A) both can be used as markers for their internal options

B) The SelectionMode property of the ListBox control has two choices: Single/Multiple, which respectively indicate single selection or multiple selection.

C) In the case of dynamically obtaining options, DataSourceID is the name of the data source that the DropDownList control and the ListBox control are bound to

D) None of the above is true

1. Which of the following is correct about mandatory validation controls and range validation controls (ABCDE)

A) The required validation control is the RequireFieldValidator control, and the range validation control is the RangeValidator control

B) ErrorMessage is common to both, indicating the error message when the constraints are not met

C) Display="Dynamic" of the required verification control means that the control does not occupy the page position when there is no error; Display="Static"; the control occupies the page position when there is no error.

D) ControlToValidate is common to both, indicating which input control value is verified. The MaximumValue and MinimumValue are exclusive to the range validation control, and represent the maximum and minimum values ​​of the range.

E) Type is the type of the input value of the range validation control. The value supports five types, namely string (character type), Integer (integer type), Double (floating point type), Data (date), Currency (currency type)

1. The following statements about the regular expression validation control, the correct statement is (ABCDE)

A) The regular expression validation control mainly uses the ValidationExpression property to specify the regular expression for validation, and uses mature regular expressions to validate the rules

B) This kind of verification control is mainly for the verification of some formats such as ID card, zip code, phone number and email address

C) ControlToValidate refers to the ID of the control to be checked

D) ValidationExpression refers to the regular expression used for validation

E) ErrorMessage refers to the error message that appears when it is illegal

1. Regarding the comparative verification control, which of the following statements is correct ( AB )

A) ControlToCompare refers to the control ID to be compared

B) ControlToValidate refers to which control to compare with

C) Operator refers to the comparison operator, which supports operations such as equal, not equal, greater than, and less than.

D) ErrorMessage is not an error message.

Chapter 6 Master Page

1. The function of the SiteMapPath control is to indicate the logical location of the page on the site, and help users understand the site structure. Through this navigation, you can quickly find the relevant location. (√)

2. When SiteMapPath is used, it is generally used in combination with web.sitemap files. web.sitemap is an xml file used to configure site structure data ( √ )

1. The difference between a content page and an ordinary page, the correct statement is ( ABCD )

A) The content page has the MasterPageFile attribute, but the normal page does not

B) The content page contains the Content control, and the normal page does not

C) Normal pages have key elements such as etc., but content pages do not

D) These key elements of the content page need to be provided by the master page

1. The TreeView navigation control can add navigation directories manually, bind database to read navigation directory data, program to dynamically add navigation directories, and other ways to add navigation directories. (√)

1. The Menu control consists of a tree of menu items (represented by MenuItem objects), and there is no top-level menu item. (X)

1. In the layout of the web page, for the T-shaped layout, which of the following statements is incorrect (D)

A) The top of the page generally places a horizontal website logo or Banner advertisement

B) Below left is the navigation bar menu

C) The lower right side is used to place the main content such as the text of the webpage

D) The unit logo is generally placed directly below the page

1. For the master page and content page, the wrong description is ( D )

A) The master page mainly places the common parts

B) The content page mainly places the special parts of each page

C) Content pages and master pages can access controls and content from each other

D) Content pages and master pages cannot access controls and content from each other

1. For the master page and ordinary page, the description is incorrect (D)

A) On the web page extension, the master page is .master, and the normal page is .aspx

B) On the statement directive, the master page is @master, and the normal page is @page

C) The master page contains a ContentPlaceHolder control, while the normal page does not

D) None of the above is true

1. The difference between the master page and the content page, the correct statement is ( ABCD )

A) The master page extension is .master while the content page is .aspx

B) The declaration directive for the master page is @master and the content page is @page

C) The master page contains a ContentPlaceHolder control, while the content page does not

D) The master page cannot be accessed by the browser, while the content page can

2. The advantages of using the master page, the following statements are correct (ABC)

A) Extract the common parts of the page and develop it only once. Reduced development effort

B) Because of the high integration, the modification of the public part only needs to be modified once, and the maintenance workload is greatly reduced

C) It is conducive to maintaining a unified style throughout the website

D) Better personalization and customization of web pages

3. Of the following statements, the correct statement is ( AB )

A) Call the methods and properties in the master: declare the information of the called page in the subpage, and then call it directly with master.XXXX()

B) Call the control in the master: search the id of the master page through FindControl in the child page, and call it

C) cannot call each other

D) Can call each other, but need third-party controls to cooperate

Chapter 7 Installation and Use of Sqlserver Database

1. SqlServer2008 software has two login modes, one is windows login mode, the other is sqlserver login mode. The latter of which applies to remote logins. (√)

1. Backup and separation are two data dump technologies. (√)

2. Restoration and addition are two data restoration techniques. Among them, restore and backup cooperate with each other, and attach and detach cooperate with each other. (√)

1. The value of the primary key in the table cannot be repeated, but it can be empty. (X)

1. Regarding the statement of insert into vehicle values('2015003',' Chuan AWW150','Jinbei van'), which of the following statements is incorrect (D)

A) vehicle is the name of the table to insert data into

B) The value in parentheses after values ​​is the value to be inserted

C) The values ​​in the parentheses after values ​​need to correspond to the fields in the vehicle table one by one

D) The values ​​in brackets after values ​​do not need to correspond to the fields in the vehicle table one by one

2. For the difference between update goods set weight=weight+5 where gno='2016001' and update goods set weight=weight+5, the wrong description is (D)

A) The first statement is to increase the weight value of a specific record by 5

B) The second statement is to increase the weight value of all records by 5

C) goods is the name of the table whose data is modified

D) weight is not the field name to be modified

1. For the statement select vlno, 'year limit', 2018-YEAR(buyday) from vehicle, the correct statement is ( ABCD )

A) vehicle is the name of the table

B) 'Years' is a constant field, and the final displayed results all have the same value

C) 2018-YEAR(buyday) is a calculated column, where YEAR(buyday) is the year to obtain the current time, and then subtract this value from 2018

D) The select field from table name is the basic format of the query

1. For the DELETE FROM vehicle WHERE vno='2015004' statement and the DELETE FROM vehicle statement, the description is incorrect (D)

A) vehicle is the table name

B) WHERE vno='2015004' is a restrictive condition, which means only delete the record with vno='2015004'

C) The second record will delete all the records in the entire table

D) The functions of the two statements are basically the same

1. For the following statement, select * from vehicle where kind like '%flat%', the correct statement is ( ABCD )

A)% is a wildcard, matching 0 to any number of any characters

B) kind like '%flat%' means to find all records containing the word "flat" in the kind field

C) * stands for querying all the columns

D) where is the keyword that brings out the condition when querying the condition

1. For the DELETE FROM vehicle WHERE vno='2015004' statement and the DELETE FROM vehicle statement, the description is incorrect (D)

A) vehicle is the table name

B) WHERE vno='2015004' is a restrictive condition, which means only delete the record with vno='2015004'

C) The second record will delete all the records in the entire table

D) The functions of the two statements are basically the same

1. For the following statement, select * from vehicle where kind like '%flat%', the correct statement is ( ABCD )

A)% is a wildcard, matching 0 to any number of any characters

B) kind like '%flat%' means to find all records containing the word "flat" in the kind field

C) * stands for querying all the columns

D) where is the keyword that brings out the condition when querying the condition

Chapter 8 ASP.NET Database Programming

1. In the SqlConnection conn=new SqlConnection(connstr) statement, the function of conn.Open() is to establish a connection with the server. (√)

1. The function implemented by the object created by the SqlConnection class is incorrect (D)

A) Establish a connection relationship with the database by giving link parameters

B) It can assist other objects to send sql statements to the database

C) is the name of a class

D) The class package it belongs to is system.data.sql

2. The statement description of SqlCommand cmd=new SqlCommand() is incorrect (C)

C) A) Create a SqlCommand object called cmd

B)SqlComman

d is responsible for processing the sql statement to be passed to the database server

C) cmd is not an object

D) SqlCommand() is the constructor of the SqlCommand class

1. The statement description of Response.Write(""); is correct ( B )

A) Use Response.Write to dynamically output the prompt box of the javascript statement to the screen

B) dno is not a variable defined by the previous statement

C) dname is a variable defined by the previous statement

D) The function of single quotation marks in the statement is to use quotation marks again in double quotation marks, which is equivalent to double quotation marks

1. For Response.Write(" <script>alert(insert data successfully, driver number is: "+dno +": driver name is: "+ dname +".');</script>") ; statement description is correct Yes (B)

A) Use Response.Write to dynamically output the prompt box of the javascript statement to the screen

B) dno is not a variable defined by the previous statement

C) dname is a variable defined by the previous statement

D) The function of single quotation marks in the statement is to use quotation marks again in double quotation marks, which is equivalent to double quotation marks 

1. SqlDataAdapter is a class whose main function is to encapsulate the actions of adding, deleting, checking and modifying using sql statements, and automatically perform tasks such as connection and data retrieval; it can be executed without instantiation as an object in use. (X)

1. The function of this.GridView1.DataSource=ds.Tables[0] statement is to use the data of the first table in the ds collection as the data source of the data display control GridView1. (√)

2. The function of this.GridView1.DataBind() statement is to bind the data of the GridView1 data source to the front-end display control, so that the user can see it. (√)

1. For the following statement, "server=127.0.0.1; uid=sa; pwd=sa123; database=transportation", the correct statement is ( AD )

A) server is the IP address of the database server

B) uid is the account number of the machine where the database is located

C) pwd is the password of the machine where the database is located

D) database is the name of the database in the database software on the server

Guess you like

Origin blog.csdn.net/qq_48499842/article/details/128463718