.net

.NET "must-have" development tools

James Avery wrote a classic article a while back entitled Ten Must-Have Tools Every Developer Should Download Now which is a companion to Visual Studio Add-Ins Every Developer Should Download Now and Scott Hanselman has an excellent list on his blog but if you were on a desert island and were only allowed three .NET development tools wh...

Tab index not working properly

I have some controls in the tablelayoutpanel but the tab index for the control are not working properly. ...

obtain command line arguments in unit test

In a Test project in Visual Studio 2008 (Pro), I created a Test project, and I want to configure the project properties to give a command line argument to the tests. I set the properties, but then realized I have no idea how to actually use the argument. How do you get the arguments from MSTest? ...

Good Examples of .NET Desktop Applications

I would like to evaluate .NET as a development platform for a desktop application. I am looking for good examples of .NET desktop applications used in the mainstream. The only ones I know of are: Visual Studio (The copy website form is one example.) Team Explorer UI Paint.NET Reflector Gnome Do (An app launcher for Gnome; runs on Mono)...

Convex Hull generation in .NET

I've got a bunch of 3D vertex positions & need to generate a convex hull containing them; does anyone know of any QHull bindings for .NET? or native 3D Delaunay triangulation algorithms? ...

TraceSource in TestDriven.NET AppDomain

I'm running tests using the TestDriven.NET VS add-in, and the class library I'm testing is instrumented using TraceSource. How can I get the output of that TraceSource to show up in the Output window in Visual Studio? The DefaultTraceListener doesn't appear to be working quite right. Do I need to manually add a ConsoleListener or some...

Wait window in a windows application

I basically need to show a wait window to the user. For this i have put two seperate window forms in the application. the first form is the main form with a button. The second one is a empty one with just a label text. On click of the button in Form1 i do the below Form2 f = new Form2(); f.Show(); Thread.Sleep(2000); f.Close(); My id...

How to start a process from C# (WinForms)

How to start a process, such as launching a URL when the user clicks a button? ...

What's new in SP1 for .NET 3.5

Is there an exact overview what has changed in the SP1 for .NET 3.5? New classes, methods, etc. For example, I've noticed there is a new WaitOne(TimeSpan) and WaitOne(int) overloads in the WaitHandle class. ...

Issue with localizing html title of a page

I'm trying to localize my aspx pages. I'm done with content localization using L10n features provided by .net f/w, like resource files. But I'm finding it difficult to set local data in page titles. Most of the browsers, including IE and FF, shows content on window title with some boxes (FF will show properly localized text in tab, IE ...

WPF -- Where do you draw the line between code and XAML?

I'm a long-time C#/.NET programmer but totally new to WPF and the System.Windows.Controls namespace and XAML. The more I learn about it the more I realize that you can do pretty much all of your GUI initialization and event handling glue in either XAML or in code (say C# code or VB.Net code). My question is to those who have been wo...

Cast or convert when retrieving data from a database?

When accessing an object in a DataTable retrieved from a database, are there any reasons not to cast the object into your desired type, or are there reasons to use convert? I know the rule is cast when we know what data type we're working with, and convert when attempting to change the data type to something it isn't. Presuming we know w...

sqlParameter conversion

I'm trying to call the sql statement below but get the following error. System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value '+@buildingIDs+' to data type int. @"SELECT id, startDateTime, endDateTime From tb_bookings WHERE buildingID IN ('+@buildingIDs+') AND startDateTime <= @fromDate"; buildingID ...

Replace Placeholders in word document with c#

Hi there, I have a template in word (.docx) format and want to replace some placeholders in this template with my own data, do you know where I can find the right classes for this project? It would be nice for me to know the namespace. Are there any newer classes for handling word documents in the docx format (xml) than the com classes?...

Finding the end of a substring match in .NET

I am trying to find the index of a substring in a string that matches another string under a specific culture (provided from a System.CultureInfo). For example the string "ass" matches the substring "aß" in "straße" under a German culture. I can find the index of the start of the match using culture.CompareInfo.IndexOf(value, substr...

What is the easiest way using .net to check if events have been logged in the eventlog?

What is the easiest way to check if events have been logged in the eventlog during a period of time? I want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I can use System.Diagnostics.EventLog and then look at the Entri...

What is the best starting point on the Entity Framework from MS?

Please give me the direction of the best guidance on the Entity Framework. ...

Exceptions Thrown (Errors Encountered) After Program Termination

I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...) My guess is there is an error during the clean up process. But these memory read/write errors seem to indicate something wrong in my "unsafe" code usage (pointers?). ...

Visual Print Design for .NET

I have a project that I'm working on and I need to be able to print out ID cards from the program. Are there any products out there that are reasonably priced so I can design a document for print and use it in .NET? I'm trying to avoid using System.Drawing from having to do it manually because when the company I work for needs to make ch...

LinqToSql referenced entities will throw NullReferenceException

I have a very interesting problem on my LinqToSql model. On some of my tables i have a references to other tables and in LinqToSql this is represented by a EnitiyRef class, when you are trying to access the references table LinqToSql will load the reference from the database. On my development machine everything worked fine (the referen...