.net

MAPI and managed code experiences?

Using MAPI functions from within managed code is officially unsupported. Apparently, MAPI uses its own memory management and it crashes and burns within managed code (see here and here) All I want to do is launch the default e-mail client with subject, body, AND one or more attachments. So I've been looking into MAPISendDocuments and ...

C#.Net Prototype Methods

How can I make prototype methods in C#.Net? In JavaScript, I can do the following to create a trim method for the string object: String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,"");} How can I go about doing this in C#.Net...

Should the folders in a solution match the namespace?

Should the folders in a solution match the namespace? In one of my teams projects, we have a class library that has many sub-folders in the project. Project Name and Namespace: MyCompany.Project.Section Within this project, there are several folders that match the namespace section: - Folder Vehicles has classes in the MyCompany.Proje...

How do you resolve a domain name to an IP address with .NET/C#?

How do you resolve a domain name to an IP address with .NET/C#?...

How to make a button appear as if it is pressed?

Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button look "pressed"? Imagine this button is an on/off switch. ToolStripButton has the Checked property, but the regular Button does not....

How to reference to multiple version assembly

I'm developing a Sharepoint application and use .NET AjaxControlToolkit library, we are adding a custom aspx page to the Sharepoint. Sharepoint 2007 run in quirks mode so I've made some modification to the AJAX library to make it behave like it normally should. The problem is, the other team already use AJAX library and it is a different...

.NET Remoting Speed and VPNs

I'm working on a project which uses .NET Remoting for communication between the client application and an object server. For development, the client, server, and MSSQL database are all running on my local development machine. When I'm working at the office, the responsiveness is just fine. However, when I work from home the speed is ...

How do you persist a tree structure to a database table with auto incrementing IDs using an ADO.NET DataSet and a DataAdapter

I have a self-referential Role table that represents a tree structure ID [INT] AUTO INCREMENT Name [VARCHAR] ParentID [INT] I am using an ADO.NET DataTable and DataAdapter to load and save values to this table. This works if I only create children of existing rows. If I make a child row, then make a child of that child, then Update, ...

Best ajax library for Sharepoint

For developing Windows Sharepoint Service application, what is the best ajax library available now? I'm thinking of free, customizable, and easy deployment, and its compatible with sharepoint, meaning it can run in 'quirks' mode....

Is there a lightweight, preferable open source, formatable label control for dotnet?

I have been looking for a way to utilize a simple markup language, or just plain html, when displaying text in WinForm applications. I would like to avoid embedding a webbrowser control since in most of the case I just want to highlight a single word or two in a sentence. I have looked at using a RTFControl but I believe it's a bit hea...

What is a good plotting library for .Net?

I'm writing some data acquisition software and need a gui plotting library that is fast enough to do realtime updated graphs. I've been using Nplot which is pretty good for a free library, but I'm wondering if there are any better libraries (preferably free or cheap)....

C# WCF Service - Backward compatibility issue

I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a basicHttpBinding endpoint (which I believe is required for...

Should I provide accessor methods / Getter Setters for public/protected components on a form?

If I have .Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level variable. Now, if I were providing a public variable of an int or string type etc. in my form class I wouldn't think twice about using...

What is the best way to store connection string in .NET DLLs?

The application my team is currently developing has a DLL that is used to perform all database access. The application can not use a trusted connection because the database is behind a firewall and the domain server is not. So it appears that the connection string needs to have a DB username and password. The DLL currently has the dat...

Regular expression for parsing links from a webpage?

I'm looking for a .NET regular expression extract all the URLs from a webpage but haven't found one to be comprehensive enough to cover all the different ways you can specify a link. And a side question: Is there 'one regex to rule them all'? Or am I better off using a series of less complicated regular expressions and just using mutlip...

How do I make event callbacks into my win forms thread safe?

When you subscribe to an event on an object from within a form, you are essentially handing over control of your callback method to the event source. You have no idea whether that event source will choose to trigger the event on a different thread. The problem is that when the callback is invoked, you cannot assume that you can make upd...

Experiences of the Smart Client Software Factory

Has anyone had any experience in building a 'real world' application with the Smart Client Software Factory, from Microsofts Patterns and Practices group? I'm looking for advice on how difficult it was to master, whether it decreased your time to market and any other general pitfalls....

E-mail Notifications

In a .net system I'm building, there is a need for automated e-mail notifications. These should be editable by an admin. What's the easiest way to do this? SQL table and WYSIWIG for editing? ...

VS 2008 - Objects disappearing?

I've only been using VS 2008 Team Foundation for a few weeks. Over the last few days, I've noticed that sometimes one of my objects/controls on my page just disappears from intellisense. The project builds perfectly and the objects are still in the HTML, but I still can't find the object. Any one else notice this? Edit: For what it's ...

Why is Array.Length an int, and not an uint

Why is Array.Length an int, and not an uint. This bothers me (just a bit), because a length value can never by negative. This also forced me to use an int for a length-property on my own class, because when you specify an int-value, this needs to be cast explicity... So the ultimate question is: is there any use for an unsigned int (...