可学答题网 > 问答 > 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.Dim conn As SqlConnection = New SqlConnection(connString)conn.Open()Dim cmd As SqlCommand = conn.CreateCommand()cmd.CommandText = "select count(*) 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 Dim customerCount As Object = cmd.ExecuteScalar()lblCompanyName.Text = customerCount.ToString()
  • B Dim customerCount As Integer = cmd.ExecuteNonQuery()lblCompanyName.Text = customerCount.ToString()
  • C Dim dr As SqlDataReader = cmd.ExecuteReader()dr.Read()lblCompanyName.Text = dr(0).ToString()
  • D Dim dr As SqlDataReader = cmd.ExecuteReader()dr.Read()lblCompanyName.Text = dr.ToString()
参考答案
参考解析:
分类:MCTS(70-528)题库