adplus-dvertising
frame-decoration

Question

Which of the following sample code is used to retrieve single row at a time?

a.

public USER GetUser(string userName)
{
DBNameDataContext myDB = NEW DBNameDataContext();
USER USER = myDB.Users.Single(u, u.UserName=>userName);
RETURN USER;
} ?

b.

public USER GetUser(string userName)
{
DBNameDataContext myDB = NEW DBNameDataContext();
USER USER = myDB.Users.One(u, u.UserName=>userName);
RETURN USER;
} ?

c.

public USER GetUser(string userName)
{
DBNameDataContext myDB = NEW DBNameDataContext();
USER USER = myDB.Users.findOne(u, u.UserName=>userName);
RETURN USER;
} ?

d.

All of the mentioned

Posted under SQL Server

Answer: (a).public USER GetUser(string userName)
{
DBNameDataContext myDB = NEW DBNameDataContext();
USER USER = myDB.Users.Single(u, u.UserName=>userName);
RETURN USER;
} ?

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following sample code is used to retrieve single row at a time?

Similar Questions

Discover Related MCQs

Q. Which of the following method is used to delete records in LINQ?

Q. Which of the following code in LINQ performs functionality similar to joins in SQL?

Q. Service broker was added to SQL Server ___________

Q. Point out the correct statement.

Q. There are _________ components of the Service broker in SQL Server.

Q. Which of the following service broker component defines the infrastructure used for exchanging messages between instances?

Q. Point out the wrong statement.

Q. Service Broker also provides security by preventing __________ access from networks and by message encryption.

Q. (SSBS) is a new architecture which allows you to write ____________ message based application.

Q. Which of the following change was introduced in SQL Server 2012 related to Service Broker?

Q. Which of the following is a Service Broker Related Dynamic Management View?

Q. Which of the utility is used for reporting the issue in Service Broker?

Q. ___________ is a set of technologies for copying and distributing data and database objects from one database to another.

Q. Point out the correct statement.

Q. How many types of replication is provided by SQL Server?

Q. Replication in SQL Server is used to overcome ________________

Q. Point out the wrong statement.

Q. Which of the following stored procedure provide replication support for AlwaysOn?

Q. How many types of replication components are present in SQL Server?

Q. Which of the following makes data available for replication?