.net

How do you determine if two HashSets are equal (by value, not by reference)?

I am trying to determine if two HashSet objects in .NET 3.5 (C#) are equal sets, i.e. contain the same values. This seems like something one would obviously want to do but none of the provided functions seem to give you this information. The way I can think to do this is by checking if the count of the two sets are equal and one set is ...

NHibernate IList to List

Hi I am trying to return a collection of building domain. private long _id; private string _buildingName; private IList<BasicRoom> _rooms; I am using NHibernate and this mapping for the rooms <bag name="rooms" table="tb_rooms" lazy="false"> <key column="buildingID"/> <one-to-many class="Room"/> </bag> And I am calling the db like t...

Interface from a C DLL to .NET

Hi, I have a legacy DLL written in C that I'd like to call from a C# .NET application. The problem is that the DLL interface for the C DLL is fairly complicated. It's something like this: __declspec(dllexport) void __stdcall ProcessChunk( void *p_prochdl, const BIG_INPUT_STRC *p_inparams, BIG_OUTPUT_STRC *p_outparams ); ...

Why doesn't Sun do a C# to Java byte code compiler?

We Want to Run Our C# Code on the JVM My company has a large C# code base. Well over half of this code is our core engine for creating, reading, modifying, calculating and writing Excel workbooks. We frequently get questions from customers and potential customers asking whether we are going to build a Java version of our engine - many o...

How does TransactionScope roll back transactions?

I'm writing an integration test where I will be inserting a number of objects into a database and then checking to make sure whether my method retrieves those objects. My connection to the database is through NHibernate...and my usual method of creating such a test would be to do the following: NHibernateSession.BeginTransaction(); //...

Can I open a VS2008 professional project in Express

I am planning to do some extra coding at home on a project from work, and rather than try and justify them giving me a copy of VS2008 pro, am I able to open VS2008 Professional created C# projects from C# Express? Any changes I make, I will simply load the changed .cs files to VSS, so I don't need the project to save back to a valid VS...

Will Silverlight 2 Succeed Where Netscape Plugins and Java Applets Failed

My company sells spreadsheet components which are used in a variety of ASP.NET and Windows Forms applications. We frequently get an email or a phone call asking "Can we use your product to let our users view / edit / print / etc... this Excel spreadsheet that my boss gave me, in the browser?" Our answer is something like "Not exactly. ...

Can LINQ-To-SQL be used Asynchronously?

Can LINQ-To-SQL be used Asynchronously? Are there any OR Mappers that allow Asynchronous operations? CLOSED: See http://stackoverflow.com/questions/252355/how-to-write-asynchronous-linq-query ...

Why it is not posible to define generic indexers in .NET?

Does anyone knows why you can't create a generic indexer in .NET the following code throws a compiler error: public T this<T>[string key] { get { /* Return generic type T. */ } } Does this mean you can't create a generic indexer for a generic member collection? ...

Add Generic list in a MyClass but how?

How can i add list in a generic class? Firstly My generic Class is that: [Serializable] public class ScheduleSelectedItems { private string Frequency; List FrequencyDays = new List(); private string Time; private string StartTime; private string EndTime; private string StartDate; ...

ASP.NET MVC RC Form Parameters Problem

Hello all, In ASP.NET MVC Beta I was able to get the form parameters of <input id="addresses[40].City" name="addresses[40].City" type="text" value="City" /> <input id="addresses[40].Country" name="addresses[40].Country" type="text" value="Country" /> as Edit(List<Address> addresses) in controller action. Nonetheless, in the new Rele...

Automatically resend a message in WCF

I am using WCF to talk to a Java web service. This web service has a method called Authenticate that returns a session ID. Every request to this web service must contain this session ID in the SOAP header. If one's session times out, invoking any method results in a SoapException being returned. I would like to: Intercept every call ma...

String Format in DataTable Filter Expression

This is my code: lExpression = @"convert(" + lNewColName + ",'System.Decimal')"; if (pCurrency.ToString() != "Select") lExpression += " * convert(" + pCurrency.ToString() + ",'System.Decimal')"; mDtCases.Columns[lColName].Expression = lExpression; Where lNewColName is the ColumnName, pCurrency is the Currency Combo Box, mDtCases is ...

Numbers that exceeds basic types in C#

I'm solving problems in Project Euler. Most of the problems solved by big numbers that exceeds ulong, Ex : ulong number = 81237146123746237846293567465365862854736263874623654728568263582; very sensitive decimal numbers with significant digits over 30 Ex : decimal dec = 0,324234254357389475693657647497826572638542856923...

When do you need the Windows SDK for MSBuild?

I'm setting up my first build server for .NET 3.5 projects, and found this interesting line in the MSBuild log after a successful build of a simple test application: Could not locate the expected version of the Microsoft Windows SDK. Looked for a location specified in the "InstallationFolder" value of the registry key "HKEY...

How do I unit test routes in ASP.NET MVC Beta1

I found articles on how to unit test routes in prior versions of ASP.NET MVC http://www.stephenwalther.com/blog/archive/2008/07/02/asp-net-mvc-tip-13-unit-test-your-custom-routes.aspx http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx but it doesnt work in ASP.NET MVC Beta1. If a mocking fra...

Grid does not resize anymore

I put two controls in a grid column and make either the first or the second control visible. Since the width of the grid column is set to auto it will resize itself according to the width of the visible child... unless I change the width of column using a grid splitter. Now the column does not resize itself to its content anymore if I to...

protected members in a sealed class

I'm writing a WebPart, which means that I inherit from System.Web.UI.WebControls.WebParts.WebPart and I override protected override void CreateChildControls(). However, I'd like to make the class sealed if possible, but that gives two issues: Just sealing the class gives a warning "new protected member declared in sealed class". Changi...

Forcing ActionLinks to be rendered as lowercase

Without creating my own ActionLink HtmlHelper is there a way to force any ActionLinks to be rendered lowercase? Update: Check out the following links for extending the RouteCollection to add LowecaseRoutes http://www.makiwa.com/index.php/2008/05/31/lowercase-mvc-route-urls/ http://goneale.wordpress.com/2008/12/19/lowercase-route-urls-in...

Alternative installers for .NET solutions

I have a solution containing a web application, a windows service plus a few scripts. I'd like it to be possible to click an install file and then choose where to place the files, create a web site or a virtual directory in IIS and install the service. I also have a few script I have to run via an external EXE that will be part of the pa...