.net

End of month calculations

Hi guys Just wondering if any know of an elegant solution for the following. If I have 30 June 2009 and I add a month I want it to go to 31 July 2009, not the 30 July 2009. This logic is based on the fact that the 30 June 2009 was the end of the month of June and when I add a month I want to go to the end of the next month. But if...

How to choose a file format?

I created a .NET application years ago without thinking too hard about the file format: it uses a soap formatter to serialize our large hierarchy of objects. It was dirt simple to do, and so I didn't give it much thought. I'm now trying to come up with a more optimal file format considering the following issue: When a file is saved, it ...

Server side for a multiplayer turn based silverlight game.

I am currently in the early stages of designing a browser based game using silverlight. The game is going to have many matches of 2-4 players (perhaps even up to 8) and will be turn based. The Front end is Silverlight 3.0 since I have some experience there. I am trying to figure out what the back end should be. Since the game is turn b...

Tool to remove hanging code.

This question is in continuation to http://stackoverflow.com/questions/979129/. It would be great if there is some tool that would allow to remove the hanging code (code not being used). Examples would be unused variables,references,functions or even class (old code or code only written for experimentation). ...

Creating a hook to a app?

Hi all, Here is what I need. I trying to write a application that will take over another application and intercept certain things that happens in it. The idea is to monitor the application and take actions when some stuff happens. After some research I found that Detours 2.1 from Ms Research, will help me, but I am having a hard time ...

Date difference in English

Near duplicates How do I calculate relative time? How do I calculate someone’s age in C#? Anyone know how of a function in VB.NET or C# that will take two dates, calculate the difference and output that difference in an english string? For example if I pass the dates '3/10/2009' and '3/25/2009', the function would return the s...

Is silverlight the right choice for what i need?

I am looking at the best approach to add rich functionality to an existing ASP.NET 3.5 application. I have not developed anything in Silverlight but as i was thinking about what functionality i needed i started wondering if Silverlight might be the answer. Here is what i need: The ability to move/select objects, select each object and ...

Do .Net Framework 4.0 has features connecting to DB2

I need to know is there any feature of connecting to DB2 database from .net in .Net framework 4.0 EDIT:- I like to is there any DB2 provider ...

How do I build a diagramming application in .NET?

I want to write a GUI seating application that allows users to draw and annotate simple "maps" of seating areas. The end result would probably look something a little like Visio, but specifically for manipulating my "seating" data model rather than producing files. In Java-land, there's the Graphical Editing Framework (GEF) -- is there...

How do I handle an event in C# based on a cell click in a DataGridView?

FYI, I looked at existing postings and I did not find exactly what I needed. I am using Visual Studio 2008 to write a C# Windows Forms program. I have a DataGridView object that displays data from a table. When a user clicks on a cell I want to be able to grab the contents of that cell. How do get an action to take place whenever the...

How do I determine how large to make my buffer when using GzipStream?

I'm trying to decompress a GZipStream. The problem is that the "Length" property on the stream throws a "NotSupported" exception. How do I know what size to make my buffer when I'm reading the bytes from the stream? Since it's compressed I don't know how large the uncompressed version will be. Any suggestions? ...

.NET: Do I need to keep a reference to WebClient while downloading asynchronously?

I use the following method in a piece of production code: private void DownloadData(Uri uri) { WebClient webClient = new WebClient(); DownloadDataCompletedEventHandler eh = null; eh = delegate(object sender, DownloadDataCompletedEventArgs e) { webClient.DownloadDataCompleted -= eh; ...

Set background color of WPF Textbox in C# code

How can I change the background and foreground colors of a WPF Textbox programatically in c#? ...

Have you deployed .NET computing applications to clouds outside Windows Azure?

I'm interested in running CPU-intensive computations in clouds. The only real requirement is ability to run .NET applications (F# algorythms like this one) with enough security permissions for using reflection-based IoC Container. Persistence technology does not really matter as long as something is there. I'd like to know of your exper...

I18n error messages in .NET

I have a .NET application that talks to the AD in order to all the user to change the password of the AD account. It is a web application used internationally and I can't assume that the user speaks English. So I need to translate error messages like "Password does not meet the password policy requirements" into whatever culture the use...

Service won't automatically start after reboot

I wrote a windows service (Win32 API) that uses a .NET assembly written in C#. The service is set up to start automatically. In Windows XP all works well but under Vista the service is not automatically started (after reboot) because the .NET component is throwing an exception. But if I start the service manually, it works well. It seems...

Removing the default MDI menu of a MDI Container form when a MDI Child is maximized

Hello guys, I am working on a .NET C# application that has a main Form which is MDI container. When the user maximizes a MDI child, Windows draws a control strip right under the title bar of the container Form which has the Icon of the child and the system buttons on the right. Basically, what I need is hide this strip and use a custom ...

Solution organisation for product

We have a base product that has bespoke development for each client that extends and overwrites the functionality of the base. We also have a custom framework that the base product and sits on top of. We use inherited forms to override the base functionality and to date all the forms and classes have been lumped in the same projects ...

How to deploy my asp.net project in IIS ?

I have windows 2003 server , and a asp.net project developed in VS2008 developer edition how to deploy this website in the server? ...

Deserializing only first x items of an array

Is is possible to only deserialize a limited number of items from a serialized array? Background: I have a stream that holds a serialized array of type T. The array can have millions of items but i want to create a preview of the content and only retrieve the, say, first one hundred items. My first idea was to create a wrapper around ...