.net

.NET enum size?

How many entries can an enum in .NET have? ...

Nicely format an exception into a string

I'd like to build a nicely formatted string of a exception for logging. Doing this from silverlight so options like nlog (not there yet), log4net aren't an option. Anyone seen the code to build up something like: ExceptionType: xxxx Message: xxxx StackTrace: XXX InnerException ExceptionType: xxxx Message: xxxx StackTrace: ...

Document Paginator

How to override our own paginator instead of documentPaginator for a flowDocumentPageViewer - ...

cannot build silverlight library, what references do I need?

I am converting a normal CLR library over to a silverlight library. SqlConnection, SqlCommand, SqlClient aren't recognized. What libraries do I reference? I am working in Silverlight 3.0. ...

XSD and ASMX Services

I have received few WSDLs and XSD defining a service that I need to consume for one of my project. Now here is a similar structure: *XSD_EMPDetails.xsd* - Define few of the EmployerDetails *XSD_EMP.xsd* - has imported EmployerDetails xsd and some more attributes. (xsd import) EMP.wsdl - imports XSD_EMP.xsd (xsd import) EMPServcie.w...

Are .NET automatic data forms a good idea?

I'm a Linux guy usually, but at the moment I'm trying to evaluate .NET for a Windows desktop application. All it needs to do is to display some forms that link to a database, let the user edit the data and then produce reports based on it. I found a walkthough at http://msdn.microsoft.com/en-us/library/ms171884.aspx that automatically pr...

VB.NET need a class property to be a list array

Stack Overflowers: I have been racking my brain trying to get an List(of T) type array to be the property of a class. I know there has to be a simple way of doing it and I can't find a good example on google. Everytime I create a class that I think will work I get the "Object reference not set to an instance of an object" error when I...

Is the CLR a virtual machine ?

Hi, I read a book which referred .net CLR as virtual machine ? Can anyone justify this ? What is the reason we need the concept of virtual machines on some development platforms ? Isn't it possible to develop a native framework [one without virtual machine] that is fully object oriented and as powerful as .net ? The book which refers ...

MVC: Retrieving form values after submitting

I have a form on a dialog box like so: <form action="../ControlerFunction"> <input type=text id="id1"/> <input type=text id="id2"/> <button type="submit"> OK </button> <button type="button" class="close"> Cancel </button> </form> When the form is submitted it hits my controller function, but how can I retrieve the valu...

confusion about transactions and msdtc

I have some basic confusion about how transactions and msdtc work together. I have a basic server/client winforms app. The app uses transactionscope to encapsulate several sql commands that are executed on the sql server. The app seemed to work fine when I enabled msdtc network access on the server only. Then one day it stopped working...

how to obtain substrings those are within the angular brackets in a string

Hi guys, i think this would be really silly question , but iam not succesful with extratic srtings those within the angular barkets in a sentence . var str = "MR. {Name} of {Department} department stood first in {Subjectname}" i need to obtain the substrings (as array) those are within the angular brakets like strArray should contai...

How to set 'automatic configuration script' for a dial-up connection programmatically?

I have a dial-up connection in 'Internet Options' -> 'Connections' and I would like to set an 'automatic configuration script' (one of the connection's settings) for it programmatically. Setting it for LAN is easy but I can't find anything about setting it for other connections. ...

What's the fastest .Net PDF library to dump a bunch of bitmaps to PDF?

I have around 10 System.Drawing.Bitmap elements, which I want to dump to PDF. When combining them to a single bitmap, and then writing this to PNG, this takes me about 150 ms. Now I want to create a PDF out of my bitmaps (4 pages), but with PDFSharp this takes >2.5 seconds. Is there any library that is (way) faster at doing this? NB. I...

Query DNS using specific DNS servers in .NET

From a .NET application, I need to query a specific DNS server for resolving a domain name (the DNS server is not defined in the Windows network configuration). I know this is not possible using standard .NET Framework classes (See this other question). My question is what my options are. There is one open source library on CodePlex (Dn...

A general delegate type for handling any event.

Hey, I have a function that receives two parameters - an object, and an EventInfo structure defining an event on that object. I need to block that function until the specified event fires. The problem I have is, how do I add a delegate to the specified event, when the type of handler could be anything? Note that I don't care about the ...

Why wouldn't I want to use BindingList<T> in my domain model classes ?

I am starting to code a fresh domain model. I plan to use NHibernate to persist my classes later on. I am building an application that is mainly used for optimising transportation. My domain model has one important class in in that is called Model, which represents the current situation that I want to optimize. It is basically a contain...

Unity XML Config Test

We are constantly having problem with our application being broken due to the Unity configuration not being able to resolve dependencies, either the dll or namespace has been changed or is initially wrong. Can anyone point me in the right direction for writing a Test that will ensure all the Unity config files can resolve their dependen...

How to create an easy-to-program-for server for many clients in C#?

I suppose similar questions were already asked, but I was unable to find any. Please feel free to point me to an existing solutions. I'll explain my scenario. I'd like to create a server application. There are many clients (currently only a few dozens, but it should scale up to 1000+) that connect to the server (which is running on a si...

How to determine maximum number of characters given a fixed width font and a maximum width in pixels

Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with GDI+? The text won't be written to a Label or such, but drawn using GDI+: public void DrawString( string s, Font font, Brush brush, RectangleF layoutRectangle, String...

PHP on IIS7 and Windows Server 2008 - Pros and cons

Hi guys, Background: I work for a small microsoft based web dev company who is slowly starting to do more PHP based work. To date we've run these sites (mostly WP) through IIS6 on Windows Server 2003 although this presents problems around mod rewrites etc. We're at a stage where we can make a decision between upgrading our existing se...