Last post Jul 15, 2016 08:53 PM by Mikesdotnetting
Jul 15, 2016 02:59 PM|tenchyz|LINK
I am trying to add Connection pooling to my Visual Studio Web App. I looked up some documentation that says all i have to do is update the ODBC driver by putting in a timeout number. So i did that, but i see some sites that say i have to enter in some code.
I am using C#. What would be the best way to activate connection pooling in my code and where would this code go? In the Web.config file or in the Aspx.cs file for my form?<-which is where my connection string is right now.
I have attached my one of my connections in the below.
public DataTable getsummarydata()
string summaryquerysql = getsummarysql();
OdbcConnection connection = new OdbcConnection("DSN=verticaitg");
OdbcDataAdapter adapter = new OdbcDataAdapter(summaryquerysql, connection);
DataSet1 dataset = new DataSet1();
DataSet1.DataTable1DataTable dt1 = new DataSet1.DataTable1DataTable();
DataSet1TableAdapters.DataTable1TableAdapter da1 = new DataSet1TableAdapters.DataTable1TableAdapter();
dataset.EnforceConstraints = false;
summaryrowcount = dt1.Rows.Count;
Jul 15, 2016 08:53 PM|Mikesdotnetting|LINK
You should read this info from Microsoft about ODBC connection pooling: https://msdn.microsoft.com/en-us/library/ms254502(v=vs.110).aspx