|
Thanks for the reply Will,
The application in question is a web services project that returns data to both an ASP.NET and Windows Forms App so your recommendation won't really apply. At first I tried dragging and dropping connections and data adapters etc onto my web services file but I found the code generated to be very untidy. I instead opted to have my web service class contact a business facade, which then contacts other classes in a business layer, which finally contact a database layer where I have utilised the DAAB.
So to further define my question; do I create the Database object in the global.asax session start method, and then use the reference in each class required in the data layer? Do I create the connection each time a service is requested and pass it down to each class required in the data layer? Or do I just use the DatabaseFactory.CreateDatabase() method when it is required within each method of my data layer classes? I notice that when using a Database object supplied by the DAAB that you do not specify the connection string when you use a method such as 'ExecuteNonQuery', this suggest to me that the connection can be managed at this lower level.
|
|
|
|
|
First, you'd probably have better luck with this question in Web Development.
.
I haven't done any Web Services so I don't know the environment. However in general, if you know you're going to need the connection for five calls to the database, it's a lot cheaper if you don't build and destroy the database objects and connect and disconnect five times (although I don't have a good feel for what connection pooling buys). On the other hand, if you have any sort of volume then you don't want to tie up the database resources a moment longer than necessary. So, if a Session lasts until it times out for a Web Service(?), I wouldn't allocate the connection at the Session level.
Will
|
|
|
|
|
K,
I had a similar architecture to what you’re advocating before I moved to use the DAAB. I'm looking for advice more specific to the DAAB. For example, putting the Database object in the session will not put the connection in the session, the database object provides a method to create and return a connection based on settings in the web config file. And when you call a method on the Database object, such as ExecuteNonQuery, you don't explicitly give a connection. I assume that it creates one internally based on the config file.
So given the examples on using the DAAB that I have seen, there's no way to share a single connection between multiple queries without the use of a transaction or additional verbose code. Based on this I guess the best thing to do is put the database object in the session and then call methods such as LoadData and ExecuteNonQuery where necessary, Let the DAAB handle the connections completely.
|
|
|
|
|
M'Kay,
I see your point. I always assumed that there was a Connection object that was embedded within the Database object. That's NOT the case. If you RTFC then you'll see that each invocation of one of the wrappers "new"s its own connection (at least for SQL Server). Personally, I was happier in my deluded ignorance. I guess that means that the only way to economize is to exploit connection pooling. The various ADO.Net books seem to do a good job of covering that subject in detail. Of course, there's nothing stopping you from altering or building upon the Library except having to maintain your enhancements in future versions. In a sort of poor man's DAAB I worked on at one client site, I changed a "DatabaseHelper" class (which did have an embedded Connection object) so that it left the connection in the state it found it. If an explicit Open was performed, it stayed open until an explicit Close was performed. This runs the risk of Connection leaks if you aren't careful. Perhaps that's why the authors of the Library chose the approach that they did?
Will
|
|
|
|
|
I have made extensive use of the IList derived collections for databinding to various controls etc in several .Net projects over the last few years. I am now starting a project that could benefit from generics and would like to use them for all the obvious reason.
The question I have is can generic collections be used for databinding in the same way as the non-generic collections? In short, can I bind a generic IList derived collection to a control?
I notice that there seems to be no generic version of CollectionBase or IBindingList.
-- modified at 16:21 Thursday 30th March, 2006
|
|
|
|
|
Hello,
First, I'm french so my english isn't very good.
I must import MsProject 2000 tasks into dataTable.
I would like to use "system.reflection" (or some thing like that) to write generic code in order to call each property of COM MsProject Task object.
But it seems that system.reflection works only for .NET managed objects. I tried to find other possibilities but I found nothing.
Is someone can help me ?
Thanks in advance.
Steph
|
|
|
|
|
This my be a stupid question but here goes:
I have written a web service in .net 1.1. Am I guaranted that these functions (that are using a not 100% .net 2.0 competible API) will be run in .net 1.1 when accessed from a .net 2.0 application? The application and web service will be on the same computer.
|
|
|
|
|
|
Hi,
This is Balvardhan, i wnat to design Framework to my project,
Just give idea to how to NHibernate
I already Import that Third party Dlls but I did not understand hoe to make a prog with that
Balu
|
|
|
|
|
I have a windows sevice application developed in C# .NET 1.1 wherein a thread is running that is polling for new entries in a queue. When a new entry is found, I used Process.Start to start a Console Application to perform some task. I have tested this console application to be started from within a Windows Form Application, also using Process.Start, and this worked ok. Doing the same in the Service thread gives no result whatsover. Can anybody advice me on this ?
Walter Vanhimbeeck
|
|
|
|
|
No need for advice on this - the solution was easy, I just had to check the property "Allow service to interact with desktop" in the logon tab of the service properties.
|
|
|
|
|
Hi.
I'm writing an application in C# that runs a "cmd.exe" in another process.
I need to get the working directory of the process without having to resort to issueing "echo %CD%" to the cmd process.
Can anyone help me?
I'm going nuts trying to find a way to do this.
Cheers,
/Trev
|
|
|
|
|
Hi everyone,
I created one setup program in .NET deployment and setup project. I used VBScript program for finding existence of old version and popup the message box with Yes No button.
If i click yes this new version's installation setup uninstall the old version. At the same time i need to exit from this new installation when i click No button in that popup message box.
I wrote code for uninstalling old version under Yes button's case. I couldnt get how to exit from the installation,which codes are used under No button's case.
I need help to exit installation by clciking No button.
I saw one script code "WScript.Quit". But this is for quiting from script program. I added the script file under install of custom actions.
--------------------
currentversion="1.0.1"
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("SELECT * FROM Win32_Product")
For Each objSoftware in colSoftware
ProductName= objSoftware.Caption
ProductDescription=objSoftware.Description
ProductCode= objSoftware.IdentifyingNumber
InstallLoc=objSoftware.InstallLocation
PInstallState= objSoftware.InstallState
PName= objSoftware.Name
Pkg=objSoftware.PackageCache
SKUNo= objSoftware.SKUNumber
Manufact= objSoftware.Vendor
VerNo= objSoftware.Version
'Check the existence of the same product and then check version number.
'If older version is present then display popup message box.
if (PName="VersionUpgrade") then
If(VerNo<currentversion) then
MsgBox "The old Version Number of "&ProductName&"is: "&objSoftware.Version
set WshShell=CreateObject("Wscript.Shell")
intButton=WshShell.Popup("Do you want to uninstall the older version of this application?",10,,4+32)
select case intButton
case -1
StrMessage="You didnt click any button within the allotted time"
case 6
MsgBox "Old Version is Uninstalled"
case 7
MsgBox "Old Version is not Uninstalled"
end select
end if
end if
Next
-------------------------------------------------------
I hope that i can get idea from this group. Please help me.
Lisa
|
|
|
|
|
How are you all doing?
I am not a programmer and have not got a clue with anything related to programming. I am looking to turn a standard usb webcam into a motion detection monitor.
I would like to write a programme where, as someone walks past the camera a picture would be captured. I would then develop it further by having the picture emailed it to me, etc etc. However for now, i would require guidance on how to tackle the first part of capturing the image.
I have looked on the web, and have comne across various files including spot, but have not got a clue on how it works or what it actually is dong!!!!!
PLEASE HELP.
THANK YOU
mrbhp
|
|
|
|
|
Stop right there.
If you don't have a clue about programming then you have 3 options:
1.) google for an exsisting program
2.) pay somebody to write you this program
3.) start learning at the BEGINING
you are talking about some advanced stuff and you can't just start and program a motion-capturing program.
Start with "hello world";)
--------------------------------------------------------
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
i want install .NET Framework Version 2.0 on windows 2000 professionnal edition so i want know if:
--Is there a version of Microsoft .NET Framework Version 2.0 Redistributable Package (x86)for windows 2000 professionel
or
--Is there any Microsoft windows installer2.0 which is compatible with windows 2000 professionel
am
|
|
|
|
|
How many times do I have to tell you this before it sinks in???
I'm on my third try here...
To run the .NET Framework 2.0 on Windows 2000, you MUST MUST MUST MUST MUST upgrade Windows 2000 (any edition) to SP4 or better!!! There are no exceptions to this and no "special" version of .NET 2.0 for other versions of Windows 2000. You either upgrade to SP4 or you don't run the .NET Framework 2.0 on it.
Got it???
If you don't want to upgrade to Service Pack 4, your only option is to use the .NET Framework 1.1 or lower. You'll loose the ability to use any of the features introduced in 2.0, and there are alot of them...
The choice is yours...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: If you don't want to upgrade to Service Pack 4, your only option is to use the .NET Framework 1.1 or lower.
When I bought VS 2003 in 2004 it forced me to apply SP4 then. Though I think MS literature did say that SP2 would have been fine. But MS tend to force you to apply whatever is their current SP as a prerequisite for these things, regardless of whether they're really necessary or not. I suppose it's because of testing and support issues.
Kevin
|
|
|
|
|
Yeah, I learned a long time agao that if you have a problem and the system in question doesn't meet the minimum requirements, the first thign they'll tell you to do is update the system to the minimums, then they'll talk to you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to know if it is possible to get hardware identification of my machine using .net framework also if itis possible to make .dll file with it and calling with java programm
is there .net frame work version for 2000professinal or xssp1 windows operating systeme
am
|
|
|
|
|
ss2006 wrote: is possible to get hardware identification of my machine using .net framework
Yes. You'll have to use WMI to get any information about the hardware. There is no standard for manufacturers to follow so the information you do get can, and will, be spoty. Serial Numbers are notoriously difficult to get since most manufacturers don't put them in the hardware.
If your trying to use this information as some kind of registration key, then you'll have to get as much information as you can about the hardware installed and combine it somehow to generate some kind of key.
ss2006 wrote: itis possible to make .dll file with it and calling with java programm
You'll be running code in two different runtimes at the same time. Memory requirements will be quite large for something so simple! If your Java library has access to WMI, skip doing this in the .NET Framework and simplify your code, not to mention your supportability, and keep it in the Java environment if that's your primary language for this project.
ss2006 wrote: is there .net frame work version for 2000professinal or xssp1 windows operating systeme
No. There is no seperate .NET Framework for these versions of Windows. Either patch those versions up to the minimum SP version required by the .NET Framework version your're using (A REALLY good idea considering the security fixes that are included!) or you'll be forced to use the .NET Framework 1.1 or lower.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want to get the .net framework 2.0 (redistrubual) for windows 98 ,2000 ,professional ,xp service pack 1
am
-- modified at 14:10 Sunday 26th March, 2006
|
|
|
|
|
|
If possibl that we can install .net framework 2.0 or later on any windows platform(98, 2000,2000 professionel ,millenuem,xp service pack1,2,)
because i have problem which is:
i hav ea programme which uses .net framework i compile it and i debug the .exe this .exe cant executed on windows xp service pack1 or 2000,because it needs installation of .net framework 2.0.50727or later
am
|
|
|
|
|
You have to have .NET framework 2.0 on the target machine in order to run a .NET 2.0 application.
Captian obvious out
--------------------------------------------------------
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|