.net

is there a signal emiter/consumer engine (like in Django) for .NET (C#)

Has .NET (C#) anything like Django's Signals engine? Our business logic become really complicated over few years of adding new features. I'm going to re-architecture it. Currently all features are very coupled that makes regression errors while changing something one one place - some other place may be broken. I really like Django's ap...

Is it possible to write to the console in colour in .NET?

Writing a small command line tool, it would be nice to output in different colours. Is this possible? ...

Any Alternatives to NCommon?

I like the way NCommon saves me from dealing with all the plumbing required to do DDD with NHibernate. I like it so much that it I am seriously considering it to be part of my default architecture in new projects. I'd like to ask if there are other DDD alternatives (aside from coding from scratch) to what NCommon does. Thanks. ...

Can I point two separate ASP.NET websites to the same profile database?

I'd like two websites to have read/write access to the same user profile database (named "aspnetdb" by default). Presumably this is possible by configuring the websites appropriately in the web.config. Are there any issues I should be wary of? ...

.NET 4.0 Generic Invariant, Covariant, Contravariant

Here's the scenario i am faced with: public abstract class Record { } public abstract class TableRecord : Record { } public abstract class LookupTableRecord : TableRecord { } public sealed class UserRecord : LookupTableRecord { } public interface IDataAccessLayer<TRecord> where TRecord : Record { } public interface ITable...

Read excel 2007 file with OLEDB using a specific culture

I am trying to read an excel 2007 file (using OLEDB) that has dates in the UK format. The server is (sometimes) set to US format and so the normal date format problems are in play. This is my connection string: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=myfile.xlsx;Extended Properties="Excel 12.0 Xml;HDR=NO;IMEX=1" I want to ensur...

How do I get my Windows Forms application to use a custom main function and get access to the Application Framework?

Hi Folks I am trying to use a Main () function in a class to control the program flow in my vb .net Windows Forms application. I have added a splash screen component and a login screen, and customised my main sdi form. I have set the startup form to be my main function in the Application Page of the Project Designer, and everything seem...

Does a .cs file compile under a .vbproj?

Does a .cs(C#) file compile under a .vbproj(VB.NET project) ? (VS 2005, .NET 2) Say I have Animals.vbproj (namespace Animals) I have Wolf.vb, Tiger.vb, Cat.vb, and a Human.cs Could I use Animals.Human from a external AnimalsForm.vb form? Why? ...

Converting .net 1.1 to .net 2.0

how we can convert .net 1.1 to .net 2.0 without any change in code? ...

Error: '<method1>' and '<method2>' cannot overload each other

I override a list in VB. In C# the code compiles and looks like this: class MyObjectCollection : IList { ... /// <summary> /// Gets or sets the element at the specified index. /// </summary> public MyObject this[int index] { get { return (MyObject)innerArray[index]; } set { innerArray[index] = ...

Getting .NET schema for a stored procedure result

I have a couple of stored procedures in T-SQL where each stored procedure has a fixed schema for the result set. I need to map the result sets for each procedure to a POCO object and need the column name and type for each column in the result set. Is there a quick way of accessing the information? The best way I have found so far is ac...

Bind any version of MySql.Data using the app.config

How do I bind any version or a range of versions of an assembly by using the app.config? I'm currently binding the MySql.Data assembly like this: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" applies-to="v2.0.50727"> <qualifyAssembly partialName="MySql.Data" fullName="MySql.Data, Ve...

Which new C#/VB features require .net Framework 4?

I remember reading in passing that some of the new language features in C# and VB that are available in VS2010 are backwards compatible with earlier versions of the framework, but that others are not. I'm pretty sure this was in reference to the new property syntax in VB. Which new features are language features vs which ones are frame...

Upgrading EntLib 4.1 to 5 with Oracle.DataAccess.Client

Hello, I am upgrading a project from EntLib 4.1 to EntLib 5. I've skimmed through the Migration Guide, changed all the references and updated all the config files to point to EntLib 5. All worked fine accept Oracle database access. With the config file: <configuration> <configSections> <section name="dataConfiguration" type="Micro...

WPF MenuItem ViewModel Command

Hi, I am fairly new to WPF and am struggling a little with a scenario. I have a menu which has menu items. When one of these menu items gets clicked a method needs to be called that will do something based upon the text displayed associated with that menu item. So for example, the menu item's content was "test" so I would need to do som...

Check item in CheckedListBox without selecting

How can I allow the user to click to check an item in CheckedListBox in one click? The default behavior is the first click selects the item, the second click allows you to toggle the check. I don't want to toggle the check on select either, I'm looking for the behavior of the ListView control where I can click directly on check boxes to ...

Query for existence of an object with LINQ (to Entities)

(I've put "...to Entities" in brackets since I don't know if this matters at all. I guess this is a quite general LINQ related question.) I want to check with LINQ (to Entities) if an object exists in the database. At the moment I am doing the following: using (MyEntitiesContext aCtx = new MyEntitiesContext()) { var aQuery = from c...

Stored Procedure in Entity Framework

Hi I had added the Stored procedure in my Entity framework and i also imported the functions in the edmx. Is it must to add all the three functions insert, update, and delete functions to a table. I had tried with insert alone and also with all, but why can't i get the name of the stored procedure in the connection string. Let me know...

Inherit from Type class of .Net

Is there any point at all on inheriting from Type class in .Net? i.e. What could be the meaning of doing so? I am asking this because of this text in MSDN documentation: Notes to Inheritors When you inherit from Type, you must override the following members... list of members. MSDN doc for Type: http://msdn.microsoft.com/en-u...

What happened to Shersoft and the ActiveListBar control?

I have the task of maintaining an application that started life as a VB6 app and has been migrated up to .NET 3.5. This app contains several third-party COM controls, one of which is the Shersoft ActiveListBar control. I'm trying to get a couple new programmers set up to edit this project and we're running into a licensing issue and a po...