|
It looks like _Proxy.Close automatically disposes of the object. I'd take a look into that if I were you. One way round it is to create a new instance of ActiveDB.DBContractsClient before calling the second _Proxy.Open .
|
|
|
|
|
The Issue is that I want to use the same instance i am using this in a web application and what I am doing is that I am creating this instance when the session starts and use the same instance for every operation that the user does in the application. And for every operation I want to open and close the connection to make sure that no connections are ever left open.
|
|
|
|
|
You can't have it both ways unfortunately. Either it's disposed and you create a new instance every time, or you have to leave it open. It would be easier if you had control of the class itself, and could remove the Dispose out of there, but it looks like you don't have that option.
|
|
|
|
|
cdpace wrote: ...and use the same instance for every operation that the user does in the application
And why do you want to do that?
What benefit do you think that you get from that?
|
|
|
|
|
I was playing with WCF last spring, not with a web whatsis, and only opened the connection once, so I didn't encounter that.
I'll take a look at what I can find out later.
|
|
|
|
|
Hi,
I have used the drawtool2005 project,modified it,by storing locations and shape ids in the database.What i would like to know is whether i can add a background image to the layout file created.
SRK
|
|
|
|
|
Try asking at the article itself - that way the author gets an email - posting here relies on them "dropping by" and realizing it is for them.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
hi friends, seniors $ all,
I have a form on which i am using layout panel. on this layout panel i am adding user control during runtime. the control consists of a picturebox and label. the image which is displayed on picture box is copied from the source folder to temp folder. this image is resized and bitmap is created and passed to picture box.
now i want to clear the temporary moved files, which is not happening.. i get the file is in use. so i disposed the child form, before comming to parent form. even clearing the layout panel didint help..
friends please suggest me some help
regards
Samir
|
|
|
|
|
Which of the many available Methods are you using to load the bitmap?
I suspect that you are using Image.FromFile() as this is a well documented problem with this method.
If that is correct then switch to Image.FromStream() (look it up). Hopefully this will resolve your problems.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi sir,
i am using filestream only.. one more thing i am using thread to load the controls inside layout panel
regards
samir
|
|
|
|
|
In that case, without seeing any code, is there a possibility that the threads are terminating before properly closing the streams?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
In order to be able to delete a file, everything that points to the file must have been disposed.
Candidates are: Image.FromFile , Image.FromStream , PictureBox.ImageLocation
The problem here is you have to do special things at the end of the PictureBox's life; if the image is used in more than one location in your code, it may be hard to correctly decide on its disposal.
There also is a different approach, where the problem is avoided beforehand, by copying the image; this is a schematic example:
Image image1=Image.FromFile(...);
Bitmap bitmap1=new Bitmap(image1);
image1.Dispose();
PictureBox.Image=bitmap1;
...
myForm.Close();
|
|
|
|
|
Hi ,
I am trying to create an application to extract some txt files from ZIP and then search the text files for a search string.
I have done two functions
1. That extracts the files
2. That searches through the files
This is my required program flow.
I need to threads to run here
The first thread should concentrate on searching the file, extracting them and add the extracted files's to a string array and the second thread to monitor that string array and search the newly added files for the search string.
Is this possible? I have done some coding for this. Will post it later in this message thread if required later.
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
Ramkithepower wrote: Is this possible?
Yes - I'm not sure it's the best possible design, but it is possible. What you could do (if you are using .NET 3.5 or later) is use an ObservableCollection in the first thread which the second thread hooks into the event handlers for to see when items are added into that collection - then it can perform it's searching in response to the item changing.
Alternatively, and this is perhaps a better method, you could have your first thread implement an event handler that takes the contents of the file as a parameter (assuming you are just storing it as a big string here) and the second thread hooks into that event. Obviously, you'd fire off the event every time you added a file.
|
|
|
|
|
Help to create a simple file manager that can do following things:
- Browse the directories(forward and back functionality);
- Change the current driver(from C:\ to D:\ or to flash);
- Pre-view and edition of the file with the short-cut key(F4) –
only for txt files;
- The icon with functionality that allows the user show or hide
hidden/system files and folders;
PLEASE HELP
|
|
|
|
|
You should read some CodeProject articles, maybe this one for starters: C# File Browser[^]
|
|
|
|
|
hi,
I am using ListView to display the records.
I have a column namely, 'module' contains record in following manner.
edit, delete
Actually i am adding this value through checkbox. when i select checkbox, the associated value ('edit') has been added in database, when i select another checkbox, the related value ('delete')has been added in the database. basically i can select two or three checkox, all concerned value has been added and seperated with 'comma' in same column.
My query is , I want to edit this data. when I select edit button, the value of the checkbox shows 'true'.
e.g. the 'edit' related checkbox shows 'tick' and so on.
thanx and regards,
|
|
|
|
|
This is the C# forum. You don't state what you are using this in.
Is it a web page, WPF, or Silverlight application? It makes a big deal as to how to do things based on where you display it.
|
|
|
|
|
This ICAO line retrevie from Passport, for example:
P<VNMLE<<HUY<HOP<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
B2497277<3VNM9007219M18082251010666632<<<<<58
Now, I want to Name, Sexual, Passport No,...from above line.
Please help me,
|
|
|
|
|
Take a look at the Passport section here[^] for details of the format. You could have found this information yourself easily enough, by using Google to search for ICAO line passport - that's what I did and the first link took me to this page.
|
|
|
|
|
Barry White will get you sexual.
|
|
|
|
|
Noooooo - that's an image I don't want in my mind.
|
|
|
|
|
yeah, I had been wondering how long it would take for a little quip to appear here, and I was pretty disappointed by Pete missing the opportunity.
|
|
|
|
|
I didn't miss the opportunity - I prefer to pick out the less obvious ones.
|
|
|
|
|
So I didn't have to read your initial reply twice just to make sure I didn't miss something under the surface.
|
|
|
|