|
Why are you using a semi-colon in a CSV(comma seperated values) file as your delimiter?
Oh yeah, you will want to use a StreamReader .
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I have writen a simple program that calculates Pi to n number of digits. I have created a server that has it bound on a socket and then a client that calls it.
When I run up 6 or 7 clients only 4 requests are handled at once, about half the time 5 requests are handled at once and very very occassionly 6. The rest of the calls to CalculatePi are qued and are only processed once a slot frees up. Occasionally after the server has been running awhile it does more ie. it started only doing 4 then it starts doing 5.
Is there some limit to the number of remote calls I can make at once?
Why is it not a set number?
Can I change it?
I've added the decleration code below incase it's something I've done wrong there.
<br />
string strLocation = "tcp://localhost:65100/theEndPoint";<br />
TcpChannel chan = new TcpChannel(0);<br />
ChannelServices.RegisterChannel(chan);<br />
<br />
MarshalByRefObject obj =<br />
(MarshalByRefObject)RemotingServices.Connect<br />
(typeof(CalcPiNS.CalcPi),<br />
strLocation);<br />
<br />
<br />
<br />
TcpChannel chan = new TcpChannel(intPort);<br />
ChannelServices.RegisterChannel(chan);<br />
<br />
Type calcType =<br />
Type.GetType("CalcPiWinServerNS.CalcPiServer");<br />
<br />
CalcPiServer rmCalcPiServer = new CalcPiServer();<br />
ObjRef refCalcPiServer = RemotingServices.Marshal(rmCalcPiServer, "theEndPoint");<br />
|
|
|
|
|
remote object can be fixed in to ways
see these two topics on net
single call(stateless)
singleton(state full only once object can be created and other requests are kept in queue )
|
|
|
|
|
Using the method I have show how do I chose between singlecall and singleton?
Also if this is the case and it's because I am using singleton why do I gat 4/5/6 concurrent already?
|
|
|
|
|
Singleton: When the remote object is set to singleton it means that it will be available to all calling clients. The singleton object is instantiated at the first call of a method (from any client.) When other clients access it, they will be accessing the instance that the first client instantiated. This means that if the first call set a variable myNumber to 10, other clients connecting to the remote object would be able to read that value as well. It basically means that the remote object is shared among all clients.
SingleCall: In this configuration, the remote object is instantiated only for the duration of the method call. If a client is calling a specific method on an object, the object exists only during the execution of the method. Once the method returns, the object is destroyed. Clients cannot share the same remote object in this case.
Example: Suppose you have a remote object myObject . Suppose this object has 2 methods, one called Add that will add 2 numbers and place the result in a global variable myResult of myObject , and one called RetrieveResult that returns myResult .
public void Add(int a, int b)
{
myResult = a + b;
}
public int RetrieveResult()
{
return myResult;
}
In Singleton mode:
Client 1 calls myObject.Add(1,1) . In this case, myResult is 2.
Client 2 calls RetrieveResult() . The returned value will be 2.
In SingleCall mode:
Client 1 calls myObject.Add(1,1) . In this case, myResult is 2.
Client 2 calls RetrieveResult() . The returned value is 0 because the call of RetrieveResult created a new remote object.
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Yes but none of this is answering my question about the erractic behaviour of the number of instances. Nor did you answer the question of how I chose between single call and singleton using the method I showed in my code.
|
|
|
|
|
Hello,
I added "Exceptions.resx" to my project to provide some user defined exception.
In one of C# class of same namespace i am doing
"ResourceManager rm = new ResourceManager("Exceptions", Assembly.GetExecutingAssembly());"
Now if i do
"string str = rm.GetString(key);" , it gives exception by saying
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Exceptions.resources" was correctly embedded or linked into assembly "GlobalLayer" at compile time, or that all......."
What else should i do to solve this problem.
Gajesh
|
|
|
|
|
Hi fellas. I am trying to do a simple registration system with MS Access.
Currently I am using Access 2003, along with C# is VS.NET 2003.
The thing is, whenever I am executing the database connections part, I get this error:
The Microsoft Jet database engine cannot open the file 'C:\SamsTestData\Member.mdb'. It is already opened exclusively by another user, or you need permission to view its data. <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file 'C:\SamsTestData\Member.mdb'. It is already opened exclusively by another user, or you need permission to view its data.<br />
I have absolutely no idea what is going on. I tried googling the web, however I am clueless, as well as where I should start. I am guessing I have to tinker with some settings, but where???
Anyway help would be greatly, greatly appreciated! THANKS!!!
|
|
|
|
|
A few clues:
1) Is the MDB open in Microsoft Access IDE, typically any table in its design view? If yes, then preferably close them.
2) http://support.microsoft.com/kb/174943[^]
3) Is MDB Path writeable by ASP.NET?
|
|
|
|
|
Thanks for your swift reply. I have closed the MS Access application when executing the page. I guess that is good enough?
I did went to the link you provided before I asked for help in here. However I just baffled by the terminology that's in there.
How do you determine whether the MDB path is writable in ASP.NET? Is the settings set in Access, VS.NET 2003, or from the Internet Information Services in the Administrative Tools of the Control Panel?
Thanks a bunch and looking forward to your reply!
|
|
|
|
|
do u have the Database already opened somewhere??
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Thanks for the swift response.
Nope, I had MS Access closed when the webpage is being executed. So I am just perplexed at what could be the culprit.
Any other ideas? Thanks!!!
|
|
|
|
|
Is this File accessible by all kind of users??
may be u have some permission problems. Have you read that article mentioned by another friend of mine
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Thanks for the reply.
Which article are you referring specifically?
I'm stumped whether I should be looking at Access, VS.NET 2003, or the IIS in the Administrative Tools...or is it somewhere else I should be looking at?
Thanks again.
|
|
|
|
|
http://support.microsoft.com/kb/174943[^][^]
Thats the one I was talking abt
well first you should look for permissions on the file itself u know right click the file>properties>permissions... make it accessible by the 'Everyone' Account. you should also keep an eye on the folder permission in which taht file resides.
if its still not helping the refer to IIS which is some thing I dont know too much about :->
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Infernojericho wrote: An unhandled exception occurred during the execution of the current web request
Ok, this seems to be an ASP.NET issue, so this is not the right forum.
Anyway, from the message given, I would say that ASP.NET doesn't have the necessary permissions to open the file. The folder in which the file is located was, I suppose, created by you, so by default, ASP.NET doesn't have any permissions set for this folder. You need to look into that matter by checking the properties->Security tab of the folder and making sure that the local user ASPNET has permissions to at least read the file. You would also need the write/modify permissions to be able to write into the file.
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
That was a helpful reply. Finally got it working. And of course, gave it a 5-star vote. Thanks again!
|
|
|
|
|
Hey,
I want to make a frontend for application that allready exists, and make it more userfriendly. Like for instance, many applications work with LAME.exe and/or LAME.dll. My questions are:
a) How do I best send parameters to these exe's? Plain usage and use System-call on exe with added parameters??? (no idea, just a guess)
b) All those other applications that use an exe, never make the exe 'pop-up', while I was thinking to use a System-call, and send parameters to the exe. That would open it (and a doslike window) and inject the parameters to the now open exe. But with a window visible. How else could it be done?
b2) Can I internally link the exe in my project, so it works like a process in the background, and my GUI awaits an ending state of the process running in teh background? Is that possible and how it should be done in a neat way?
Some pointers or things to look for are enough, I don't want entire pieces of code. As a beginner, I just don't know where to start, that's all.
|
|
|
|
|
You will be able to get what you need if you use Process class.
a)You can set Arguments property of ProcessStartInfo instance and then pass it to Process instance
b)You can specify Hidden for WindowStyle property of ProcessStartInfo or set CreateNoWindow property to true
c)I don't know what you mean by linking but if you start process by using Process class then you can retrieve its output if you set ProcessStartInfo's RedirectStandardOutput property to true
|
|
|
|
|
Hello there. At the moment im currently creating some code to query active directory. I am listing the users that are on a particular domain. howevr the results are over 15,000 and mine bottoms out at 1400.
I get an error message saying that i should use message pumping durin long processes but i have no clue what that is? Can anyody help?
Regards,
Mark
|
|
|
|
|
deviao wrote: i should use message pumping durin long processes but i have no clue what that is?
Have a look at this[^] article.
|
|
|
|
|
I'm trying to use Linq in VS2005 on .NET 3.0, but I think I'm missing references. Could someone please tell me which assemblies to reference ?
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
I think you need Visual Studio 2008 for that. And LINQ is part of .NET 3.5
|
|
|
|
|
You can use (bits?) of LINQ in VS2005 with the March CTP I think, not as capable as VS2008 (haven't tried) but I think because the "add-on" for VS2005 does not update the framework (as far as I know) you don't get all the benefits of LINQ such as the var keyword, etc. I might be mistaken since I haven't played with it much.
|
|
|
|
|
Yeah, if it isn't working for you now, wait until release unless you are really dedicated I think only a handful of ISVs are fully supporting LINQ right now.
|
|
|
|