Th206thi tài liệu trắc nghiệm lập trình web topica

23 325 4
Th206thi  tài liệu trắc nghiệm lập trình web topica

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Giả sử trong cơ sở dữ liệu BookShop có procedure được tạo ra bằng script: CREATE PROCEDURE InsertOrder (ID int = NULL output, BookID int, Quantity int) … Cho biết nguyên nhân sinh ra lỗi khi chạy đoạn code dưới đây? SqlConnection connection = new SqlConnection(“Data source=localhost;Initial catalog=BookShop”); SqlCommand command = new SqlCommand(“InsertOrder”, connection); command.CommandType=CommandType.StoredProcedure; command.Parameters.Add(“ID”, SqlDbType.Int); command.Parameters.Add(“BookID”, SqlDbType.Int).Value = bookID; command.Parameters.Add(“Quantity”, SqlDbType.Int) = quantity; connection.Open(); command.ExecuteReader(); connection.Close(); A) Không thể thực hiện command.ExecuteReader() để chạy một Stored Procedure Giả sử trong cơ sở dữ liệu BookShop có procedure được tạo ra bằng script: CREATE PROCEDURE InsertOrder (ID int = NULL output, BookID int, Quantity int) … Cho biết nguyên nhân sinh ra lỗi khi chạy đoạn code dưới đây? SqlConnection connection = new SqlConnection(“Data source=localhost;Initial catalog=BookShop”); SqlCommand command = new SqlCommand(“InsertOrder”, connection);

