.net

Using relative URI as XmlDataProvider's Source

Is it possible to use a relative URI when setting the Source property on an XmlDataProvider object in .NET? I get the following exception: IOException:System.IO.IOException: Cannot locate resource 'configuration.xml'. When I set the Source property using an absolute URI, everything works as expected: provider.Source = new Uri(@"C:\bi...

Temporarily lock folder from reading with ASP.NET

I am working on an indexing/searching feature of a site. The indexing runs every 6 hours and takes about 2 minutes. What is the best approach to forbid the reading from the indexes folder during these 2 minutes? ...

vb.net active directory question - rename user account and mailbox

I'm trying to rename a user programically and can't figure out the mailbox piece(proxyAddresses). Any help is appreciated... Working code below... Public Shared Function renameUser(ByVal curUsername As String, ByVal newUsername As String) As Boolean Dim emailSuffix As String = "@here.com" Dim userPrincipalSuffix As String = "@...

Export a C# List of Lists to Excel

Using C#, is there a direct way to export a List of Lists (i.e., List<List<T>>) to Excel 2003? I am parsing out large text files and exporting to Excel. Writing one cell at a time creates way too much overhead. I chose to use List<T> so that I would not have to worry about specifying the number of rows or columns. Currently, I wait unt...

How do I use eventhandler from baseclass

Is it possible for me to use ChangeHappend in my derived class. If so how? If not, what should I do instead? class Base { public delegate void ChangeHandler(object sender); public event ChangeHandler ChangeHappend; private int _foo; public int Foo { set { if (_foo == value) return; ...

Linq to Entities averages within a predefined grouping

I have used linq to entities to basically create an anonymous type with properties bookId and rating which I have grouped by bookId. all I need to do is take this and form an anonymous type which groups by bookId and gives the average rating for this bookid so anonymous type results currently looklike: bookid = 1, rating = 2 bookid...

visual studio 2008 not responding when checking out items from source safe

i have an interesting problem. whenever i try to checkout items from source safe through VS 08 interface, the app stops responding. a weird thing is, i can check out project items from the business layer but not the web site items from the web layer. i'm having to manually check them in/out from source safe. i know this isn't much info, ...

Serial Port Cable Unplugged

In .Net's SerialPort object, is there a way to determine if a serial port gets unplugged or plugged in. ...

Why the performance difference between C# (quite a bit slower) and Win32/C?

We are looking to migrate a performance critical application to .Net and find that the c# version is 30% to 100% slower than the Win32/C depending on the processor (difference more marked on mobile T7200 processor). I have a very simple sample of code that demonstrates this. For brevity I shall just show the C version - the c# is a direc...

can I get php to run in an asp.net page?

I'm trying to allow my php pages to run inside a content page of the master page. I'd like to run php somehow inside a master page. Besides frames is there another way? I've read you can use a frame, but would prefer not to. If I have to go with frames to get it done, should I be using an asp.net frame class of some sort or the raw html...

What happened to the context menu in my console application?

Was creating a simple console application to do some prototyping and was shocked to see that the right-click/context menu is missing from a standard .NET console app! I'm unable to find any information about this, and intellisense isn't helping. So what happened to it? Can I get it back? And if not, how can I configure my console app...

internationalisation library for ASP.NET applications

I am writing a web app in ASP.NET (2.0), VS2005. The main reason for developing a new application (rather than using readily-available off-the-shelf solutions) is that I need full support for at least two languages (that is front-end and the data). I am looking for the best ways of tackling i18n in ASP.NET (it can be just the UI, sorting...

Problems with custom deserialization of a list in C#

I'm writing a custom deserializer that will deserialize a list by deserializing each of the individual objects in the collection and then putting it together. Basically my code looks like this: //myField is a FieldInfo that represents the field we want to put the data in //resultObject is the object we want the data to go into List<Ob...

WPF, BitmapFrames & cross-threading question

Hello, I have some BitmapFrames created on a thread other than the main UI thread; Sometime after they are created (and their creator thread finishes), I am trying to use them in the main thread, as sources to some Image controls. BUT I am getting this InvalidOperationException: The calling thread cannot access this object because a...

Pipeline pattern for message processing

I have a set of services (non-WCF) that sit on queues. When message arrives, typical service does some calculations and spits out zero or more result messages to its output queue. Besides its primary function, each service has some housekeeping logic like auth / audit / logging / status tracking with exact steps and sequencing varying so...

Locking and multi threading in dotNet

I have multiple threads who all need to write to the same Dictionary. I have a lock on an object that I maintain in order to make sure only 1 thread is updating the dictionary at once. My question is as follows. If one thread tries to update the dictionary while another has a lock, will the thread just know to wait? Will it just fail? If...

Why does XSD validation always work for this file?

The following xml file always seems to validate. Not sure why, but when I remove the following ' xmlns="urn:schemas-microsoft-com:office:spreadsheet" ', it seems to throw a validation error as expected. Somehow MS is preventing validation with the added XSD office schema. So anytime that XSD Schema is included you can't validate XML usi...

MathML or OMML to PNG w/ .NET?

Are there any libraries which take MathML (or, even more preferably, OMML) and outputs a .PNG file? I am putting together an export process for .docx files and, as a part of this process, I'd like to extract equations and render them as .PNG files. Word 2007 does this natively when you save a document for the web, but so far, I have no...

C# Shell - IO redirection

I am writing a replacement Windows shell in C#, and the feature I am currently implementing is having all IO inside the same shell window - ie, not opening cmd.exe in another window. Right now, I have a partial solution to output. This is my code (where p is the running Process): while ( !p.HasExited ) { /* ... - irrelevant */ ...

Third-Party Oracle Providers for .Net with object type support

I'm looking for a third-party Oracle Data Provider for .Net (ADO.NET) with a full support of Oracle object types (like geometries). I was foolish enough to use ODP.NET and now I'm paying the price - it's incredibly buggy and I just reached the end of the line (keep crashing IIS Pool - known issue, no resolution). I found dotConnect which...