Office Document APIs for .NET
ITIL Career Advice
PMP Career Advice
Android Intel XDK
Welcome Guest !
You are writing a method to do the following:
* Add a new row to a DataTable
* Set the second column, a column named LastName, to a string named lastName
Which code segment should you choose?
on 9/30/2012 | Category:
ADO.NET Interview questions
| Views: 1431 |
Select from following answers:
dt.Rows[dt.Rows.Count]["LastName"] = lastName;
DataRow dr = dt.NewRow(); dr["LastName"] = lastName; dt.Rows.Add(dr);
To add a new row, first call the DataTable.NewRow method. Call the RowCollection.Add method to add to the DataTable.
You should not use the DataRow constructor to create a new DataRow. Use DataTable.NewRow instead.
Show Correct Answer
MeasureUp.Com | |
< Previous :
You use SqlDataAdapter to load a DataTable with ro ...
Next > :
You are creating a smart client application. When ...
Comments or Responses
Login to post response
More Interview Questions by Rajkatie
You are creating a smart client application. When the application is o ...
You are creating a method to validate column values of a given DataRow ...
You must choose a method to create a new DataRow to add to a DataTable ...
You are implementing a method that uses Entity Framework to update a P ...
You are implementing a method that uses Entity Framework to insert a P ...
You are implementing a WCF Service method. The method uses Entity Fram ...
You are implementing an application that uses LINQ to SQL to update a ...
You implement a method that uses Entity Framework to perform several u ...
Latest Interview Questions
How to Create Database and Tables insert,edit,Delete using Procedure?
How to publish service metadata?
What is a metadata export?
How can we specify the throttling behavior for a WCF service?
What is a Throttling behavior in WCF?
Explain the functionality of the Message layer in WCF.
Give an example of a duplex service
How can you specify a duplex service?