niusouti.com

You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.)01 DataTable dt = new DataTable(Products”);02 dt.Columns.Add(new DataColumn(Price”, typeof(decimal)));03 dt.Columns.Ad

题目

You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.)01 DataTable dt = new DataTable(Products”);02 dt.Columns.Add(new DataColumn(Price”, typeof(decimal)));03 dt.Columns.Add(new DataColumn(Quantity”, typeof(Int32)));04 DataColumn dc = new DataColumn(Total”, typeof(decimal));05 dt.Columns.Add(dc);You need to ensure that the Total column is set to the value of the Price column multiplied by the Quantity column when new rows are added or changed. What should you do? ()

A. Add the following code segment after line 05. dc.ExtendedProperties["Total"] = "Price * Quantity”;

B. Add the following code segment after line 05. dc.Expression = “Prince * Quantity”;

C. Write an event handler for the DataTable‘s TableNewRow event that updates the row‘s Total.

D. Write an event handler for the DataTable‘s ColumnChanged event that updates the row‘s Total.


相似考题
参考答案和解析
参考答案:B
更多“You are creating a DataTable. You use the following code segment to create the DataTable. ”相关问题
  • 第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题:

    Me,you是两个初始集合,则下列关于派生集合定义方式正确的是

    A.link/me,you/:a;

    B.link(me,you):a;

    C.link/me you/a;

    D.link(me,you)/a;


    link(me,you):a;

  • 第4题:

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

    A、reserve

    B、deserve

    C、conserve

    D、preserve


    正确答案:B

  • 第5题:

    You've misspelled this word again.You'd better look it up ()

    此题为判断题(对,错)。


    参考答案:对

  • 第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.