.net

DateTime locale settings

We are haveing issue with DateTime on one of our application servers. The issue is the datetime is picking the locale settings as en-US and we want to use en-GB. I tried to Change the server Regional and Language options to UK still having the same issue. I could force DateTime to use en-GB but this will require code changes at various l...

N2 CMS Setup problem, missing an assembly reference <add namespace="Microsoft.Web.Mvc"/>

Hi, I'm trying to use N2 CMS. I've download the Template MVC version. I've followed the steps in the installation text. When I run it I get: The type or namespace name 'Web' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) Has anybody else had this problem? Thanks Kevin ...

Adding nodes to LinkedList<T> in foreach

Can I safely add nodes to LinkedList container inside foreach statement? Is there any difference if I used while loop? Or it is never allowed and can cause some problems? foreach(var node in myList) { if(condition) myList.AddLast(new MyNode()); } Will it always work? ...

Edit Control Text Changed Message in C++\Win32

What is the Message that matches the TextChanged property in .NET for C++\Win32? ...

Am I implementing the MVP / Presentation Model UI pattern correctly?

I'm re-working a Winforms application and would like to employ a variation of the Presentation Model pattern for the UI. Could someone tell me from the following explanations if I'm doing it correctly? I have decided to set up dependencies as follows: Model <---- Presentation Model <---- View That is: The model is not aware of...

How to keep reference between two projects when making a template in Visual Studio 2010

I have a solution with 3 projects and i have a reference between two of the projects and a reference to a .dll from a project in all 3 projects. The project are in Silverlight. I want to make a multi-project template and when i create a new project from that template the references doesn't work anymore. It make the modification to the na...

C#: Monitoring copied or moved files with FileSystemWatcher

Hey guys / gals, I have come across several "solutions" here and across the web but none seem to fit the bill. What I am looking to do is have an app monitor a folder for new files (either by creation, a move, or a copy) and perform actions on those objects. That being the scenario, I turned to the FileSystemWatcher class to perform t...

Application_Error vs Context_Error in asp.net

Hi Guys, May be I am confused at the moment and not sure at which point or scenario one should use Application_Error (in Global.asax) or Context_Error (when we implement httpModule) Like... public void Init(System.Web.HttpApplication context) { context.Error += new EventHandler(Context_Error); } Thanks ...

Sending IV along with cipher text, safe?

Hi, There have been many questions with regard to IV generation, encryption and sharing the IV between the sender and receiver, but I want to make an explicit post regarding the best way to send the IV from the sender to the receiver. From all the posts that I've seen so far, I'm uncertain as to whether it is safe to send the IV in "pl...

Using IronRuby or IronPython to modify a list of C# objects

If I had a list of objects eg. List<Foo> where Foo has a couple of properties, could I then create one or more ironruby or ironpython scripts that run for each row. Here is some pseudo code: var items = new List<Foo>(); foreach(var item in items) { var pythonfunc = getPythonFunc("edititem.py"); item = pythonfunc(item); } I nee...

The new BigInteger

.NET 4.0 now has a new data type, System.Numeric.BigInteger. From what I understand, this can hold numbers that have, up to, 1 million digits. Simple arithmetic operations can be performed on this number. What I am wondering is how Microsoft implemented such a thing, given that it would obviously exceed 32-bits and even 64-bits. How does...

ASP.NET MVC View throwing CS1061 error related to type of model object passed as ViewDdata to a view

I'm working through the ASP.NET MVC article at http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx. (Note: Some of the constructs in this post were deprecated in MVC 1 RTM, so I've changed the code accordingly. Perhaps that's my problem.) In my LINQ to SQL .dbml (in MyDB.designer.cs) the Category class ...

How can I decouple this C# worker thread code from the main thread for shared data variables?

How could I modify the below code such that I could, for better readability in code: a) move the "workThreadMethod()" into it's own class b) not have any code in this worker thread class reference static variables from the main "Program" class c) the above are the main two requirements, however I'm hoping that as a side effect this wo...

Method throwing me out of parent method

I'm adding a User (custom class) through my Repository by hijacking the generic Add(T item) method and throwing it to a private AddUser method, if item == typeof(User). It does just that, but as soon as it hits the FlushMembership() call, it exits out too early, ie. it doesn't hit anything beyond that FlushMembership() call and thus no U...

Dynamic Master page

Hi, I am Srinivas, I m new to working on Dynamic master page. I'm presently working on Loading on Dynamic Master Page. When I'm loading the master page dynamically, I am getting this error. "Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate du...

.NET Framework - Any way to get Dictionary<> to be a little faster?

I'm doing a Dictionary<> lookup in an O(n^2) loop and need it to be ridiculously fast. It's not. Does anyone have any insight into how Dictionary<> is implemented? I'm testing Dictionary performance with an isolated test case after running my code through a profiler and determining Dictionary lookups are the bulk of the CPU time.. My...

What is the best way to dynamically generate RDLC report definitions at runtime?

I have data that will be generated by users at runtime by performing queries. The shape of the data is unknown because users can choose which fields to bring back. The application is an ASP.NET MVC web app. The data will be .NET POCOs. However, each object could have properties that are collections of other objects. I want to use the R...

Multiple inheritance is not supported in dotnet. But multiple interface supports?

Multiple inheritance is not supported in dotnet. But multiple interface supports. Why this kind of behaviour exists. Any specific reasons?? ...

Multiple description attributes on emums

C# 4.0 If i want to set description for enum i may use DescriptionAttribute form System.ComponentModel; public enum EnumWithDescription { [Description("EnumDescription1")] EE = 1, [Description("EnumDescription2")] PP } but if i need another specific description i may implement my specific attribute and extension metho...

While Creating a Array Inside a Structure , Does that Structure Contain Directly the Value of Array or the Memory reference to that array?

Hi, I am creating an array as below: public struct Smb_Parameters { public byte WordCount; public ushort[] Words; } While I assign the values Like below: Smb_Parameters smbParameter = new Smb_Parameters(); smbParameter.WordCount = 0; string words= "NT LM 0.12"; smbParameter.Words = Encoding.AS...