QuestPond: Interview Questions and Answers on learning ADO.NET

Explain in detail the fundamental of connection pooling?

When a connection is opened first time, a connection pool is created and is based on the exact match of the connection string given to create the connection object. Connection pooling only works if the connection string is the same. If the connection string is different, then a new connection will be opened, and connection pooling will not be used.

Untitled  Figure: – Connection pooling in action

Let us try to explain the same pictorially. In the above figure, you can see there are three requests “Request1”, “Request2”, and “Request3”. “Request1” and “Request3” have same connection string so no new connection object is created for “Request3” as the connection string is same. They share the same object “ConObject1”. However, new object “ConObject2” is created for “Request2” as the connection string is different.

Note: - The difference between the connection string is that one 
has “User id=sa” and other has “User id=Testing”.

What is Maximum Pool Size in ADO.NET Connection String?

Maximum pool size decides the maximum number of connection objects to be pooled. Ifthe maximum pool size is reached and there is no usable connection available the requestis queued until connections are released back in to pool. So it’s always a good habit tocall the close or dispose method of the connection as soon as you have finishedwork with the connection object.

How to enable and disable connection pooling?

For .NET it is enabled by default but if you want to just make yourself double sure, set Pooling=true inthe connection string. To disable connection pooling set Pooling=false in connectionstring if it is an ADO.NET Connection. 

If it is an OLEDBConnection object set OLEDB Services=-4 in the connection string.

See following video on ADO.NET Connection pooling: –

 

Click and see here for more stuffs complete learning guide for ADO.NET.

About C#.NET, ASP.NET MVC Core, Angular, Azure, (MSBI)Business Intelligence, Data Science - Python Interview Questions

This blog is for developers who want to crack .NET and C# interviews. It has all tips and tricks needed to crack .NET interviews , C# interview , SQL Server interview , Java interview , WCF Interview , Silverlight interview , WPF interview , LINQ interview , Entity framework Interview. Do not forget to watch our Learn step by step video series. ASP.NET MVC Interview Questions and Answers:- https://youtu.be/pXmMdmJUC0g C# Interview Questions and Answers:- https://youtu.be/BKynEBPqiIM Angular Interview Questions and Answers:- https://youtu.be/-jeoyDJDsSM C# tutorial for beginners(4 hrs.):- https://youtu.be/AxEGRBFwlmI Learn Azure Step by Step:- https://youtu.be/wdUK7bCMXqs Azure AZ-900 fundamentals certification :- https://youtu.be/hC9iGgJorz8 AZ- 204 certification Azure:- https://youtu.be/qI8PRn2C080 Learn Angular tutorial step by step https://tinyurl.com/ycd9j895 Learn MVC 5 step by step in 16 hours:- https://youtu.be/Lp7nSImO5vk Learn Design Pattern Step by Step https://goo.gl/eJdn0m Learn MSBI Step by Step in 32 hours:- https://goo.gl/TTpFZN Learn SQL Server Step by Step http://tinyurl.com/ja4zmwu Python Tutorial for Beginners:- https://youtu.be/KjJ7WzEL-es Learn Data Science in 1 hour :- https://tinyurl.com/y5o7qbau Learn Power BI Step by Step:- https://tinyurl.com/y6thhkxw Learn Tableau step by step :- https://tinyurl.com/kh6ojyo
This entry was posted in Uncategorized and tagged , , , , , , , , . Bookmark the permalink.

Leave a comment