.net

What rules govern cross-version compatibility for .NET applications and the C# language?

For some reason I've always had trouble remembering the backwards/forwards compatibility guarantees made by the framework, so I'd like to put that to bed forever. Suppose I have two assemblies, A and B. A is older and references .NET 2.0 assemblies; B references .NET 3.5 assemblies. I have the source for A and B, Ax and Bx, respectively...

Send mail using RTF text as Body

Hi, I'm trying to create a mail message using some RTF text as the mail.body, but there's no IsRtfBody property on System.Net.Mail.MailMessage only IsHtmlBody. The test-mails I've received all contain {\rtf1\deff0{\fonttbl{\f0 Times New Roman;}{\f1 Verdana;}}{\colortbl\red0\green0\blue0 ;\red0\green0\blue255 ;}{\*\listoverridetable}{\...

How to access controls' private properties on another form?

I am trying to access the controls' properties on another form without having to modify the code of the other projec (the one containing the controls that I want to access) because it is already compiled as a DLL. In this DLL that I am trying to access, the functions/sub-procedures are all declared as private. Would there be any way of a...

When (deep) Cloning, use String.Copy or str1 = str2?

When (deep) Cloning a custom object, should I use clone.str1 = String.Copy(obj.str1) or clone.str1 = obj.str1? I'd prefer the latter - shorter and quicker, but is it "safe"? I'd point to this thread, but, however, not sure what to use. ...

.NET RDLC Report Matrices

I'm having a terrible time managing RDLC reports. I couldn't find any comprehensive tutorials in the internet and MSDN isn't as helpful as I wish it could have been either. Particularly, I've been having a problem trying to get a particular table/matrix to appear based on a client's requirement. It goes like this. In the DB I have two ...

clr.CompileModules(...) "couldn't find member CompileModules"

Visual Studio 2008 SP1 installed, asp.net ironpython website import clr #ok clr.AddReference('System') #ok but clr.CompileModules(...) "couldn't find member CompileModules" Anyone got this? The member CompileModules is supposed to exist, at least in some versions, to do something like this clr.CompileModules("f...

How can I strip html tags in C#

Possible Duplicate: How to clean HTML tags using C# What is the best way to strip HTML tags in C#? ...

question about System.Windows.Forms.Timer

Hi All I am building a WinForms application reading from a socket data and charting lines. I am using System.Windows.Forms.Timer to trigger each second the event that gets data from a queue filled by a socket redraws lines on the chart My Question is about the Timer object: I have one Timer object for each WinForm having a chart to ...

What is the best practice for using .NET Properties?

I am a little confused about how much I SHOULD do with properties. I have heard that properties should always represent a logical property of the class. Get and Set should almost never throw exceptions with the exception of ArgumentOutOfRange. Is that true? Is the following example totally wrong? public bool DeviceRegistered { get{ ...

.NET portal web clipping/web connector/portlet bridge/web capture analogs

Greetings, We are seeking .Net analogs or ports of what they refer to as "Web Connector" in Vignette, "Web Clipping" in WebSphere, "Web Capture Web Part" in Sharepoint (could not evaluate myself) or PortletBridge http://www.portletbridge.org/features.html. The implementation itself does not seem to be extremely sophisticated thus porti...

How to have multiple selectable options property listed in Properties Window? - .NET

I have a UserControl with a property called "Type". This can have any combination of three values, say One Two Three How do I do this? This is more like the anchor property for controls in WinForms. ...

Does a SafeFileHandle change between Open Close and Reopen?

I am using a SafeFileHandle to talk to USB devices. If I close a Handle and then reopen a handle to the same device (assuming is has not been removed and reattached/enumerated) will the first and second handles necessarily be exactly the same? Or is a handle like an instance thing that can be different every time it's opened? ...

Are Rollbacks possible with Active Directory?

I have read a few articles about how to programmatically interacting with Active Directory. One question remains though, is it possible to rollback a transaction of some sort with Active Directory? I have read that it is not possible in a context which you have several domain controllers as they seem to update each other with an update ...

Using MTOM on Mono

Looking to port an ASMX web service application to run on Mono under Apache. The web services use WSE 3.0 to add MTOM capability for messages that contain binary. From my research so far, I understand this to be the current state of web services on Mono: ASMX is fully implemented (but does not support MTOM) WSE (which I am using for ...

Calling Thread.Abort on a thread from a ThreadPool

My co-worker is using a third-party .NET library for which we don't have the source code. We're using a ThreadPool to have a lot of threads call into this library, and occasionally one of the threads will just hang forever while the rest of them merrily chug along. So we want to use the dreaded Thread.Abort to kill such threads. I've ...

Can nunit be configured to drop the app domain per fixture (or per test)

In testing singleton classes we need the single instance to "go away" after each test. Is there a way to configure nunit to recreate the test app domain after each test, or at least after each fixture? ...

Help with quering SQL Server

I am planning for monitoring application which will use SQL 2005/08 database. It will monitor old server(s) which are using SQL 2000 db. Tools task is to pick the data from the servers do some statistics and insert the data back into tools own database for reporting purpose. I am using .NET(C#) as development environment. What i would ...

How does datagridview handle "Master / Detail"?

In .net objects like DataTable when you have two grids(Master and Detail) and add a row to the second one(Detail), The new row will have the Foreign-Key Values automatically. How can i do it(I don't use DataTables because they suck)? thanks. ...

System.Security.SecurityException

I'm developing a web application with VS2008 and NHibernate and I cannot access my database (MSSQL Server 2005). Here is my stack trace [SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Se...

NHibernate + Mappings + Domain Model = Over-engineering?

Background I really like Fluent NHibernate - it's pretty great. I don't have to write those mundane CRUD-based SQL stored procedures and that's great (not that there's anything wrong with that)! I've gone down this path a bit on an application we're working on. And now I'm sitting with a couple dozen domain objects, each with a reposit...