.net

Iterating an NHibernate join

This is the first time I've used NHibernate for a big project so bear with me. Basically, I need to run a search based on 5 fields. I want to display the results in a table. Here is a test I've written that basically gets all Clients that have Intakes with a Staff named "DII". When I run it, I get an error saying that some of the I...

.net durable resource manager for transactional filesystem access

I'm trying to wrap my head around the use of the System.Transactions namespace in C#. I've found some documentation on MSDN regarding using resource managers, but it only covers volatile, in-memory resource managers in any detail (like Transactional ). I'm basically looking for something that I can use inside of a TransactionScope, just...

What's the reason of using the Object type instead of an actual type for events?

I am talking about the common signature for events: Event ( object, args ); and why not: Event ( ImageProcessor, args ); Is #1 incurs a performance cost too, along with being unclear? ...

T4 without Visual Studio?

I'm trying to wireup some code gen templates to my team's automated build process. Our SCM team doesn't want Visual Studio on our build machine (which I have a hard time arguing with). Is there a way to install the T4 engine without Visual Studio? ...

Class properties concerning List<T> requests – Class design dilema!

When I need to grab more than one record from table(database), my method populates List of particular class (all of my data access layer methods use List for set based select statements. I Don't use datatable/dataset or xmlDocument approach). So lets suppose next simplified scenario; I have two classes – customer and order with these fie...

Yield in C#

Does this have any equivalent in c? ...

In what scenarios is LINQ best applicable?

In what scenarios is LINQ best applicable? Would it be good "sense" to suggest to use LINQ to query all kinds of collections? ...

How do I use SecureString securely?

All of the examples I have seen end up converting a SecureString back to a standard string before using it, defeating the object. What's a good way of using a secure string without this problem? I know I can marshall the SecureString to a BSTR but what can I do with this BSTR? Can I get the characters back one at a time? If so, how? ...

How do you handle a thread that has a hung call?

I have a thread that goes out and attempts to make a connection. In the thread, I make a call to a third party library. Sometimes, this call hangs, and never returns. On the UI thread, I want to be able to cancel the connection attempt by aborting the thread, which should abort the hung call to the third party library. I've called ...

Code Access Security real time implementation in .net?

Hi, I am a C# .net devoloper. I have read a lot about Code Access Security(CAS) in .net. I haven't seen the implementation of this featue on any of the project i have worked on? Has anyone implemented it? I read that ALL managed code targetsthe CLR will recieves the benefit of CAS. What all scenarios we explicitly use code access ...

oo question - mixing controller logic and business logic

I'm not sure if I'm using "standard" terms, but this is a basic OO question I'm trying to resolve. I'm coding a windows form. I don't want logic in the form event handler, so I just make a call to a custom object from there. At the custom object, there are two sets of logic. The "controller" logic, which decides what needs to get ...

.net Deployment settings in server

Hi, I am a .net web devoloper. I always face problems while deploying applications in the client server on IIS virtual directory settings.Locally everything works fine but in the client server i always faced unexpected errors. Mosty because of windows permissions etc. Only while facing the problems we google it and find the solution ...

Garbage collection in .NET (generations)

I have read a lot of .NET performance articles that describe Gen1,Gen2 garbage collection and objects surviving the generations. Why does objects survives the collection? What is pinning? How do I learn more about this? ...

Retrieve embedded resource using case insensitive filename in .Net

I currently use GetManifestResourceStream to access embedded resources. The name of the resource comes from an external source that is not case sensitive. Is there any way to access embedded resources in a case insensitive way? I would rather not have to name all my embedded resources with only lower case letters. ...

What is lazy initialization? (c# .net)

What is lazy initialization of objects? How do you do that and what are the advantages? ...

Usage Exception block .net

Hi, I have read in an article that writing many try catch exception block in code will add performance overhead. Is that true ?Why is it declaring many exception block affect the performance? Thanks SCA ...

Need advice to query data from sql server on every 5 seconds and send it to other app.(.NET C#)

Hi All, I have a require ment to read data from a table(SQL 2005) and send that data to other application for every 5 seconds. I am looking for the best approach to do the same. Right now I am planning to write a console application(.NET and C#) which will read the data from sql server 2005(QUEUE table which will be filled through diff...

WiX, hudson, msbuild, and installing .NET via a boostrapper

Hi all, I want to have our WiX installer that is currently building on a build server via hudson calling msbuild scripts to incorporate the full .NET 3.5 sp1 installer executable. It turns out that our users can always get access to a CD, but not always to the internet, so we can't use the over-the-net installer. We can also require ...

How to make forward-only, read-only WMI queries in C#?

I've been told by a coworker that if my WMI system information gathering queries are forward-only and/or read-only, they'll be quite faster. That makes sense. But how do I do it? ...

Why does WPF databinding swallow exceptions?

I recently wasted a lot of time trying to debug a WPF datagrid (from the WPF Toolkit). I had a column bound to a linq query with a property that was throwing an exception (in a few rows). WPF seems to catch the exception and it just makes the cells blank. I have fixed the bug causing the exception, but I would like to change WPF's behavi...