.net

Monitor changes to the registry

Are there any classes in .net I can use to monitor any change to a value in the registry, similar to how FileSystemWatcher works. So if the value is changed, an event is raised. Or any other suggestions to do this would be helpful. ...

nhibernate and virtual class properties?

Just reading about nHibernate, why do the class properties have to be virtual? What is the reasononing behind that? ...

Fetch specific rows from DB through ADO.Net

I have a table containing 10 records. I want to fetch 5th and the 7th row from it. Is there any way of achieving this in ADO.NET. ...

How can I read an SNMP MIB file in c#?

How to read a MIB file(.Mib file) using c#.net ...

How can I use JavaScript within an Excel macro?

There’s a really cool diff class hosted by Google here: http://code.google.com/p/google-diff-match-patch/ I’ve used it before on a few web sites, but now I need to use it within an Excel macro to compare text between two cells. However, it is only available in JavaScript, Python, Java, and C++, not VBA. My users are limited to Excel ...

how to create windows applications in VB.Net or ASP.Net

which method is more efficient to use: DataAdapter and DataSet Or DataReader when importing data from a certain database table??? ...

Query objects from a Many to Many look-up table

I have Master1 and Sub1 and a another called Master1Sub1_Map which contains foreign keys to the Master1 and Sub1 objects. There are multiple ID's from Sub1 that are associated with a single id in Master1. If I want to see all the Sub1 records that are assigned to a specific Master1.ID how do I go about doing that with the SubSonic obje...

Dim X as New Y vs. Dim X as Y = New Y()

Duplicate Whats the difference between declaring as new and as something new something i Sad that I don't know this, but can anyone explain the difference between: Dim X as New Y and Dim X as Y = New Y() ...

IDictionary to SelectList ?

I have an IDictionary, now I want to use these values in a selectlist. How do I do this? Thanks. ...

Auto resize columns based on char count

I am trying to figure the best way to programmatically re-size table column headers in ReportViewer. Basically, my current resolution is the following: ColumnWidth = HeaderCaption_CharacterCount * 0.32 Where 0.32 is an estimated width of a typical character using my current font size. The issue is that the width leaves a lot of white...

.NET Events for Process executable start

Is there any way to register for an event that fires when an executable of a particular filename starts? I know it's easy enough to get an event when a process exits, by getting the process handle and registering for the exited event. But how can you be notified when a process, that isn't already running, starts...without polling all t...

What is the JavaScript equivalent of C# Server.URLEncode?

What is the JavaScript equivalent of C# Server.URLEncode? ...

Use external file or resource?

I am writing a C# application that uses a long "hard-coded" string. For maintainability reasons I have decided to put this string in an external text file and load it. Is this a good idea? The extra I/O does not seem big in this case. I realize that I also have an option to embed this file as a .resx resource. Is this a better idea? Th...

Crystal Report fails to load on Windows 2003 os

Crystal Report 10 fails to load on Windows 2003 OS. We're developing with .net 3.5 with C#.net. It works properly on dev box which contains similar configuration but without a McAFEE Anti-virus software on it. Any pointers would be greatly appreciated. Error Message: [COMException (0x800002ad): Error in File UNKNOWN.RPT: The request ...

Create db schema from domain objects in .NET

In EJB 3.0 you can write your domain objecs, then convert them into entitities (adding @Entity attribute, etc.) and underlying JPA mechanism (let's say Hibernate) can automaticly generate db schema. What's better it will also update db when you update you domain model in Java code. I'm looking for equivalent of that functionality on .N...

How to set an ints Hex Literal from a string,

Im attempting to load a hex literal from an xml settings file, I can parse the xml just fine and get the required string from the file, but i cant seem to get it to set an int variables value :/ Code: int PlayerBaseAddress = System.Convert.ToInt32(ConfigLoader.GetSetting("PlayerBaseAddress")); // Input string was not in a cor...

How can I return a response from a WCF call and then do more work?

I have a synchronous web service call that returns a message. I need to quickly return a message that basically says that order was received. I then need to spend a couple of minutes processing the order, but cannot block the service call for that long. So how can I return from the web service, and then do some more stuff? I'm guessi...

How to trigger an already running .net based windows application?

I have a .net based windows application which is running in memory. I want to trigger one of the function in the app from an external application which is not .net based. How can I achieve this? The triggering should be real time. ...

Fastest way to add new node to end of an xml?

I have a large xml file (approx. 10 MB) in following simple structure: <Errors> <Error>.......</Error> <Error>.......</Error> <Error>.......</Error> <Error>.......</Error> <Error>.......</Error> </Errors> My need is to write add a new node <Error> at the end before the </Errors> tag. Whats is the fastest way to achieve ...

Can you include only certain forms during a compile

We are developing two versions of an application. Not in the sense of a lite vs standard version of the application, where one version will have limited functionality etc. We will actually be displaying different types of information in the application, depending on the version (that's the best way I can describe it without going into to...