|
Haha. And all this time I was thinking it was the latest and greatest. Oh well, I will definitely look into alternatives, as mentioned. Thanks! :P
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Although Entity Framework has replaced Linq2Sql in Microsoft's technology stack, the philosophy behind the APIs remains the same. Whatever you've learned about Linq2Sql will help you in EF.
My observation is that ORMs are a lot more flexible on the data query side than on the data manipulation side. I tried Hibernate/nHibernate, Linq2Sql and EF, and in all cases the data retrieval was impeccable. Writing data back, however, was a different story: all frameworks are great when you modify your data in memory and then write it back, but you must jump through the hoops to implement mass inserts (e.g. table-to-table copies), updates, or deletes. Here is a good link that explains the issue and provides a work-around for Linq2Sql[^]. Good luck!
|
|
|
|
|
LINQ to SQL isn't "dead" dead, it is still being supported (and looks likely to remain so for a while) but no new features are being added. Microsoft is focusing on the Enitiy Framework, so that is worth a squizz and having used LINQ to SQL will help you
It is worth looking at the ADO stuff directly, but only so:
a) You understand the underlying technologies
b) You realise exactly how much the various LINQ database stuff is giving you.
Straight ADO was an (u)necessary pain. It is needed to get the data in and out (and therefore necessary). But then you had to work with the results sets, and they didn't play well in OO land.[^] so you had to write your own ORM or live with the fact you were working with relation data and forego a proper object model, without built-in support this was un unecessary pain.
|
|
|
|
|
I have a service written in C# that keeps exiting without any error message.
The only clue I have to the problem is that the thread exit code is FF .
Do you have any suggestions about how I can debug this?
---------------------------------------------------------
I have a lot of intertwined dependencies in this solution, and it turns out that some assemblies were using older builds of common assemblies than others. DUH!
Thanks for everyone's help on this matter.
The difficult we do right away...
...the impossible takes slightly longer.
modified on Friday, July 15, 2011 2:40 PM
|
|
|
|
|
Check the system event log.
Put a try/catch around the main processing loop and see if anything falls out.
Set an Application.UnhandledExceptionHandler (not sure if Application is available in services though).
|
|
|
|
|
Thank you. Those are great suggestions.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Debug - > Attach To Process
Also, log files are good.
|
|
|
|
|
I've tried that, and Visual Studio does not catch any exception at all.
It simply says, "XXXX Thread exited with code 0", "Process XXX has exited with code FF".
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I've used something like the following in my OnStart methods:
# if DEBUG
System.Threading.Thread.Sleep ( OneMinute ) ;
# endif
Which gave me enough time to attach the debugger after telling the Service to start.
|
|
|
|
|
Thank you, but Visual Studio does not catch any exception. The process simply quits. I have disabled the hosting process, but this made no difference.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Can you show us your
OnStart code?
|
|
|
|
|
Hi Shameel. The code is below, however the service quits as a response to a different service interacting with it through remoting. In other words, it starts up OK.
protected override void OnStart(string[] args)
{
try
{
RemotingConfiguration.Configure("Poller.dll.config", false);
}
catch (Exception ex)
{
StreamWriter Fs = new StreamWriter("PollStationError.log");
Fs.WriteLine(ex.ToString());
Fs.Close();
}
}
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Is something logged to your log file? I mean, does it throw any exception?
|
|
|
|
|
Unfortunately, no.
HOWEVER, I just discovered an Access Violation in the Application Event logs. It comes from the .NET runtime.
It gives the address of the violation, but that's the address that was "accessed," not the address of the code that caused the violation. Hmm.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Comment your call to RemotingConfiguration.Configure() method and write a simple event log entry just to make sure that RemotingConfiguration.Configure() is not the problem.
|
|
|
|
|
If this is all the code you have in your OnStart, it's no surprise that your service starts, then dies. You don't have any kind of worker thread running that does the actual work or listens for connections. You service isn't starting anything up that does anything.
|
|
|
|
|
Not true. The work is done by threads that are started by remoting calls to this singleton object.
In other words, a client calls the "Start" function in this object, and that begins the work.
The "OnStart" routine you see is merely like a constructor.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Post the config file, 'cause, from your description, something's fishy.
|
|
|
|
|
Can anyone help me convert this registry key into readable values?
http://img714.imageshack.us/img714/7929/regbinary1.jpg
into readable values? For some reason I can pull the registry key as a char[], but it ignores "4F 16 AB C1 4F
The other values convert to "System Byte []" , I'm not sure what the logic is behind the way these are setup?
Thanks for reading!
modified on Wednesday, July 20, 2011 1:29 PM
|
|
|
|
|
1. Your link is wrong.
2. It does not have a "readable value", it's obviously some form of binary value used by the application that set it up in the first place.
3. A better post would be to explain why you want to interpret this, and what problem you are trying to solve.
The best things in life are not things.
|
|
|
|
|
The link is fixed, sorry about that.
I'm trying to figure out where the settings for power management ( Control Panel\All Control Panel Items\Power Options\Edit Plan Settings ) are saved in the registry. It appears they are stored as binary values in either:
HKEY_CURRENT_USER\Control Panel\PowerCfg
but more likely
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\19cbb8fa-5279-450e-9fac-8a3d5fedd0c1\12bbebe6-58d6-4636-95bb-3217ef867c1a
... I'd like to decrypt them and find out if that is true, so I can reencrypt and deploy new values.
|
|
|
|
|
turbosupramk3 wrote: It appears they are stored as binary values in either:
They may be stored in both places - the first for per-user settings, the second for system-wide settings.
I don't think anything is encrypted. If you search you can find a lot of documentation - even whitepapers from Microsoft.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
You are right, it was not encrypted, thank you for that.
My problem is now this, I'm looking to be able to enable and disable this for certain users, for when they have to work at home and wake on lan doesn't seem to work. I set a value in the registry manually yesterday, and it worked, but was reverted back this morning in the control panel, even though the registry key is still set to 0x0000000 . Any thoughts as to why?
|
|
|
|
|
Ok, I figured this out
Get your actual applied policies with the command RSOP in a command window, then go to Computer Configuration --> Adminstrative Templates --> System --> Power Management --> Sleep Settings
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da
Set ACSettingIndex to 0 (this changed the control panel value)
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\29F6C1DB-86DA-48C5-9FDB-F2B67B1F44DA
Set ACSettingIndex to 0 (this changed the control panel value)
If your admin is smart, you may not have rights to these keys and make have to take ownership of the keys. After you change them you can remove rights for everyone and just give admins read only rights while still having ownership.
This will allow you to keep the box on, nights where you have to be on call and remote in, I am building a c sharp app that will set and reset these permissions for when I am on call, so the majority of the time the computer will go to sleep. A laptop might have to address the DC power settings also. I'll post code after I get the app built.
|
|
|
|
|
Hi
I have searched the internet and I have been able to find a regular expression that stops users from inputting into a text box words that Oracle uses as reserved words, or characters that it considers special to it unless they are enclosed in quotes along with a regular expression that detects sql injection attacks. Can anyone help?
|
|
|
|