.net

GDI+ exception saving a Bitmap to a MemoryStream.

I have a problem in a Windows Forms application with Bitmap.Save failing when I save to a MemoryStream. The problem only seems to occur intermittently on one machine (so far) and the bad news it is at a customer site. I can't debug on the machine, but I got a stack trace that narrowed the problem down to a single line of code. Here's ...

What are the best C# / .NET books, that contain information hard to find on the web?

I asked a more general question about the best C# / .NET books here. In this question I would like to know which books satisfy 2 criteria: Really useful Information isn't conveniently available through Google So for example, I read Effective Java. Great book. Really useful, and details not easily found on the net. Also, I am read...

How to get the HTML output from a DataGrid?

Hi, I was wondering if there was a way to some how get the HTML output of a DataGrid. I want the raw HTML after the data has been bound to the grid. Is there some sort of overload for the render method I can use to accomplish this? Thanks. ...

C# 1.1: Monitoring worker threads

Using the .Net Framework 1.1, what options are available for monitoring threads from other threads? I am attempting to deal with a shortcoming of the threading implementation in 1.1 wherein unhandled exceptions will cause threads to die silently. In 2.0 and later this had been corrected so that any unhandled exception on any thread wil...

Redistribute resgen

Anyone know whether you can redistribute resgen.exe as part of your application? There doesn't seem to be any documentation on this on MSDN. ...

Denormalize a DataSet

I have a DataSet with some DataTables that are linked together with DataRelations (classic order Header/Detail pair). Is there an easy way to denormalize the whole lot into a single DataTable with all the columns of the related tables? The table names and columns are not known at compile time, and there may be more than two tables/relat...

How can I set a network connection to use the AES encryption method on a Windows Mobile device?

I am trying to configure a network connection using ConfigurationManager.ProcessConfiguration, with the configuration file as specified in the MSDN docs. I can create a connection, and configure all of the settings correctly except for the encryption type. No matter what I choose, it is always set to TKIP. I need to set it to AES, which ...

.NET - Find external applications main thread ID.

I'm trying to find the handle of the main thread of an external application. The program I am trying to find the main thread of is multithreaded and it is important I always find the main thread. I know that at most there will be one copy of this program running. This is how I am doing it at the moment: Process[] someProcesses = Process...

Autocomplete for ComboBox in WPF anywhere in text (not just beginning)

I've got a ComboBox in WPF that I've mucked around with quite a lot (it has a custom template and a custom item template). I've got it to the point now where it is working pretty much how I want it, except that when I type into the ComboBox it is doing the filtering for me, but only filters assuming what I type starts the name of the ite...

Sql Server to Excel via a Web Service

I would like to know the best way to transfer data from a web service to an excel worksheet (office 2007). I am not interested in outputing a report to excel from a web site. In our scenario a user will be using excel (with a number of macros and such) and will request about 11000 rows of data from the server to a worksheet. Anyone ha...

Persiting a Queue to prevent out of memory error in C#

I have data structure, specifically a queue, that is growing so large as to cause an out of memory exception. This was unexpected behavior due to the relativity simple object it is holding (having a essentially one string field). Is there an easy way, or a built in .NET way, to save this collection to a file on disk (there is no databa...

Using custom TTF font for Image rendering

I am using Gdi+ on the server-side to create an image which is streamed to the user's browser. None of the standard fonts fit my requirements and so I want to load a TrueType font and use this font for drawing my strings to the graphics object: using (var backgroundImage = new Bitmap(backgroundPath)) using (var avatarImage = new...

How do I let Reflection.Emit assemblies access internal members in the generating assembly?

For one of my projects, I need to generate at run time some classes, and I thought it would be fairly simple to do using Reflection.Emit, but I'm getting MemberAccessExceptions when I run some of the generated code that calls methods that are marked internal in the generator assembly. Is there any way to tell the runtime that the dynami...

Determine property calls between two classes in .Net

Given two .Net types, type A and type B, how could one determine all property calls to type A (including sub classes of type A) made from type B? ...

Best way to access The MS-Exchange Global Access List from a .net application

Which is the best way to access the corporate MS-Exchange GAL (Global Access List - The list of the corporate ID/GroupIDS) from a .net application? We could use CDO, MAPI, LDAP etc but i am looking forward to a solution which is faster and is compatible with atleast outlook 2000 and above. ...

What are the differences between C#.net and Visual Basic.net?

I have a small experience in VB.net and I would like to learn C#.net What are the differences between VB.net and C#.net? Is there any difference in performance between these two? Apart from the syntactical differences, are there any major changes that I have to keep in mind? Thanks in advance, ...

Where to put try catch

Consider this scenario: I have 3-layer app, when the user click on the button the button event handler calls a method in biz layer that do whatever with data my button event handler supply and then pass that data to the data Access layer which sends them to the backend database. The question is where to put the try catch? In the data la...

Need help getting NGen back into working condition.

NGen is unhappy on my computer, and i can't find a way to get a deep understanding of what is going wrong. After every startup, ngen logs this message: .NET Runtime Optimization Service (clr_optimization_v2.0.50727_32) - Service reached limit of transient errors. Will shut down. Last error returned from Service Manager: 0x...

.Net- should I use the Split-function or the split-method?

Background: I needed to split a string of numerous words into an array which separates the words for me for further use later on in my code. However, I needed to get rid of any numbers which might be present in the string so I declared a string contaning characters which I wanted to use as separators/delimiters as follows: dim Separato...

Login method Customization using GINA

Hi All, I know it's not easy to find a master in GINA, but my question is most near to Interprocess Communication(IPC), I wrote my custom GINA in unmanaged c++, I included it a method that checks for validity of a fingerprint for the user try to login, this function will call some method in a running system windows service written in c#...