.net

WinMM Library Issues

I wrote a WinMM library wrapper library that exposes WaveOut and WaveIn classes for the purpose of recording and playing raw audio streams. Everything works great, but in order to follow the operating system specs on how to handle the finished buffers, I added a thread that unprepares the buffers and frees the memory. I also got all of...

Visual Studio 2008 unit tests and nunit

When you right click on a method in a code file in Visual Studio 2008 you get this which creates the unit test skeleton for that method. Is there a way (by means of a template change or some nifty hack) by which I can change this to create unit tests based on Nunit rather than Visual Studio unit testing tools? Something like this… ...

What DB to use for a windows application?

I am developing a small windows application in .net. What DB should I use? DB Structure Table 1 : Not more than 3 fields : 50+ records (Add, Delete) Table 2 : Not more than 10 fields : 10-20 records (Add, Delete) I thought of using XMLDatabase but some say its not advisable to use it. What are the reasons for this? If it is OK to use...

When using ISerializable with DataContractSerializer, how do I stop the serializer from outputting type information?

To get more control over serialization, I have converted a class from [DataContract] to [Serializable], implementing both GetObjectData and the special deserializing constructor. When I do this, the XML emitted now has type information applied to all elements. I don't want this superfluous information, and I'm wondering how to inform t...

Possible causes of System.InvalidOperationException: internal connection without a proxy?

One of our apps gets this error fairly frequently, but we can't quite figure out why. It's a .NET 2.0 C# console app that loads data into an Oracle DB from Excel files. Here's the stack: System.InvalidOperationException: internal connection without a proxy? at System.Data.OracleClient.OracleInternalConnection.ProxyConnection() at...

Multiple audio outputs in .Net

I am looking to build a PC box that can play up to 16 audio files(mp3/wav) out to 16 analog devices(think of it as 16 sets of speakers). There will be a one to one relationship for audio file to analog output. The solution that is being presented to be hardware wise is to use multiple sound cards, so my question is, is there a library a...

Fade a color to white (increasing brightness)

I want to make a text box in .NET "glow" yellow, and then "fade" to white (basically, by incrementally increasing the brightness). I think Stackoverflow does this after you've posted an answer. I know that increasing brightness is not all that simple (it's not just uniformly increasing/decreasing RGB), but I'm not sure how to do this. P...

Why am I getting an error in C# when mixing explicit implementation and polymorphism?

I am getting this error: type Bar does not implement interface IFoo From this code: public interface IFoo { void DoA(); void DoB(); } public class Foo:IFoo { void IFoo.DoA() { } void IFoo.DoB() { } } public class Bar:Foo { void IFoo.DoA() { base.doA(); } voi...

smart paging with datagrid

Hi, How do I configure my datagrid to use paging such that it won't pull ALL the rows from the database, but rather only the rows for the current page. BTW, should I be using a datagrid still or is there a newer control? ...

What's the best way to produce a relative date range (This week, This year, Last month, etc) from a DateTime?

I'm sure I'm not the first person to need to do this, so I'm looking for the best way. I've got a set of radio buttons with choices such as This Year Last Year This Month Last Month This Week Last Week and I need to produce the proper relative date range from the current date (DateTime.Now). For example if Last Year was selected a...

document builder

I'm creating a program for new hires where i type in there name and some other info and it spits out a welcome/ new employee info document I seem to remember there was something along the lines of there being a document object that i could use (similar i guess to stringbuilder) but i cant find anything on it. does anyone know if ther...

How do you integrate Active Directory into a .NET app using DDD?

How are you integrating Active Directory objects (users, groups, etc) into your DDD .NET app? What do your repositories look like and how are you handling LDAP sessions, transactions, and unit of work? Note that I'm not talking about simple authentication/authorization scenarios but rather when the AD objects are part of the core domain ...

Setting Timeout Value For .NET Web Service

I have a web service written in C# that is living on a SharePoint site. I have modified the web.config with the following code: (configuration) (system.web) (httpRuntime executionTimeout="360" /) ... for the IIS Inetpub file, the SP ISAPI web.config file and the SP layouts web.config. I have also modified the machine.config file ...

SkinID on custom control not working (asp.net)

I am deriving a control from syste.web.ui.webcontrols.button. I am then calling it buttonv2. I am then adding an arbitrary property to this new class, "int abc", accessing it via a get/set accessor that stores it's value in the viewstate (it also returns 0 if the viewstate value is null, i.e. i've tried to access it without setting it)....

Best Way to Invoke Any Cross-Threaded Code?

I know that this question has been asked before, but I'm looking for a way to: streamline the creation of safe cross-threaded code. reuse this code in any situation (no Windows Forms references). Here's what I have so far, but I want to remove the Windows Forms references. Any ideas? public delegate void SafeInvokeDelegate(System.Ac...

Remove Single Quotes From All Cells in a DataTable - Creating New Table - Using LINQ in Vb.Net

I have a table with many values inside of it that might have single quotes around them. I need to create a duplicate table without those single quotes. I can't modify the original table as I need to use it, 'as-is' later. I've done this with a table.Clone and using a foreach to loop through the rows and columns removing single quotes ...

How can I call a .NET form from an MFC application?

We have a several large MFC applications which presently call a COM object to bring up a complex dialog. We would like to integrate the dialog into the applications -- we do not want to continue to use a COM object. I'm investigating the possibility of building the dialog in .NET as a separate project (using Windows forms, not WPF) and...

Parse Url Strings into Tree Hierarchy

I have a header table that has a list of web pages in it. Each record has a page URL field which I am looking to parse out into a hierarchy (TreeView). I am not sure of the best way to go about it and I am having a problem getting it to work. Here's an example of URLS: /file1.aspx /file2.aspx /aFolder/file.aspx /aFolder/file2.aspx /b...

How to understand if the static part of the text has been changed? (diff algorithm related)

First of all this is tough thing to solve, so far I didn't come up with a good example but I hope someone here will figure this out. I hope there is known way to solve these kind of problems, or an obscure algorithm. Scenario: In my application I do several requests to the very same webpage Webpage has dynamic and random content in it...

Is possible to build a custom control without an ASP.NET Server Control project?

I have a web application in Visual Studio 2008, and I have found an article explaining how to extend GridView creating an inherited class. If I create that class inside the same project, is possible to use my new grid? How? If it isn't possible, why? ...