A ASP viết tắt bởi: A) Active Server Pages B Biểu thức sau sai chưa định sử dụng namespace System.Data? C) DataTable table = (DataTable)listBox1.DataSource; Biểu thức sau sai chưa định sử dụng namespace System.Xml? D) XmlTextReader rdr; Biểu thức sau sai chưa định sử dụng namespace System.Web.UI.WebControls? A) Button button = (Button)form1.Controls[0]; C Các bước bắt buộc để đưa DataTable lên đối tượng DataList gồm: B) Gán DataList.DataSource = DataTable gọi DataList.DataBind() Các HTML control gồm nhóm nào? C) HtmlInputControl, HtmlContainerControl HtmlImage Các web service xây dựng file có phần mở rộng nào? B) asmx Control khơng thể thơng tin có tính chất danh sách? B) Có thể truy cập đến node gốc XmlDocument thuộc tính nào? A) DocumentElement Có thể truy cập đến node XmlNode thuộc tính nào? C) FirstChild Cấu trúc liệu đối tượng XmlDocument có dạng nào? B) Cây (Tree) Câu lệnh SQL thực SqlCommand đặt vào thuộc tính nào? A) CommandText Cho biết kết trả web service Fibonacci sau tham số đầu vào 7? [WebMethod] int Fibonacci(int t) { if (t < 3) return t; return Fibonacci(t – 1) + Fibonacci(t – 2); } D) 21 Cho control sau: Biểu thức cho phép truy cập đến item chọn control? C) CheckBoxList1.Items[CheckBoxList1.SelectedIndex] Cho control sau: Biểu thức cho phép truy cập đến danh sách item control? C) CheckBoxList1.Items Cho xml sau: asp.net “asp.net” XmlNode có tên Order B) ChildNodes[0].Value Cho xml sau: asp.net “ID” XmlNode có tên Order A) FirstChild.Name Cho xml sau: asp.net “Type” XmlNode có tên Order C) Attributes[0].Name Cho file Book.xml sau: 1 1 Hãy cho biết số lượng DataTable DataSet sau đọc Schema file này? B) Cho file Book.xml sau: 1 1 10 Hãy cho biết Tables[1].Columns.Count DataSet sau đọc Schema file này? C) Cho biết đoạn tag sau có sai txtCommand txtCommandValue tên HtmlInputText form1? C) HtmlInputText khơng có thuộc tính Text Cho biết đoạn tag WSDL sau mô tả cho Web service nào? maxOccurs="1" name="BinToDecResult" A) string BinToDec(string BinaryNumber) Cho biết đoạn tag WSDL sau mô tả cho Web service nào? C) string GetWeather(string CityName, string CountryName) Cho đoạn xml sau: 1 1 Nếu node tên đối tượng XmlNode trỏ đến xâu s sau thực đoạn chương trình đây? s = “”; XmlNode n = node.FirstChild; while (n != null) { s += n.Name + “ “; n = n.NextSibling; } C) ID ProductID Control kiểm tra giá trị khoảng cho trước? B) < asp:RangeValidator> Cho đoạn thẻ sau đây: … < /asp:DropDownList> Lệnh C# tương đương với tag D) DropDownList1.Items.Add(new ListItem(“Item 1”, “1”)) Cho đoạn thẻ sau đây: Khi Page load lần đầu tiên, biểu thức CheckBoxList1.SelectedIndex cho giá trị nào? B) Cho đoạn thẻ sau đây: Đoạn code sau cho sum bao nhiêu? int sum = 0; foreach (ListItem item in CheckBoxList1.Items) if (!item.Selected) sum += int.Parse(item.Value); C) 25 Cho đoạn xml sau: 1 1 Nếu node tên đối tượng XmlNode trỏ đến biểu thức sinh lỗi chạy chương trình? B) node.ChildNodes[2].Value Cho file Book.xml sau: 1 1 Hãy cho biết DataSetName DataSet sau đọc Schema file này? D) Catalog Cho file Book.xml sau: 1 10 1 Hãy cho biết Tables[0].TableName DataSet sau đọc Schema file này? B) Order Cho biết đoạn tag WSDL sau mô tả cho Web service nào? C) string DecToBin(int DecimalNumber) Cho file sau đây: MyTable.ascx: public string Value { get { return …; } } UsingMyTable.aspx: Trong file có sai? B) Khơng thể gán giá trị cho thuộc tính Value Cho đoạn code sau: string xml = "1"; foreach (DataRow r in this.tblGioHang.Rows) xml += string.Format("{0}{3}{4}", r.ItemArray); xml += ""; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); Nếu tblGioHang có hàng doc.DocumentElement có node con? C) Cho đoạn code sau: string xml = "1"; foreach (DataRow r in this.tblGioHang.Rows) xml += string.Format("{0}{3}{4}", r.ItemArray); xml += ""; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); Nếu tblGioHang.Rows[0].ItemArray có giá trị {1, “Chu Lai”, “Nắng đồng bằng”, 4, 50000} doc.DocumentElement.Firchild.NextSibling.ChildNodes [3].InnerText có giá trị nào? C) “4” Cho đoạn code sau: protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { DanhMucSach dm = new DanhMucSach(); dm.Table = new DataTable(); this.Session["DanhMucSach"] = dm; // } } Trong đoạn server-side code khác, biểu thức đúng? B) DanhMucSach dm = (DanhMucSach)Session[“DanhMucSach”]; Cho đoạn code sau: DataTable table = new DataTable(); … DataRow row = table.NewRow(); Cho biết trạng thái đối tượng row? B) RowState.Detached Cho đoạn code sau: DataTable table = new DataTable(); … DataRow row = table.NewRow(); … table.Rows.Add(row); Cho biết trạng thái đối tượng row? A) RowState.Added Cho file aspx sau: void Button1_Click(object sender, EventArgs e) { Response.Write(Button1.Text); } File có lỗi nào? D) Khơng có đối tượng có tên Button1 Cho file aspx sau: void Button1_Click(object sender, EventArgs e) { } File có lỗi nào? D) Không định code chạy server Cho file aspx sau: File có lỗi nào? C) Khơng có hàm xử lý kiện Cho đoạn tag sau: Vì hai RadioButton khơng thể có thuộc tính Checked “true”? B) Chúng có GroupName D Directive cho phép dùng namespace? B) Import Đâu tag xác định Web Server Control? B) Dùng định để định nghĩa service web service? C) [WebMethod] Để duyệt qua tất hàng DataTable cần sử dụng thuộc tính nào? B) Rows Để tạo combo box cần dùng tag B) Để duyệt qua tất giá trị DataRow cần sử dụng thuộc tính nào? D) ItemArray Để duyệt qua tất cột DataTable cần sử dụng thuộc tính nào? C) Columns Để chọn hàng DataTable có thuộc tính Price lớn 50 phải sử dụng tham số phương thức Select? C) “Price > 50” Để chọn hàng DataTable có thuộc tính Price lớn 50, kết xếp theo thuộc tính “Name” phải sử dụng phương thức Select nào? C) Select(“Price > 50”, “Name”) Để ẩn nhiều control lúc, nhóm chúng vào HtmlControl nào? A) Để sử dụng đối tượng Stack cần sử dụng namespace nào? B) System.Collections Để sử dụng đối tượng XmlTextReader cần sử dụng namespace nào? C) System.Xml Để sử dụng web service ASP.NET project, cần thêm vào References A) WScủa web service Để sử dụng đối tượng IDbCommand, IDbConnection cần sử dụng namespace nào? A) System.Data Đối tượng server trả có yêu cầu trang aspx? A) string BinToDec(string BinaryNumber) Đối tượng server trả có yêu cầu trang aspx? D) Response Đoạn xml có sai? C) khơng có G Giả sử sở liệu BookShop có bảng tableOrder Cho biết nguyên nhân sinh lỗi chạy đoạn code đây? SqlConnection connection = new SqlConnection(“Data source=localhost;Initial catalog=BookShop”); SqlCommand command = new SqlCommand(); command.CommandText = “SELECT * FROM tableOrder” connection.Open(); command.ExecuteReader(); connection.Close(); D) Chưa thiết lập thuộc tính Connection cho command Giả sử sở liệu BookShop có procedure tạo script: CREATE PROCEDURE InsertOrder (@ID int = NULL output, @BookID int, @Quantity int) … Cho biết nguyên nhân sinh lỗi chạy đoạn code đây? SqlConnection connection catalog=BookShop”); = new SqlConnection(“Data source=localhost;Initial SqlCommand command = new SqlCommand(“InsertOrder”, connection); command.Parameters.Add(“@ID”, SqlDbType.Int); command.Parameters.Add(“@BookID”, SqlDbType.Int).Value = bookID; command.Parameters.Add(“@Quantity”, SqlDbType.Int) = quantity; connection.Open(); command.ExecuteNonQuery(); connection.Close(); C) command.commandType không phù hợp Giả sử sở liệu BookShop có procedure tạo script: CREATE PROCEDURE InsertOrder (@ID int = NULL output, @BookID=NULL int, @Quantity int, @All bit) … Cho biết nguyên nhân sinh lỗi chạy đoạn code đây? SqlConnection connection = new SqlConnection(“Data source=localhost;Initial catalog=BookShop”); SqlCommand command = new SqlCommand(“InsertOrder”, connection); command.CommandType=CommandType.StoredProcedure; command.Parameters.Add(“@ID”, SqlDbType.Int); command.Parameters.Add(“@BookID”, SqlDbType.Int); command.Parameters.Add(“@Quantity”, SqlDbType.Int); command.Parameters.Add(“@All”, SqlDbType.Bit).Value=true; connection.Open(); command.ExecuteNonQuery(); connection.Close(); B) Chưa thiết lập Value cho Parameter “@Quantity Giả sử sở liệu BookShop có procedure tạo script: CREATE PROCEDURE InsertOrder (@ID int = NULL output, @BookID int, @Quantity int) … Cho biết nguyên nhân sinh lỗi chạy đoạn code đây? SqlConnection connection = new SqlConnection(“Data source=localhost;Initial catalog=BookShop”); SqlCommand command = new SqlCommand(“InsertOrder”, connection); command.CommandType=CommandType.StoredProcedure; command.Parameters.Add(“@ID”, SqlDbType.Int); command.Parameters.Add(“@BookID”, SqlDbType.Int).Value = bookID; command.Parameters.Add(“@Quantity”, SqlDbType.Int) = quantity; connection.Open(); command.ExecuteReader(); connection.Close(); A) Không thể thực command.ExecuteReader() để chạy Stored Procedure Giả sử sở liệu BookShop có procedure tạo script: CREATE PROCEDURE InsertOrder (@ID int = NULL output, @BookID int, @Quantity int) … Cho biết nguyên nhân sinh lỗi chạy đoạn code đây? SqlConnection connection = new SqlConnection(“Data source=localhost;Initial catalog=BookShop”); SqlCommand command = new SqlCommand(“InsertOrder”, connection); command.Parameters.Add(“@ID”, SqlDbType.Int); command.Parameters.Add(“@BookID”, SqlDbType.Int).Value = bookID; command.Parameters.Add(“@Quantity”, SqlDbType.Int) = quantity; connection.Open(); command.ExecuteNonQuery(); connection.Close(); C) command.commandType không phù hợp Giả sử r DataRow DataTable, để thêm r vào đối tượng DataTable có tên table phải dùng biểu thức nào? D) table.ImportRow(r) Giá trị trả service tuân theo chuẩn nào? A) XML Giá trị Parameter thuộc tính nào? A) Value H I InnerText giá trị (Value) Element nào? B) Element khơng có ChildNode K Kết trả phương thức Select DataTablelà gì? B) Một mảng DataRow Khi XmlNode tạo từ Xml có cấu trúc Value gì? B) null L M Mơ hình liệu XmlDataDocument lưu trữ file có phần mở rộng nào? B) xsd Mơ hình liệu XmlDataDocument lưu trữ file có phần mở rộng nào? B) xsd Một Stored Procedure có tham số sau: @ID int, @Name nvarchar(50), DOB datetime, @Male bit Nếu checkbox1 tên CheckBox Control command tên đối tượng SqlCommand biểu thức sau đúng? C) command.Parameters.Add(“@Male”, SqlDbType.Bit).Value = checkbox1.Checked Một web service xây dựng tảng class nào? C) WebService Một XmlNode khơng có node có NodeType gì? A) Text Một Stored Procedure có tham số sau: @ID int, @Name nvarchar(50), DOB datetime, @Male bit Hãy chọn tham số thêm tham số đối tượng SqlCommand với tên command cho @DOB A) command.Parameters.Add(“@DOB”, SqlDbType.DateTime) Một đối tượng XmlTextWriter sau thực phương thức WriteComment(“Comment Text”); ghi dòng vào file xml? D) Một đối tượng XmlTextWriter sau thực phương thức WriteElement(“Order”); ghi dòng vào file xml? A) Một class xây dựng đâu? A) Trong file cs Một Web User Control xây dựng file “MyTable.ascx” Directive cho phép sử dụng control file aspx A) N Namespace chứa class định nghĩa đối tượng tập hợp khác nhau? B) System.Collections Namespace chứa class cho phép truy cập tương tác với sở liệu? A) System.Data Nếu node tên đối tượng XmlNode biểu thức tương đương với node.FirstChild.NextSibling? A) node.ChildNodes[1], Nếu node tên đối tượng XmlNode biểu thức tương đương với node.FirstChild.NextSibling? A) node.ChildNodes[1], Nếu tw tên đối tượng XmlTextWriter dòng ghi vào file xml sau thực đoạn code sau: tw.WriteStartElement(“Order”); tw.WriteStartElement (“Type”); tw.WriteString(“1”); A) 1 Nếu tw tên đối tượng XmlTextWriter dòng ghi vào file xml sau thực đoạn code sau: tw.WriteStartElement(“Order”); tw.WriteAttributeString(“Type”, “1”); tw.WriteEndElement(); B) Nếu ShoppingCart web service thêm vào references project với tên reference localhost có chứa webmethod InsertDatHang(string) Giả sử xml tên biến kiểu string, biểu thức sau chắn đúng? A) localhost.ShoppingCart sc = new localhost.ShoppingCart(); sc.InsertDatHang(xml); Nếu đối tượng DataRow có trạng thái RowState.Unchanged, bị xóa khỏi DataTable.Rows trạng thái gì? D) DataRowState.Deleted P Phương thức SqlCommand dùng để đọc bảng liệu? A) ExecuteReader() Phương thức SqlCommand dùng để lấy giá trị từ bảng? C) ExecuteScalar() Phương thức DataAdapter dùng để cập nhật thay đổi liệu từ DataTable vào sở liệu? B) Update() Phương thức DataSet dùng để ghi liệu vào file xml? A) WriteXml() Phương thức DataSet dùng để đọc liệu từ file xml? C) ReadXml() Phương thức SqlCommand dùng để thực procedure? B) ExecuteNonQuery() Phương thức DataSet dùng để đọc cấu trúc bảng liệu từ file xsd? D) ReadXmlSchema() Phương thức XmlDocument dùng để đọc xâu ký tự theo chuẩn XML? B) LoadXml() Phương thức DataAdapter dùng để đưa liệu vào DataTable? A) Fill() Phương thức DataSet dùng để ghi cấu trúc bảng liệu vào file xsd? B) WriteXmlSchema() Phương thức DataSet dùng để ghi liệu vào file xml? A) WriteXml() R S T Tag tạo control nào? B) Một nhập dòng ký tự Tag tạo control nào? C) Một ô nhập nhiều dòng ký tự Tag tạo control nào? A) Một dòng link đến web page Tập tham số SqlCommand là? D) Parameters Thuộc tính DataAdapter chứa câu SQL thêm liệu vào sở liệu? B) Insertcommand Thuộc tính DataAdapter chứa câu SQL cập nhật liệu sở liệu? C) UpdateCommand Thuộc tính DataAdapter chứa câu SQL xóa liệu sở liệu? D) DeleteCommand Thuộc tính Session định thời gian tồn vùng nhớ nó? A) TimeOut Thuộc tính Parameter định tham số đầu vào ra? B) Direction Thuộc tính DataAdapter chứa câu SQL thêm liệu vào sở liệu? B) Insertcommand Thuộc tính định số lượng Item thể DataList? A) DataSource Thuộc tính định thành phần xử lý phía Server? C) runat = “server” Thuộc tính DataAdapter chứa câu SQL đọc liệu vào DataSet? A) SelectCommand Thành phần file ASPX có ASP.NET? B) Web Control Tag Thành phần Provider dùng để chạy câu SQL? B) Command Thành phần Provider cho phép kết nối đến sở liệu? A) Connection Trong đoạn tag có khơng đúng? * D) Không thể kiểm tra CheckBox control RangeValidator X XmlTextReader có tác dụng gì? A) Đọc file xml XmlTextWriter có tác dụng gì? B) Ghi file xml V W WSDL gì? B) Ngơn ngữ mơ tả web service Web User Control có control Biểu thức thuộc tính đặt dòng chữ control viết thể nào? B) set { Label1.Text = value; }

Ngày đăng: 04/08/2019, 08:47

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan