|
That depends on how you've written your database code. You should be opening a connection, retrieving your data, then closing and disposing of the connection on each Timer tick.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for the reply dave, and I agree that would be good form, but I thought i mentioned in my first message that I can not do that since i have to poll data from the DB every 1 second, creating the connection usually takes anywhere between 1-5 seconds (depends on the traffic really) so it would be impossible to implement an open->poll->close method which would be able to work every 1 second.
I guess my real problem is that i'm having a hard time accepting that neither my D'tor nor Dispose are called and that there seems to be no notification of the parent browser closing.
or am I wrong about that?
|
|
|
|
|
alianyn wrote: but I thought i mentioned in my first message that I can not do that since i have to poll data from the DB every 1 second,
Nope. You made no mention of the interval, not that you couldn't do this.
AFAIK, there is no notification the browser is closing. Inside a browser, I have no idea if the CLR Host gets to do any garbage collection before it gets shutdown by the host. It would seem kind of ridiculous.
If the traffic is making the connection take 1-5 seconds, and all connections after that (I assume you tested this!), then how are you going to poll for a dataset inside of that 1 second interval and redraw?
I only mention the connection thing because ADO.NET supports automatic connection pooling[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have tried both httpchannel and tcpchannel and in both cases when I start the server channel the microsoft firewall comes up and asks whether to block or not.
I have not been able to figure out how to stop this. I do not want to have to change the settings on the firewall.
thanks for any help
|
|
|
|
|
You don't have a choice. No matter what firewall your client uses, you will have to punch a hole in it to allow communication. Unless the hole is already there!
Browsers usually work by default because the outbound hole is already punched. But the inbound hole on that port is blocked so outside machines can't just push their way through on that port. The inbound hole is opened up only when the client requests a connection from the inside of the firewall and then the remote machine makes a request to connect back to the client to establish two-way communication.
What good what a firewall be if any application can just "get around it" because it's more convenient for the customer? Why not just make viruses "more convenient" then?
If you do remoting over a network card at all, your customer will have to know which ports you're using and punch those holes if they don't already exist.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I thank you much for the answer and now realize I needed to provide additional information.
I am trying to create a remote server that will be available to other applications on the SAME machine.
For various reasons they have to be in different machine processes.
The answer may still be the same but at least the question is a little clearer.
Perhaps there is another methodology that I have not heard of ?
thanks in advance
|
|
|
|
|
You've got the same problem. If you go over the network stack AT ALL, you're subject to the rules imposed by the firewall, even if the server and client are going through 127.0.0.1.
If you're using the .NET Framework 2.0, you can use the System.Runtime.Remoting.Channels.Ipc[^] namespace. It provides remoting over Windows' Interprocess Communication subsystem, thereby avoiding network-based communication. It's much faster than HTTP or Sockets based channels.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Many Thanks
I had not even heard on that one. I tried it and it did not cause the Microsoft Firewall to pop-up a message.
|
|
|
|
|
Hi folks
I am designing a DB system that will either have a windows forms or a web
form interface.
Part of it involves being able to record a reference to emails sent to
people outside the organisation or received by people within the organisation
that has been sent by somebody outside the organisation. The objective is to
record basic details such as date, sender, receiver, and subject.
Given the fact that a certain percentage of the emails will be private
(nothing to do with the organisation) there needs to be a mechanism for the
person sending or receiving the email to identify the email as being
applicable.
In the UI, it should be possible to open the email by clicking on a hyperlink.
Some people within the organisation use Outlook, while some use Outlook
Express.
I was hoping that somebody might be able to give some general advice about
this application.
Many thanks in advance
Kind regards
Ross Petersen
|
|
|
|
|
Can anybody please tell me how to check from the client whether the WCF service is running?
Regards
Sam
|
|
|
|
|
About all you can do is try and connect - if you get a timeout it is most likely not running (or at least not accessible).
|
|
|
|
|
I can change Width of combobox but how can I change width of combobox
|
|
|
|
|
if u can change the WIDTH u should be able to change the WIDTH as well........cheers
ihtesham
|
|
|
|
|
I put dataset and bindingsource and some textbox on my form
my program work correct (add,delete,edit)
but I do not know how can change one field of dataset without use textbox
I put this code :
dataset.mytable.mycoulmn[bindingdatasource.position]="test";
but at runtime appear error of position
|
|
|
|
|
It seems like you are not especifying the row number.
It should be something like this
dataset.tables("tablename").rows(RowNumber).Item("ColumnName")
An example in VB would be:
'This sets the productID of the first row of table Products to 1
ds.tables("Products").rows(0).Item("ProductID")=1
I hope this helps
Alexei Rodriguez
|
|
|
|
|
Could anybody can answer for How many entry point for an .net application?
Advance Thanks
|
|
|
|
|
Your question doesn't make much sense, unless it's a question in a test that you are taking. Is that so?
---
b { font-weight: normal; }
|
|
|
|
|
I am using no touch deployment (NTD) to deploy my application.
In order to run my application through NTD, in the workstation i will run the caspol command (.NET 1.1)
Caspol -user -addgroup All_Code -url http://host:portno/* FullTrust -name <appname>
The application executable is uploaded to host machine and can be accssed through port no.
In the Internet Explorer with the trusted URL (CASPOL switch http://host:portno/appname.exe) my application gets downloaded,cached locally and runs successfully.
Untill the local system had .NET 1.1 framework only i didn't face any problems but after installing .NET2.0 framework when i try to run the application through IE i am getting an dialog with Run, Save and Cancel option whereas i will not get this dialog if the system has .NET1.1 only. Even if i select the option "Run" in the dialog the application is not running.
I thought this is because of .NET 2.0 secutiry policy so i ran CasPol.exe in the .NET Framework 2.0 with the same switches as used in .NET Framework 1.1 but still i am getting the same dialog and application is not running.
Did any one faced the same problem? if so
thanks,
MS-Sudhakar
|
|
|
|
|
Hello, I am building an application in C#... it has to with voice recognition. I have a variable whose value should increase as the volume of the speaker increases and decrease as the volume decrease.
My question is that: How do I implement this voice recognition? and how can I control this variable with the volume of the voice?
Thanks for ur response in anticipation.
Greetings,
Commickey
|
|
|
|
|
Examine the sound data in blocks, large enough to contain at least half a wave of the lowest frequencies that you anticipate. Keep the maximum altitude for the last blocks and get the average or maximum of those to calculate the volume, depending on what you want.
---
b { font-weight: normal; }
|
|
|
|
|
Is it a real-time or post processing application?
Best,
Jun
|
|
|
|
|
Hi
I have written code in vc++.But designed GUI in C#.
Can i integrate vc++ code in c#.and
please tell me the procedure
Parshant
|
|
|
|
|
Not directly. But you can call C++ code from C# with interoop. Search this site for p/Invoke.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
If you develop both managed C++ and C# on .Net platform, you only need to put them in separate assemblies (e.g., DLLs). Then, one assembly can refer to the other directly. They can compile in the same solution. No P/Invoke is necessary.
Best,
Jun
|
|
|
|
|
Hi...
Can someone tell me how to find a hosting company that will allow me to implement .Net Remoting?
My hosting company does not offer this service. And it will be at least 3 months untill i get my server; however, i would like to at least work with .net Remoting other than here locally..
Any suggestions?
Thanksssssssssssssssssssssssss
Erik
|
|
|
|