|
Thanks EliotA but my Service is working fine. It is processing the file once it has been picked up that the file has been created that i am after.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
You could use .NET remoting and set up an IPC channel.
|
|
|
|
|
They would both be running all the time, they're Services.
In my case, I had the report runner insert a record to a database table telling the emailer what to do. On the next cycle, the emailer reads the record, sends the required emails, and (on success) deletes the record (on failure, the record gets marked as failed).
|
|
|
|
|
I'm creating a c# .net windows application using Visual Studio 2005. On one of my forms, I've save a new record/row to my database. On this form, it also has a Open File Dialog component, which opens a picture, so that I can save the picture to the database. The problem occurs whenever I use this image in other form, i get the error ; can not find image
but if i stop running and run the program there is no error
|
|
|
|
|
Chances are the image can be found, just not opened. If you use Image.FromFile, replace it with Image.FromStream, passing a FileStream object which represents the file. Don't forget to Dispose the FileStream when you're done
Alternatively, if the other form uses the image saved to the database, it may be a problem with your database access code; perhaps the image data only gets partially written?
|
|
|
|
|
i solve the problem by putting openfileDialog restoreDirectoy = true
|
|
|
|
|
Hello
I want to access peoplesoft from C#
for that it requires "PeopleSoft_PeopleSoft.tlb" COM component
In add reference dialog Box it is not available in VS2005 and VS2008
How can i get this "PeopleSoft_PeopleSoft.tlb" ?
|
|
|
|
|
By paying them tens of thousands of dollars for a development kit?
|
|
|
|
|
In all seriousness though...I was looking into that a few years ago...it depends what you want to do.
You can go directly to the backend database if you just need to retrieve record data without the business logic. If you need/want the business logic, there is a web service interface you can use. Whether or not you have access to the web service configuration utility depends on whether the organization bought the appropriate modules.
EDIT: oh...and about the DLL...I don't know what that's from...it might be included in their SDK...to join the developer program and get access to the SDK was $50,000 when I spoke to them a few years ago.
|
|
|
|
|
Reference conversions: These are conversion from one reference type to another. Reference conversions, implicit or explicit, never change the referential identity of the object being converted. In other words, while a reference conversion may change the type of the reference, it never changes the type or value of the object being referred to.
can someone explain the above with examples, thanks.
|
|
|
|
|
I'll have a go..
Reference types are things which are on the heap and 'referred to' by a reference.
So
Cat cat = new Cat();
Would give you a cat reference to a cat object (on the heap).
You could convert this to an object
object cat2 = cat;
So now cat 2 is considered an object, but still it's really a cat. You could cast it back again.
Does that make sense?
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: I'll have a go..
Reference types are things which are on the heap and 'referred to' by a reference.
So
Cat cat = new Cat();
Would give you a cat reference to a cat object (on the heap).
You could convert this to an object
object cat2 = cat;
So now cat 2 is considered an object, but still it's really a cat. You could cast it back again.
Does that make sense?
Ok...
Now i diverge a bit, what is the purpose of reference type?
Let's say, Cat extends from Animal.
U can have the following:
Animal x = new Animal();
Cat y = new Cat();
Animal z = new Cat();
Is z a Cat?
If both Animal and Cat have a method call talk();
and since z.talk() will be calling from Animal and not Cat,
how can z be consider a cat, when it can't talk like a Cat?
|
|
|
|
|
Ok, this is all known as polymorphism and is the backbone of object oriented programming.
Firstly, the purpose of a reference type. They didn't exist in languages such as C++, you could create anything either on the heap or the stack, it was your choice. The rules in .NET are a bit more restrictive in that all reference types end up on the heap. It's the concept of maintaining a reference to a thing rather than the thing itself (which absolutely speaking isn't really correct). You can for example have two references to the same object instance. Try that with a value type and you could easily run into problems.
Animal z = new Cat();
Here you have an animal reference to a cat instance. When you call Talk(), whether Animal.Talk() gets called or Cat.Talk() gets called depends on whether that method has been marked as virtual .
If not virtual Animal.Talk() gets called, hopefully for obvious reasons. If the method is virtual however, the runtime will start working through something that used to be called a v-table (don't know what it is in .net) based on the type of the instance not the type of the reference. Cat.Talk() gets called.
This way you can implement Cat.Talk, Dog.Talk, Chicken.Talk, treat any of them as an animal, and call Talk() and it will get resolved to the correct method.
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: They didn't exist in languages such as C++, you could create anything either on the heap or the stack, it was your choice. The rules in .NET are a bit more restrictive in that all reference types end up on the heap.
Just to add to that, there is a very good reason for this. When items could be created on the stack, the C/C++ function was at liberty to generate a pointer to it (effectively a C# reference). This could then be passed outside the function even if the function ended and the stack was reset. You then had a pointer to valid memory, but that could be currently in use by some other function. Nasty bugs resulted!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: Nasty bugs resulted!
Not for real men they didn't. OK, occasionally...
Regards,
Rob Philpott.
|
|
|
|
|
Rather informative, thanks.
Then why C# don't sth like Java where the methods are declared virtual by default?
|
|
|
|
|
u0605094 wrote: how can z be consider a cat, when it can't talk like a Cat?
But it can - you just have to cast it back to a cat. ((cat) z).talk()
The advantage is that you can treat all common properties in the same way. So, you can have a generic series of methods that will work on any animal or class derived from an animal - think of List, which supports Object or anything which derives from an Object - i.e. everything. You don't have to produce a List for Animal and a List for Cat - they can both reside in the same List.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Was this an interview question?
There's really nothing to explain.
Let's say you used ExecuteScalar to return an integer value from a database. The compiler doesn't know that the value is an int, all it knows is that the value's type derives from object. But you, the programmer, know it's an int (and not null) so you tell the compiler:
int x = (int) cmd.ExecuteScalar() ;
This type of cast is not a conversion, it's merely a note to the compiler that assigning the value to a variable of type int is safe.
|
|
|
|
|
I am creating a project it contains two textbox.
In first TextBox i paste text from an excel sheet.
On click of button it generates some code set it to text property of Second TextBox.
currently i compile & excute project, generate code and then i paste to my project and then again i compile & execute project again to run this code.
As i can't past the screen shot of that here else i can explain it well anyway if any body want to discuss i am available
|
|
|
|
|
WinSolution wrote: i can explain it well anyway if any body want to discuss i am available
Explaining it clearly at the first place didn't look like a good idea to you?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Dear
I have explained my problem as best as i can.
I was meant to say that i was able to explain better if there was a support of pasting image
Rajesh : did you start reading my post from bottom
|
|
|
|
|
WinSolution wrote: I have explained my problem as best as i can.
Unfortunately not well enough for us to understand exactly what it is you are trying to do. I'm wondering whether you're trying to run Excel in your app, or convert information from Excel to C# code, which you want to compile and run. Or perhaps something else...
WinSolution wrote: I was meant to say that i was able to explain better if there was a support of pasting image
There are several free image hosting sites where you can upload your images and provide links to them.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
I am working in an organization in which i update the record to a central tracker. Mostly data provided to me is in Excel.
I pick the data from excel paste it into first TextBox. Data cosist of Two Columns as mentioned below
________________________
Site ID | DN Received |
------------------------
MDWH2813 | 10-May-08 |
MDWH2814 | 10-May-08 |
MDWH2739 | 10-May-08 |
------------------------
i will copy data excluding the header area from the upper section and paste it into 1st textbox that looks like as follow
MDWH2813 10-May-08
MDWH2814 10-May-08
MDWH2739 10-May-08
Then i click on a button and i generates a C# code as under and set as text on 2nd TextBox
updateCentralTracker("MDWH2813","10-May-08");
updateCentralTracker("MDWH2814","10-May-08");
updateCentralTracker("MDWH2739","10-May-08");
currently i copy the generated code from 2nd TextBox. copy it to my solution and rebuild & execute and then i click on the second button that executes the code and data is updated to the Central Tracker.
but i want when i generate the code on first run then i click on the second button and it should run that code at run time
i hope its now understandable
let me know if any query
|
|
|
|
|
Instead of trying to recompile on the fly, why don't you just parse the data you are already pasting into the box and issue your command to upload...all in one step?
Maybe I am missing the point but it looks like you are trying to make a simple solution as difficult as possible.
|
|
|
|
|