.net

How do I query for data indexed as IndexEmbedded(FullText in nhibernate.search)

How do I query for data added as IndexEmbedded? I have an entity class [Indexed] public class Something { [Field(Index.Tokenized, Store = Store.Yes)] public virtual string Description { get; set; } [IndexedEmbedded] public virtual Category Category { get; set; } [IndexedEmbedded] public virtual Location L...

Strange remoting connection problem

In trying to configure a .NET remoting setup over TCP, I've been having problems accepting outside connections (connections from any computer not on my LAN). I did some investigation and hit netstat -a as soon as my friend started to connect. Here's what I saw: TCP 0.0.0.0:2594 Taylor-PC:0 LISTENING ... ...

How to control method behavior via an attribute?

I would like to apply a custom attribute to some methods that indicates they should be handled as a transaction. In general, I know how to create custom attributes by inheriting from System.Attribute, but I don't know how to do what I need. My goal is something like this: [TransactionalMethod()] public void SaveData(object someObject)...

Adding Linq support to web project. Compiler chokes

I added a reference to the System.Core assembly. The web.config now has: <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> The IIS is set to use ASP.NET version 2.0.50727 Though intellisense shows the extension methods, the compiler does not understand the linq syntax. I can use Linq in ...

Connection timeout

Hi Guys, Im getting this error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding "Data Source=" + server + ";Initial Catalog=" + database + ";Integrated Security=SSPI;Connection Reset=False;" Connection pooling is default to true and I am closing all connections. Any...

AltGr in System.Windows.Forms.Keys enumerator

Should be an easy one. What is the value of the AltGr key in the System.Windows.Forms.Keys enumerator? I've looked through it and can't see anything obvious ('AltrGr' no, 'RAlt' no, 'GrAlt' no). Thanks Simon Updated - Answered: if (ModifierKeys == ( Keys.Control | Keys.Alt ) ) { // AltGr is held down ...

How to get the method call history?

I am trying to get the list of calls made from the beginning of a try block to the exception. In the code below, when I fall into the Catch block, the StackTrace in the Exception object is the following : at ConsoleApplication.Program.MethodC() / at ConsoleApplication.Program.Main(String[] args). This is totally expected, but doesn't hel...

What are the Dangers of using a Singleton in a multithreaded application

I'm looking at using a singleton in a multithreaded Win service for doing logging, and wanted to know what are some of the problems I might encounter. I have already set up the get instance to handle syncing with private static volatile Logging _instance; private static object _syncRoot = new object(); private Logging(){} ...

Old .NET Software Problems

How come software created in an older framework version won't run on a newer framework version? Actually whenever i try to run some old specific software having .net 3.5 framework on my PC they show they needs .net framwork 1.1 . What a bad thing? My newer version of Photoshop ans Ms office open all lower version files. ...

User Group and Role Management in .NET with Active Directory

I'm currently researching methods for storing user roles and permissions for .NET based projects. Some of these projects are web based, some are not. I'm currently struggling to find the best method to achieve what I'm looking for in a consistent, portable way across project types. Where I'm at, we're looking to leverage Active Director...

Linq over Stored Procedures

What are some pros and cons of using linq over stored procedures? ...

How to compare values from different tables with a single query on Linq-to-SQL?

The code, with two Linq-to-SQL queries, that I am trying to optimize is below: var maxAInstant = ( from a in db.As select a.Instant ) .Max(); var maxBInstant = ( from b in db.Bs select b.instant ) ...

Displaying streaming rich text with WPF

I have a WPF application that connects via a socket to a device and gets streaming text data (approx 1 message per second). This data is then displayed on the UI. The user can create rules like "If the data contains 'abc' highlight the line" or "…make it bold", so plain text output will not do, it needs to be "rich" text. My current s...

Debugging AxShockwaveFlash

I'm building a C# app which contains an interactive Flash control via AxShockwaveFlash. One of the challenges is that while I am using the Eclipse-based Flex Builder to develop the Flash controls, it only seems to give me the ability to debug the Flash control if the movie is being run standalone, directly through the Flash player. I m...

How do you specify what a default state of a derived struct should be in C#?

I've seen different questions on SO about not being able to use parameterless constructors or not setting field initializers, but I think my question kind of goes a step beyond that. What I would like to know is, how would I go about setting up the "default" value of a struct I need to define? Say I'm making a TaxID struct, and the d...

Using RangeValidator with byte

This is the property declaration in question: [RangeValidator(1,RangeBoundaryType.Inclusive,255,RangeBoundaryType.Inclusive,MessageTemplate = "StartFlexibility is out of range")] public byte StartFlexibility { get; set; } When the validate method is called, a FormatException is thrown telling me that the value type needs to be In...

MagickNet C++ Source Compilation Failure

I'm attempting to compile a working copy of the MagickNet class library (DLL) using the sources from the ImageMagick and MagickNet libraries. I was unable to obtain a copy of the MagickNet source files from the creator's homepage as it is currently down, so I was forced to obtain the files and C++ project file from here, courtesy of a G...

TCP async sockets throwing 10057

I've written the following code: public static void BeginListen( int port ) { IPAddress address = IPAddress.Any; IPEndPoint endPoint = new IPEndPoint( address, port ); m_Socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ); m_Socket.Bind( endPoint ); m_S...

Update ASP.Net membership from windows service

I am working on a project for a property management company. There is the back end system that stores all of the tenants and property portfolios, and a front end website that allows users to view their packages, service requests etc. I need to write a windows service that pulls their information out of the back end and place it into th...

Are those unit tests fine?

Hi! I'm trying to grasp test driven development, and I'm wondering if those unit tests is fine. I have a interface which looks like this: public interface IEntryRepository { IEnumerable<Entry> FetchAll(); Entry Fetch(int id); void Add(Entry entry); void Delete(Entry entry); } And then this class which implements that ...