This creates a control called ItemCollectionHostControl, which has a 'Items' property. In this, you can add two types - 'IntItem' and 'StringItem'. It doesn't happen all of the time, but sometimes I get the following error message:
"The value 'Test.IntItem' is not of type 'Test.BaseItem' and cannot be used in this generic collection"
You may be able to add some items initially, but try then compiling the project, and adding some more.
Can someone see why this error is occurring, or what I'm doing wrong? If someone could try the code and see if it happens with them, that'd be great too.
I am trying to connect to Oracle database via C# service application. When I try to open the connection i get the exception "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." This happens at very first instance(not after some interval...)
I have tried to search this on the net, but all in vain. Most of them have given the answere as to check with the connection. Below is the code snippit I am using to connect to database.
Your hint did not help me. This is a strange behaviour, If I connect to the same database from a desktop application developed in C# with the same connection string, it does executes the procedure. But the same tried from C# service application it hangs for a min and then throw this exception.
Let me know if am doing somthing wrong... I am in a pretty bad state with this exception.
As a test, go into the Services manager (Start/Run Services.msc), stop your service and change the userid and password that the service runs under to your id and password. Then restart the service and see what happens.
Even this did not help me. Is there any initial setup that has to be done on my system even before accessing the database from service applications ? like user creation, giving persmissions etc..etc...?
Code is very much the same. I am executing that in a console application. While carrying out your previous instruction I was given the permission to execute services(Log on services). So I restarted the machine and then carried out your instruction. Now I have strong feeling that some permission has to be given to my USERID and PWD on the local machine. And the serive was installed using "LocalSystem" property.
More over I am logging to a domain. Keeping this in mind I asked you about those question. Let me know if you need more info from my side.
Your are right. If I log into machine as a local user i am not able to access the database. Another strange problem, I right click on my console application and then select "Run As" option. Here I am using loginID and PWD, which I have been using so far and working fine. But the application throws an error
The specified module could not be found.
Could not create an environment: OCIEnvCreate returned -1.
But the same application if double clicked returns the correct answere from the procedure.
which seems to indicate the file somehow could have been installed on your machine
separate from the normal Oracle files, so all is not lost.
Search your PC for it, and move or copy it to a more appropriate location (where ever
that might be).
I have a class inhertied from PrintDocument in that I am trying to write in a file while am in printpage event handler. The problem is that the file gets created but there is not text/data. Is it even possible to do.
no. if i apply the same codes in a non inherited PrintDocument then i can see the file with data but if i wrote same in PrintDocument class means
(public class TextPrintDocument : PrintDocument) then i don't see
your 3 lines of StreamWriter code work fine inside one of my PrintPage methods.
- your file already exists and is read-only or locked by another process
- you ar looking at the wrong file (using a relative path, and current directory maybe changed)
- you are getting an exception but missed it somehow
Thank you all, It was putting in a wrong folder. so i just have the absolute path now.
This leads to my next question which is if i try to write in a file then there is no data in a file but if comment the loop then there is something.
I want to write in a file until i<5. is there something i am not doing right.
sw = new StreamWriter(@"C:\myfolder\path.txt");
I'm not sure if it's usefull to create a new instance of StreamWriter (in youre case 5) inside the for loop.
If yes, you would have to call the close method also in the loop, otherwise only the last StreamWriter instance would be closed (disposed).
If not, you should do this: