|
The application is pior WinForm
what I want is the word document to be displayed on the form itself without a help of a third party and without downloading it to the local disk similar to what I do when displaying an image from remote server on a picture viewer.
|
|
|
|
|
jrahma wrote: what I want is the word document to be displayed on the form itself without a help of a third party and without downloading it to the local disk similar to what I do when displaying an image from remote server on a picture viewer.
..that's the kind of things you usually include in the first post.
How would you decode the older binary format, without the help of a third party?
I suggest you download the free Word-viewer on the PC of your clients. There's an article here somewhere on CodeProject that shows how to change the parent of a random executable to your form; that way it looks as if the executable is a control, embedded in your form. Use it to get that free reader on your form, and display anything Microsoft Word can handle.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hi can you use Below Code
using System.Runtime.InteropServices;
using Word = Microsoft.Office.Interop.Word;
public Word.Document document;
public static Word.ApplicationClass wd = null;
private static string filename = null;
filename = t_filename;
wd = new Word.ApplicationClass();
document = wd.Documents.Add(ref fileName, ref newTemplate, ref docType, ref isVisible);
wd.Visible = true;
wd.Activate();
|
|
|
|
|
Hi
I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after.
Because the logger takes the data from GUI I need also not to overload the GUI thread. The data comes fast in the GUI, so I will implement a LoggerQueue.
I have been thinking of creating a new process for the logging and send my information with some basic IPC.
the question:
Is it possible to create a real time process?
I mean not by creating a separate project and a separate exe file.
Is it possible to lunch some code in a separate process at run-time?
|
|
|
|
|
George Nistor wrote: Is it possible to create a real time process?
Yes.... if you are using a real time OS.
George Nistor wrote: I mean not by creating a separate project and a separate exe file.
I do not know of any other way to do it.
George Nistor wrote: Is it possible to lunch some code in a separate process at run-time?
I am not sure what this means.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
George Nistor wrote: Is it possible to create a real time process?
What do you consider to be a real-time proces? Windows isn't a realtime OS, so the simple answer would be "no".
George Nistor wrote: Is it possible to lunch some code in a separate process at run-time?
Yes, using Process.Start .
George Nistor wrote: I need to implement a "real time" logger. The idea is to get the last line logged even if the application hangs one instruction after.
Let's rephrase that to "log as much as possible". What you'd want to build is called a watchdog-application. What you'd want to log is called a minidump. There's an awesome introduction here[^].
Another alternative would be using OutputDebugString ; that would come closer to the idea of "logging actions", and can be read remotely.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
You could, but you'll be writing about 10 times more code than just writing a seperate .EXE project and launching it from your existing code.
But, if you must, check out the System.CodeDom[^] namespace.
|
|
|
|
|
You mean like starting the same process again.
I have to see if it not alreadz running I will start it in "master" mode, if it is running in "slave" mode.
slave mode is the logger.
ps. what I wanted was just not to have a separate exe and still start it like a real PROCESS.
|
|
|
|
|
Ah. No, Windows does not support creating a seperate process from an in-memory byte stream in a process. You could keep the .EXE image in your app's resources, but you'd have to write it to a .EXE file on disk before you could launch it.
|
|
|
|
|
I have a problem with declaring a connection string in class file in C# and accessing that connection string in .cs file . i don't know how to do that .i am new to this thing. i am using visual studio 2008 and sqlserver 2005
|
|
|
|
|
Why are you asking this again? Besides that your question does not make sense. You are having trouble declaring a string in a .cs file and having trouble access that string in a .cs file?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Wes Aday wrote: Why are you asking this again?
To be fair to the OP, he originally asked this in the lounge. He was advised to post it here. It wasn't his fault that the other post was moved here.
|
|
|
|
|
Pete O'Hanlon wrote: in the lounge
Thanks Pete. I see that now.
Seems that the univoter followed him along.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
ya i don't know how to call that connection string into our.cs file EXAMPLE;
SqlConnection con=new SqlConnection ("Conn");
i am getting error in this line,
and in my class file i declared connection string as
string Conn="My Connection String from Database";
|
|
|
|
|
Then do it the way I suggest below. This way you just pick it up when you need it.
|
|
|
|
|
|
Good job. Glad I could help.
|
|
|
|
|
Your question doesn't make much sense. What according to you is a class file and a .cs file? Post your relevant code here so we can see your problem and suggest some solutions.
|
|
|
|
|
A connection string is just a string that conforms to a particular pattern. The actual value that goes into the string depends on how the database is set up (e.g. is it accessed Windows Authentication) and other features such as whether or not you want Multiple Active RecordSets (MARS), which allows you to perform several reads using what appears to be the same connection. A good list of connection strings is available here[^]
It's traditional to store the connection string inside the .config file. There is a ConnectionStrings section (you won't see it in the default .config file, as you have to add it). Inside this ConnectionStrings section, you will add a ConnectionString entry that holds the details of the connection itself.
To retrieve the connection string in your code, you just need to use the following (here I'm assuming you've added your connection string into the config file with a key of MyConnectionString):
string connectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
|
|
|
|
|
I think the OP's question has got more to do with accessing a field in one class from another than with connection strings.
|
|
|
|
|
Whaddya know? I was right.
|
|
|
|
|
Pete O'Hanlon wrote: I was right.
No you're still not. He had used
SqlConnection con = new SqlConnection("Conn");
Removing the quotes around Conn would have worked since he had already declared Conn . The actual question has got to do with where he had declared the Conn variable and if his line of code had access to it (which is still not clear from the OP's post).
|
|
|
|
|
Funnily enough, by using the method I described it works for him without any cross class issues. So, what I told him to do was right as his code is now working.
|
|
|
|
|
hi friends i am not a boy ,i am a girl and actually i am very new to C# .In my company there is no one to teach that's why i had these kind of doubts. I searched so many websites but i didn't get proper thing that what i have searched.thanks friends ..
|
|
|
|
|
Member 9259606 wrote: hi friends i am not a boy ,i am a girl
Cool. Well, let me welcome you aboard Code Project (but with a username like that, it's so hard to guess what sex you are).
Don't worry about your posting. Quite often, you'll get answers that answer JUST the question you asked without considering what the alternatives are. In this case, you got both; it just happened that I thought you'd be better off using the in built .NET mechanism, rather than having to manage it yourself.
Anyway, I'm glad that you got the answer you wanted, and don't be afraid to post questions. That's what the forums are for.
|
|
|
|