473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Enterprise Data Access Block and .NET Web Services

I'm working on some internal company web services and I have a
question about resource management within the Enterprise Data Access
Block.

I have about 20 methods which look similar to the one below:
[WebMethod]
public DataSet GetUserDataByGroup(int groupId)
{
string procName = "sp_GetUserDataByGroup";
return DatabaseFactory.CreateDatabase().ExecuteDataSet(pr ocName,
groupId);
}

My question is what happens to the resources created in
DatabaseFactory? Are they disposed of properly? Will I run out of
connections/resources? If this is a bad way to write these?

Thanks,
Kelly Greer
ke*********@nospam.com
change nospam to yahoo
Jan 24 '08 #1
2 1566
Kelly,

Well, the Enterprise Library Blocks come with source code, so you should
be able to determine pretty quickly if the resource are disposed of
correctly or not.

To answer your question, yes, they are. The ExecuteDataSet method will
open the connection, run the stored procedure, and then populate a data set
and return it. There should be a using statement in the code that you see
for the database connection that is used to populate the data set.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"kellygreer1" <ke*********@yahoo.comwrote in message
news:42**********************************@k2g2000h se.googlegroups.com...
I'm working on some internal company web services and I have a
question about resource management within the Enterprise Data Access
Block.

I have about 20 methods which look similar to the one below:
[WebMethod]
public DataSet GetUserDataByGroup(int groupId)
{
string procName = "sp_GetUserDataByGroup";
return DatabaseFactory.CreateDatabase().ExecuteDataSet(pr ocName,
groupId);
}

My question is what happens to the resources created in
DatabaseFactory? Are they disposed of properly? Will I run out of
connections/resources? If this is a bad way to write these?

Thanks,
Kelly Greer
ke*********@nospam.com
change nospam to yahoo

Jan 24 '08 #2
On Jan 24, 4:17 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Kelly,

Well, the Enterprise Library Blocks come with source code, so you should
be able to determine pretty quickly if the resource are disposed of
correctly or not.

To answer your question, yes, they are. The ExecuteDataSet method will
open the connection, run the stored procedure, and then populate a data set
and return it. There should be a using statement in the code that you see
for the database connection that is used to populate the data set.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"kellygreer1" <kellygre...@yahoo.comwrote in message

news:42**********************************@k2g2000h se.googlegroups.com...
I'm working on some internal company web services and I have a
question about resource management within the Enterprise Data Access
Block.
I have about 20 methods which look similar to the one below:
[WebMethod]
public DataSet GetUserDataByGroup(int groupId)
{
string procName = "sp_GetUserDataByGroup";
return DatabaseFactory.CreateDatabase().ExecuteDataSet(pr ocName,
groupId);
}
My question is what happens to the resources created in
DatabaseFactory? Are they disposed of properly? Will I run out of
connections/resources? If this is a bad way to write these?
Thanks,
Kelly Greer
kellygre...@nospam.com
change nospam to yahoo
Ah. Ok. I think I understand the using / IDisposable stuff. Just
wanted to make sure there wasn't something I was missing. Thanks
Nicholas.

Kelly
Jan 24 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Chamberlain | last post by:
Hi all. I'm trying to extend the Microsoft Enterprise Library Data Access Application Block (http://msdn.microsoft.com/library/en-us/dnpag2/html/daab.asp?frame=true) to work with a Borland...
0
by: ad | last post by:
I have used Data Application Access Block2 in my web application. Now I download the Library Data Access Application Block. and read the document. May be I am stupid, I can't migrate it to...
3
by: veera sekhar kota | last post by:
hi, im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
0
by: Benny Ng | last post by:
Hi,All, When i deploy Enterprise library with my application ,i used XCOPY to deploy it into my test server. But when application runs, shown some error related registry. (But actually I haven't...
6
by: Jonathan Crawford | last post by:
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473 Hi I have installed the enterprise library on a development machine and created a project on our webserver. When...
1
by: dhussong | last post by:
I am attempting to use Visual Studio 2005 (Visual Basic) and the Enterprise Library 2.0 Data Access Application Block with a Microsoft Access database. I know the names of my Access databases but I...
7
by: galico | last post by:
Hi All, We are having a very strange problem with the above. We have designed an application in ASP.NET 2.0 that uses the enterprise library data application blocks amongst others. We seem to be...
1
by: bytebugs | last post by:
Hello Folks, Can anyone suggest me a good book to learn using the Microsoft Enterprise Library Application Blocks. I can only find two books on the net 1. The Definitive Guide to the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.