|
So you want to use the db file (sql-express) without attaching it to the server? Well I think this is not possible. But you could use another database like derby etc. which can be used without an existing server...
|
|
|
|
|
Simple. You can't. In order to use a database file it must be attached.
Bob
Ashfield Consultants Ltd
Proud to be a Code Project MVP
|
|
|
|
|
Dear all,
I am trying to access a xml configuration file from windows service. But it
is failing. configuration file is in the same directory from where I install
windows service. I dont want to give an absolute path to the location of
file. When I try to start windows service, it is expecting the XML file to
be in c:\windows\system32\.
Please let me know whether there is a way to access xml files from windows
service.
Thanks.
|
|
|
|
|
Hi,
you will need the absolute path to the file within your windows service if you don't want to copy the file to the windows-folder. Use the registry as a configuration for your service, write the registry value while installing and read the value within the service.
Regards
Sebastian
|
|
|
|
|
Do you mean the standard app.config? If so, it is expected to be in the same folder as your exe. In any other case its up to you to tell the service where to look, generally by an entry in the app.config.
Bob
Ashfield Consultants Ltd
Proud to be a Code Project MVP
|
|
|
|
|
You can determine the path to your service by looking for the ImagePath value in the registry.
object objImgPath = Registry.GetValue("HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\[name of your service]", "ImagePath", null); ;
Be sure you have the rights to access this registry key (but a service should have this rights).
Greetings
Covean
|
|
|
|
|
Hello,
I need some help in order to solve a little,annoying problem-flickering.
I've built a Drawer, that works perfectly , but flickers alot,
the general idea is inserting each shape that the user wants to Draw into
a Drawing list and Draw the whole list in paint event each time.
In the last few days ,i've been reading articles about how to solve it,
I tried setting DoubleBuffer to true but it doesn't help at all.
I've seen some methods to stop the flicker in this web but i cant understand/use them.
I need something as simple as possible that of course works.
(c#, using System.Drawing.Drawing2D; creategraphics(); method
Thank you very much.
|
|
|
|
|
I've had similar problems in the past. I seem to remember that the only way that I was able to stop the flicker was to implement manual double buffering. See the article here[^] to see how to do this (and to first verify that your settings are correct to automatically double buffer the image prior to putting in a bunch of wasted effort).
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Hi All
I want to create below key in Vista OS in my C# application.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
After the key creation i want to write NoDispCPL (DWORD)value to 1.
On vista onwards i am anable to create the key.
Can any one help ?
Thanking You,
Sunil G.
|
|
|
|
|
Hi,
could you send code, how you create the key, please
greetz
|
|
|
|
|
Hi,
I am using below method to write value
RegistryKey myRegKey = Registry.CurrentUser;
myRegKey = myRegKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
Registry.SetValue(myRegKey.ToString(), "NoDispCPL", 123, RegistryValueKind.DWord);
Regards,
Sunil G.
|
|
|
|
|
Hi,
what you do exactly mean by "unable to create" ? Is there an error, or do you don't find the key in registry?
This article might help in last case: Windows Vista inbuilt sandbox registry[^]
Hope it helps
bye
|
|
|
|
|
Hi,
I am not getting any error and also registry is not created. Exe is runing under system account.
If I run as an administrator then only it creates the registry.
Regards,
Sunil G.
|
|
|
|
|
Hi,
did you try do read the key by your program or with regedit? Try to read it by your program
bye
|
|
|
|
|
Hi,
I have tried to read/write by regedit, it works fine.
but through my program it does not work.
Bye
|
|
|
|
|
User Account Control (UAC) is the problem here.
It only allows administrators to change or add keys, reading keys is no problem.
There is no way to bypass this, unless you disable UAC.
|
|
|
|
|
Some people have suggested that the UAC might be the problem here, and it could be if you don't force your application to be run under the admin account.
But, try this as well: When you open the myRegKey make sure you open it for both reading AND writing. This is done by using the OpenSubKey method like this:
myRegKey = myRegKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", true);
(You left out the second parameter..)
Good luck!
|
|
|
|
|
It is not working.
Can u give me sample code?
|
|
|
|
|
Hi all,
i want to receive official emails in my C# application.
can any one help me ?
Regards,
Sunil G.
|
|
|
|
|
|
Please guide me to develope a small application which uses RS422 for communication
how the communication could be done in Vc
how to implement the RS422 protocol
|
|
|
|
|
Hi,
maybe this article is a good first step:
Pelco P and D protocol implementation in C#[^]
As far as I understood you will also need an adapter (hardware) to generate RS422 signals (because there is a electrical difference to the default signals).
Regards
Sebastian
|
|
|
|
|
This Document[^] is an instruction manual for implementing the RS422 protocol and interface. This site[^] explains some of the issues involved in implementing the interface.
RS422 is a hardware spec, however, and does not discuss the software. It defines a multidrop serial link that extends the RS232 standard, as does RS485. Managing the serial port is accomplished using System.IO.Ports[^] in the .Net Framework. The SerialPort class allows pin-level access to the serial port, and appears to provide state management, as well (I haven't used it yet, so I'm no authority).
I would assume, if it was my project, that the target devices use the same control protocols as RS232 for data stream management, and write the code accordingly. The only exception would be that, since RS422 implements a multidrop serial communications scheme, there must be some addressing function defined. That may be device-specific, or industry defined. The manual mentioned above probably contains that information, though being after midnight here, I haven't read it. Translating RS232 signals into RS422 signals is a job for a hardware adapter.
By the way, the second link above is to B&B Electronics, whose catalog contains an excellent technical reference describing in detail the various serial interfaces in use today - I recommend that you request a catalog if you're going to be doing much of this stuff. Their primary business is selling adapters to convert the various serial communications standards to other forms.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi,
I have an application that sends emails to user using the SendMail() API in C#. The code is working is fine. I wanted to authenticate the username and password to a mail server without calling the SendMail(), just authentication. Is there a way to achieve this. I saw a "Test Account Settings" button in the outlook which does the same thing, It checks for the connection to the Mail server, Logon to the mail server and finally sends a test message.
Feel free for any clarifications.
Thanks in advance.
Praveen Raghuvanshi
Software Engineer,
India.
|
|
|
|
|