.net

How do I calculate relative time?

Given a specific DateTime value, how do I display relative time, like 2 hours ago 3 days ago a month ago etc, etc...? ...

Reliable Timer in a Console Application

I am aware in dot net there are three timer types (see http://msdn.microsoft.com/en-us/magazine/cc164015.aspx). I have chosen a the threaded timer as the other types can drift if the main thread is busy and I need this to be reliable. The way this timer works in the control of the timer is put on another thread so it can always tick alo...

Anatomy of a "Memory Leak"

In .NET perspective: What is a Memory Leak? How to understand whether your application leaks? What are the effects? How to prevent a memory leak? If your application has memory leak, does it go away when the process exits or killed? Or do memory leaks in your application affects other processes on the system even after process completi...

XSD DataSets and ignoring foreign keys

I have and pretty standard table setup in a current application using the .net XSD DataSet and TableAdapter features. My contracts table consists of some standard contract information, with a column for the primary department. This column is a foreign key to my Departments table, where I store the basic department name, id, notes. This i...

How do I sync the SVN revision number with my ASP.NET web site?

stackoverflow.com has a version number at the bottom: "svn revision: 679" I want to use such automatic versioning with my .NET web, win forms, wpf projects/solutions....

How do I programmatically create a PDF in my .NET application?

Please recommend a good library for programmatically creating PDF documents in .NET applications. ...

Floating Point Number parsing: Is there a Catch All algorithm?

One of the fun parts of multi-cultural programming are numbers formats. Americans use 10,000.50, Germans use 10.000,50, French use 10 000,50 etc. My first approach would be: Take the string, parse it backwards, until I encounter a separator and use this as my decimal separator. The obvious flaw with that: 10.000 would be interpreted as ...

SQLite and XSD

Does anybody know if there is a way to create a SQLite database based on an XSD DataSet? In the past I've just used a basic SQLite manager, but want to fuse things a bit more with my .NET development if possible....

Adding Scripting functionality to .NET applications

I have a little game written in C#. It uses a database as back-end. It's a Trading Card Game, and I wanted to implement the function of the cards as Script. What I mean is that I essentially have an Interface ICard which the Card implements (public class Card056 : ICard) and which contains function that are called by the game. Now, to...

.NET Migrations Engine

I was once under the belief that Microsoft was working on an official, ruby-like, Migration framework. However, I haven't been able to find any additional information (or even the original source of my belief). Does anyone know any information about an official migration framework? or possibly an open source one? ...

How do you migrate a large app from VB6 to VB .net ?

My company makes a monolithic piece of software that our customers use to run their car dealerships. The original app was written in VB6, and it has grown substantially over the last few years. Until now, there hasn't really been a business case for switching to the .net framework. Sure, it's newer, considerably better at certain things,...

Homegrown consumption of web services

I've been writing a few web services for a .net app and now I'm ready to consume them. I've seen numerous examples where there is homegrown code for consing the service as opposed to using the auto generated methods Visisl Studio creates when adding the web reference. Is there some advantage to this?...

Automatically update version number

I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want. I'm also using a settings file and in earlier attempts when the assembly ...

Embedded Database for .net that can run off a network

I was (and still am) looking for an embedded database to be used in a .net (c#) application. The caveat: The Application (or at least the database) is stored on a Network drive, but only used by 1 user at a time. Now, my first idea was SQL Server Compact edition. That is really nicely integreated, but it can not run off a network. Fire...

.NET Testing Framework Advice

I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next 6 months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to frameworks that don't have integration but are still relative...

VFP .NET OLEdb provider does not work in Win 64-Bits. Help

I wrote a windows service using VB that read some legacy data from Visual Foxpro Databases to be inserted in SQL 2005. The problem is this use to run fine in Windows server 2003 32-Bits, but the client recently moved to Windows 2003 64-Bits and now the service won't work. I'm getting a message the the VFP .NET OLEdb provider is not found...

Get a new object instance from a Type in C#

One may not always know the Type of an object at compile-time, but may need to create an instance of the Type. How do you get a new object instance from a Type?...

Localising date format descriptors

What is the best way to localise a date format descriptor? As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users culture, but you often want to al...

Unhandled Exception Handler in .NET 1.1

I'm maintaining a .NET 1.1 application, and one of the things I've been tasked with is making sure the user doesn't see any unfriendly error notifications. I've added handlers to Application.ThreadException and AppDomain.CurrentDomain.UnhandledException, which do get called. My problem is that the standard CLR error dialog is still disp...

Free OCR library

Does anyone know of a good free or cheap (under £100/$200) OCR library? It needs to run on Windows and preferably be a .NET library, though a COM interface is fine. ...