可学答题网 > 问答 > MCTS(70-528)题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

You are creating a Web Form. You write


You are creating a Web Form. You write the following code segment to create a SqlCommand object. SqlConnection conn = new.SqlConnection(connString); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = “select cont(*) from Customers”; You need to display the number of customers in the Customers table. Which two code segments can you use to achieve this goal? ()

  • A object customerCount = cmd.ExecuteScalar();lblCompanyName.Text = customerCount.ToString();
  • B int customerCount = cmd.ExecuteNonQuery();lblCompanyName.Text = customerCount.ToString();
  • C SqlDataReader dr = cmd.ExecuteReader();dr.Read();lblCompanyName.Text = dr[0].ToString();
  • D SqlDataReader dr = cmd.ExecuteReader();dr.Read();lblCompanyName.Text = dr.ToString()
参考答案
参考解析:
分类:MCTS(70-528)题库
相关推荐

1、You are creating a mobile Web Form tha

You are creating a mobile Web Form that dynamically displays news items. You want to display news items by using an instance of a mobile Tex...

2、You create a Web Form. The Web Form u

You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database. When the user clicks the...

3、You are creating a Web Form. The Web

You are creating a Web Form. The Web Form allows users to rename or delete products in a list. You create a DataTable named dtProducts that...

4、You are creating a Web Form. The Web

You are creating a Web Form. The Web Form allows users to rename or delete products in a list. You create a DataTable named dtProducts that...

5、You are creating a mobile Web Form th

You are creating a mobile Web Form that dynamically displays news items. You want to display news items by using an instance of a mobile Tex...

6、You create a Web Form. The Web Form al

You create a Web Form. The Web Form allows users to log on to a Web site. You implement the login logic using a Login control named Login1...