niusouti.com

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 Custome

题目

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()


相似考题
更多“You are creating a Web Form. You write the following code segment to create a SqlCommand o ”相关问题
  • 第1题:

    Does modern logistics mean transportation and delivery?

    ()Modern logistics is more about effective and efficient flow of materials and information.

    A、 Yes, you’re right

    B、 No, it’s not the whole story

    C、 No, you' re wrong


    参考答案:C

  • 第2题:

    – David, you've been losing your temper over nothing lately.– ( ).

    A. I haven’t been getting much sleep either

    B. You’d better not push yourself too hard, or you’ll get sick

    C. I’m sorry. I shouldn’t have blown up like that

    D. You’d better do exercises regularly


    正确答案:C

  • 第3题:

    将文献导入EndNote后,再安装Cite-While-You-Write插件,用户使用WORD撰写论文时便可实现参考文献的边写边插。


    正确

  • 第4题:

    You’re such a hardworking student, you()the praise.

    A、reserve

    B、deserve

    C、conserve

    D、preserve


    正确答案:B

  • 第5题:

    24、将文献导入EndNote后,再安装Cite-While-You-Write插件,用户使用WORD撰写论文时便可实现参考文献的边写边插。


    正确

  • 第6题:

    你最好控制一下上网聊天的时间。(汉译英)

    A.You'd better set a limit for your online chat time.

    B.You'd better set a limit on your online chat time.

    C.You'd better set a limit on your online chatting time.

    D.You'd better set a limit for your online chatting time.


    You'd better set a limit on your online chatting time.