你正在创建一个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
答案解析:有
微信扫一扫手机做题