If i am expecting a single result from sqlserverdatabase
then what command should i follow ?sqlcommand.executereader
(commandbehaviour.singleresult)or sqlcommand.executescalar()

Answer Posted / m.mohan krishna

Sqlcommand.executescalar() is preffered.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is datasource in ado.net?

813


What is method to get XML and schema from Dataset? getXML() and get Schema ()

757


What is ado circle?

871


What is difference between sqldatareader and sqldataadapter?

700


What is row state?

710


What is ado code?

708


What is partial class?

735


What is the meaning of object pooling?

840


What is dao and ado?

704


What are good ado.net object to replace to ado recordset object.

780


What is the difference in an abstract class and an interface?

721


Describe connection object in ado.net

751


How to Read, Add, Update and Delete record in Entity Framework ?

780


What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

766


oledbdataadpter with ms access in c#.net giving exception System.Data.OleDb.OleDbException while writing adapter.update(dataset,"tabname"); how to update the database from dataset?

2131