.net

Common programming mistakes for .NET developers to avoid?

What are some common mistakes made by .NET developers, and how can we avoid them? For example, trying to open a file without checking whether or not it exists, or catching an error unnecessarily. Please look in to the list before posting new Please justify your answer as well, if applicable and give examples. ...

The C++ .NET programmer's bookshelf

I'm buying a lot of books, but I feel I don't hit the good ones. So, I leave it up to you to suggest what books a C++ .NET programmer should have in the bookshelf. Preferably it should contain books with level from novice to expert level, and I believe it should contain more than one single book. ...

Are there any timeframe selector web controls for .NET?

I would like to use a timeframe selector in a web page, that is optimized for touchscreen usage. (e.g. large buttons). I am actualy looking for a control that mimics iPhone UI for selecting a time frame or a time interval, say from 10:30 AM to 15:00 PM. ...

.NET method to round a number up to the nearest multiple of another number?

I'm looking for a method that can round a number up to the nearest multiple of another. This is similar Quantization. Eg. If I want to round 81 up to the nearest multiple of 20, it should return 100. Is there a method built-in method in the .NET framework I can use for this? The reason I'm asking for a built-in method is because the...

Datacontext Lifetime in WinForm Binding Scenario

This one has been stumping me for a while. But I'm no expert. This is a bit long... I have a WinForms app with an Outlook style UI. That it to say there is a bar on the left hand pane that allows you to select a 'screen' which is a WinForms control, say the customer screen, and on the right hand pane there will appear a list of custo...

Which .net ORM can deal with this scenario

From a previous question, I learn that Linq to SQL is not able to eager load only certain files of foreingKey tables. So I'm asking what .net ORM can support including this type of statement inside a entity class, with only one DB call and without manually mapping the result with the object. -- simplified for clarity SELECT Order.*...

Worker process recycles because it reached its virtual memory limit

We host a rather large (self written) ASP.NET website for our customers. It consists of a web service, a web site and a image serving web site, all three in their own virtual directory. The three virtual directories are together in one application pool. The pool has both memory limits (maximum virtual memory and maximum used memory) set ...

Purpose of Restrictions parameter in MetaObject constructor?

I currently have an issue in my DLR language implementation where subsequent calls to a method defined in the language occur with the same input parameters used by the first call to that method. So... if I do this in my language: PrintType( 34 ); PrintType( 34.1 ); ... the output is: Integer Integer Where I would expect: Integer ...

.net - Is it possible to use the sql IN clause in a SqlDataSource ?

For a selectcommand in a sqldatasource is there any way to have the following: select col1, col2 from mytable where col1 IN (@inClause) @inClause would be an array of integer, for example. I don't think this is even possible in T-SQL, so my assumption is that it is not possible, but just wondering if there's a way to do it? ...

VSTO: Can't create workbooks

When I try to create a Excel or Word workbook project in VS, I get the message: A compatible version of Microsoft Office is not installed on this computer. You must install the version of Office that is compatible with your project. In addition, repair the version of the Visual Studio Tools for Office runtime that i...

Is there a wildcard expansion option for .net apps?

I've used the setargv.obj linking for Expanding Wildcard Arguments in the past for a number of C and C++ apps, but I can't find any similar mention for .net applications. Is there a standard way to have your app's command line parameters automatically wildcard expanded? (i.e. expand *.doc from one entry in args parameter to all that mat...

How can I make a WPF WebBrowser read-only?

I'm using a WPF WebBrowser control to preview HTML typed by the user. example... But, how do I made the WebBrowser control read-only? I don't want the user to be clicking links in there and navigating away from the preview page. I want my users to create links. I just want to make sure the "preview" pane is a preview of the correct...

Can a Byte[] Array be written to a file in C#?

I'm trying to write out a Byte[] array representing a complete file to a file. The original file from the client is sent via TCP and then received by a server. The received stream is read to a byte array and then sent to be processed by this class. This is mainly to ensure that the receiving TCPClient is ready for the next stream and...

.NET Signed XML Prefix

Is there a way to set the prefix on the Signature of a Signed XML Document (SignedXml class in .Net)? So instead of: <Signature xmlns="http://www.w3.org/2000/09/xmldsig#&gt; ... </Signature> I could have the following: <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#&gt; ... </ds:Signature> ...

Deploying .PDB files in IIS. Any benefit?

I am deploying ASP.NET and Web Service solutions to IIS for a development server. It looks like the last person that did this job deployed all the .pdb files too. I asked about it, and was told that they "provide better stack trace info in the logs" if they are left on the server. Is there any truth to this? I've always left them behind...

Problems installing .NET Services from InstallShield 2009 MSI - Custom Action did not close 1 MSIHANDLEs

I am using InstallShield 2009 to generate an MSI for a codebase I have inherited. The code is comprised of VB6, and .NET 2.0 code (C# and C++). I'm developing and installing on Windows XP SP2. I created the Install Shield project (call it "MyClient.ISM") by reverse engineering it from the MSI provided by the previous team. Their configu...

How can I sort an SQL result but keep some results as special?

I have a result from an SQL query that I would like to sort alphabetical, but there are a couple of commonly used results that I would like to float to the top. Is there a simple way I can achieve this either by doing clever SQL or by sorting the (asp.net) datatable once I have it filled? I know the database ID of the things that I wan...

Programmatically create Photomosaic

Goal: Create Photomosaics programmatically using .NET and C#. Main reason I'd like to do this programatically is to be able to record which image and where it goes myself, so I can create an animated effect of the images coming together to create the photomosaic. It would be great to just find something existing already that I could us...

.Net 3.5 SP1 official update rollout?

To the best of my knowledge and googling skills, .Net 3.5 SP1 is still not an "official" release. That is the only way to get the SP1 upgrade is by voluntary download and not through mandatory windows updates. Is there any time frame set for when .Net 3.5 SP1 will be pushed to all windows users? ...

Converting a MySQL .DMP file to a .SQL File for MS Sql Server 2005

I'm at square one on a project that will need to repeatedly import data from MySQL *.dmp files into an existing Sql Server database. I am looking for guidance in the form of an existing tool, framework, or, barring pre-existing solutions, suggestions for how to proceed. My first thought is to read the dmp file in as text and perform so...