试题详情
多项选择题 你正在创建一个Web窗体。你写了如下的代码段去创建一个 SqlCommand对象: 现在,你需要显示Customers表中客户的数量。下面那两个代码段能达到此目的?()

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

  • A,C
  • 关注下方微信公众号,在线模考后查看

热门试题