欢迎来到易学考试网 易学考试官网
全部科目 > 微软认证考试 > MCTS > MCTS(70-528)

多项选择题

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

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题