开发者

How to decide when use ADO.NET and when to connect to the database?

I'm learning some ADO.NET. I noticed quite a few Database functionality can also be found in ADO.NET.

I'm kind of confused. Do I use ADO.NET to manage all th开发者_StackOverflowe interactions or should I make call to the Database?

I don't know what should be done by ADO.NET and what should be done at the database level.

Thanks for helping.


If you mean what should be handled in SQL statements issued from ADO.NET, and what should be done in stored procedures stored at the database level, as much as possible in stored procedures, at least that's what I live by. In addition to eliminating the chance of SQL injection, stored procedures allow you to modify sql calls without having to recompile and deploy your code as well as they enable execution plan re-use by the query optimizer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