.net

Destroy the EnumBuilder After Creating an Enum?

I am trying to reduce the amount of memory my application uses. In my application, I use System.Reflection.Emit.EnumBuilder to create enumerations on the fly from information I receive at runtime. I only use the EnumBuilder to create an individual enumeration, and after that I have no further use for it. While using CLRProfiler, I not...

How to get ASP.NET control string property to display suggested list in designer dropdown?

How can I add a string property to my ASP.NET custom control that will result in the designer (either in HTML view or wysiwyg view) providing auto-complete by providing a list of some 30 suggested strings, while allowing for custom strings to be input? Right now I'm using a property of type enum to allow the user to select from a list, ...

Project Dependencies in Visual Studio

I have a three projects in the solution WinSync. I have WinSyncGui, WinSyncLib and Setup. WinSyncGui requires files from WinSyncLib. How can I get it to include WinSyncLib in WinSyncGui? VS complains The type or namespace name 'WinSyncLib' could not be found (are you missing a using directive or an assembly reference?) I've set the dep...

Sharing assembiles between Silverlight and "plain vanilla" .Net.

I'm using some generic classes as data containers, and am using them to pass data to and from a wcf service. Because of the way WCF mangles generic names on the client side into a class named something like "ListOfBlah231546797646", I'm adding a reference to the real assembly as a "KnownType". Silverlight needs to consume these service...

Callbacks in C#

I want to have a library that will have a function in it that accepts an object for it's parameter. With this object I want to be able to call a specified function when X is finished. The function that will be called is to be specified by the caller, and X will be done and monitored by the library. How can I do this? For reference I'm...

Help with Elmah Configuration in ASP.NET

I'm trying to setup ELMAH to log errors for our application. I have successfully added the modules and am having no problems loading the ErrorLog page (elmah.axd). However, Elmah isn't logging any test exceptions that I'm generating. My web.config looks like this: <configSections> <!-- Other stuff --> <sectionGroup name="elma...

Best way to update in Linq To SQL

Hello All, I have several entity classes that I use for parsing fixed width text files as well as utilizing Linq to SQL. I use these classes to parse data from said text files, and compare to data in the database. One of these entities has a lot of properties, and I don't want to waste time setting each individual property on the Linq r...

Is it possible to run arbitrary queries with Linq to SQL? (C#)

How would I write the following query using Linq to SQL? UPDATE [TB_EXAMPLE] SET [COLUMN1] = 1 (My actual goal is more complex than this) ...

Read multiple text files in a folder

I have many text files in a folder. What I can do now is to read through one text at a time and insert it into the database. My little app reads a text file when I debug it. So, I need to run it several times to read all those text files and import them into the database. My question is how to read multiple text files inside a folder at...

Assemblies and Namespace

Does everything in a single namespace compile into its own assembly? ...

The State of Linkers for .NET apps (aka "Please Sir, May I have a Linker" 2009 edition)

Many people here are probably familiar with one of Joel Spolsky most popular blog posts, Please Sir, May I Have a Linker, where he cries out for a way to remove dependencies on the .NET framework so a stand-alone application can be developed and sold. Jason Zander of the Visual Studio development team, at the time, replied with his view...

Riddle: When are three equal dates not equal

Start with three variables, all are System.DateTime. a: 10/2/2009 2:30:00 PM b: 10/2/2009 2:30:00 PM c: 10/2/2009 2:30:00 PM Compare them to each other. a=b: True b=c: True c=a: True Ok, we have established that all three dates are equal. So when we convert them all to Universal time, we will get the same result. Right? a.ToUniver...

Exceptions on .Net ThreadPool Threads

Duplicate: How to catch exceptions from a ThreadPool.QueueUserWorkItem? I am queueing up multiple delegates on the .Net ThreadPool for a large number of independant remoting calls that themselves call multiple databases and other offline resources. By Queueing these calls on the ThreadPool I can run them concurrently and minimize th...

C# - Processing html tag attributes

I'm getting some html data from remote server and before displaying it in the UI of application i need to make some changes, i.e. delete counters, replace links, etc. Removing some tag with contents and changing specific link is not a big deal, but when it comes to some advanced processing, i have some problems.There is a need to replace...

.NET based class library - many ways to do a specific task - what are the top X vs Y articles and books

Very few books and articles ever go into detail about a) why multiple methods are provided to complete a specific task in a specific scenario and b) what considerations a developer should take when choosing between methods. My specific case in point is the simple opening of a text file (classic first section of any IO chapter). Most bo...

Please help me solve my W3C validation API timeout issue

I'm using the W3C validation service to check that the text I type into a TextBox is valid markup. It's almost working. But, under particular conditions my input results in an error and then endless timeout exceptions. I have to close an re-open the program to get it working again. Please glance over my code and help me to solve th...

In Job Postings, What Is .NET Programming?

My latest contract project successfully concluded a couple of weeks ago, and I've been pounding the job sites looking for new work. It's been six or seven years since I last really looked at these sites, so maybe the phrase, ".NET Programmer," or variants, has come to mean something. But, danged if I know what! My primary language is C#...

Image Resize C#,VB.NET Opensource Library

Any one point me on good direction on how to resize a jpg image to exactly particular size (Both File size and pixel size Ex. 148 x 72 px , 300 KB ). To Acheive this, Quality of images can be adjusted. It may a .NET library /code but it should be free for commercial use / open source. I want it in either C# or VB.NET as library. ...

Binding parameters to Windows Workflow instance & ignoring unused ones

I have a bunch of named value parameters in a Dictionary<string, object>, which I want to pass into different workflows. The catch is that each workflow will only need a subset of the properties in the dictionary, and I don't know beforehand which workflow needs which properties. The problem is that when I call WorkflowRuntime.CreateWo...

How to get max allowed filesize in .Net?

Hello there, Does anyone know how to (natively) get the max allowed file size for a given drive/folder/directory? As in for Fat16 it is ~2gb, Fat32 it was 4gb as far as I remember and for the newer NTFS versions it is something way beyond that.. let alone Mono and the underlying OSes. Is there anything I can read out / retrieve that mi...