Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is Execute NOn Query?

Answer Posted / nandu

ExecuteNonQuery

Use: when we are talking about a single database record - in Update, Insert, Delete and Get by Id. In all these cases we can use input/output/input-output parameters. Please note that from the application architecture point of view it is also good practices when your Insert and Update stored procedure returns changed record exactly like Get By Id method does.

Conclusion

Always use ExecuteNonQuery except: when you have a set of records - use ExecuteReader and when you have a single output value that cannot be defined as a parameter - use ExecuteScalar. Hope this helped to clarify something.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create data relations?

998


Does dapper use ado.net?

1016


What are the different execute methods of Ado.Net?

1023


Where is adodb dll located?

962


Which ado.net object is very fast in getting data from the database?

1103


What are the main differences between classic ado and ado.net?

1019


What two types of data providers does ADO.NET supply? What determines which one you should use?

989


Which is better ole db or odbc?

907


What is linq and entity framework?

1007


What is connected architecture in ado.net?

1067


What is data view and variable view?

910


Which keyword is used to accept variable number of parameters?

1119


How can you add or remove rows from the datatable object of dataset?

1025


What is difference between connected and disconnected architecture in ado.net?

1152


How can we check that some changes have been made to dataset since it was loaded?

970