Hi friends, I have one web service in which I have 3 vb.net modules
and my service InventoryService.asmx in which I call the GeAllAgencies in the ApplicationManager.vb and in turn that method calls the GetAgency in AgencyManager.vb
and that GetAgency function calls the methods in InventoryManager.vb like GetAllItems,GetAvailableItems ... so on there are more methods.
My problem is that I am opening SQLConnection() every time in every module like in GetAgency() function in ApplicationManager, GetAgency() function in AgencyManager and at last all the methods in InventoryManager opens a connection for each individual, this cause me to open a lot of connections and problem is that when I run my service for the first time I am getting the data fastly but for the second time (I mean in the same run I invoke first service and in the second service invoke) I am unable to get the data. I thought this problem is occurred due to more connections and my question is
how to open a sqlconnection (I want to open in InventoryService.asmx) so it is visible to whole application and with the same con object.
can I make the single "SQLConnection" that is visible to whole appliation and I saved my connection string in web.config file from which I am accessing through with the following code
Dim constr As String = ConfigurationManager.ConnectionStrings("connstr").ConnectionString
Please tell me How to do this?
Thanks in Advance
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)