.net

Unable to bind ID Property to the View,due to conflict with ID Property of System.Web.UI.Page in asp.net mvc.

While debugging into view i did a quick watch and i found that for "ID" its showing a GUID due to that i had to change the name of the property in my model as i had property by the name ID, i had problems when binding the value from the session to the textbox. Is there any other way besides changing the name of the property? ...

What other alternatives to log4net logging exist?

(subjective) I'm looking for what your using to perform logging in your application. This log4net thing is giving me headaches. Is there a better answer out there or is everone just homebrewing a solution? I know the System.Diagnostics.Trace subsystem is quite capable should I layer on this? ...

IE6 AJAX Response Data Issue

I've been looking all over and i can't find anything to fix this problem. IE6 only is having an issue with the response of an AJAX call and is erroring because of invalid data (alerting the data shows a single beauitful weird square) Locally IE6 works perfectly (same page and same data), i've checked and rechecked its calling the corre...

How to write cues/markers to a WAV file in .NET

I'd like write cues (i.e. time-based markers, not ID3-like tags) to a WAV file with C#. It seems that the free .NET audio libraries such as NAudio and Bass.NET don't support this. I've found the source of Cue Tools, but it's entirely undocumented and relatively complex. Any alternatives? ...

Receiving Invalid Data from Serial Port using SerialPort.ReadExisting()

I have written a program in .NET that listens to a particular Serial Port and processes the data that is being received. I wrote a test program using com0com (the Null-modem emulator) and my program was working fine. I even tested it with HyperTerminal and that seemed to work fine too. However when I interfaced the software with the orig...

i can't write to XML string containing path to file, c# Net 3.5

i got file which contains simple XML structure, to operate on xml i use classes bulit in framework 3.5, for string not containing backslashes everything works fine, but in case strings i try to write contain backslashes final file isn't saved to disk, no exception or any kind of error at all. No matter if i write it as parrameter or as v...

Stylus packets lost when using RealTimeStylus with WPF

I am using RealTimeStylus to get Ink data in a WPF application. This works fine until the window on which I collect the ink loses focus. When I draw on the window after that, the AsyncStylusPlugin does not receive Packets, StylusUp or StylusDown events, even if it get the focus again. The curious thing is that this problem only occurs o...

how to run some code in memory?

I have a compiler which compiles assembly language to machine language (in memory). My project is in c# .net. Is there any way to run the memory on a thread? How can DEP prevent it? byte[] a: 01010101 10111010 00111010 10101011 ... ...

ClickOnce configuration deployment

I'm deploing an applicaiton using ClickOnce, the problem is that the configuration file (xxx.exe.config) is not embedded in the package and there is no option to include it. Another problem with the config is that When I'm trying to manually write it to the directory where it is delopyed (Environment.CurrentDirectory) I'm getting an exce...

Which Dispatcher to use? The Window's or the Control's?

Up to now when I wanted to update an UI control from a non UI thread I used syntax like: Dispatcher.Invoke(DispatcherPriority.Normal, new Action(()=>Label1.Content="New Content")); Now I am reading some more about it I keep finding the following syntax: Label1.Dispatcher.Invoke(//same arguments; Is the latter bett...

What's the deal with dontEscape support in Uri? .NET 3.5

Documentation state that dontEscape is deprecated and always false. However it actually works. Is it a good idea to use it anyway, or is there any other alternative to send non RFC compliant Http requests? Sample Code: Dim U As New Uri("http://www.google.com/>", True) Dim W As New Net.WebClient() WL(W.DownloadString(U)) ...

MVC pattern with dynamic, tree stuctured data

I'm experimenting with this hybrid MVC pattern, though the question probably pertains to a range of patterns. It works great for many common situations. However, I now have a control that represents an arbitrary-depth tree similar to a file system. It's possible to turn each tree node on or off ("checked"). I'm stuck trying to figu...

Should I use different return types on overloaded methods?

Are there any best practices on returning different return types on overloaded methods? For instance if I have a Load method in my DAL, I either want to load a single item or a bunch of items. I know that I could use a number of approaches: Load one object MyBusinessObject LoadOne(int id) { } Load multiple objects MyBusinessObject...

How to set the Icon property in code? How to understand the way it is done in XAML?

When I choose an Icon for a wpf Window through the designer I get the following XAML: <Window Icon="/MyNameSpace;component/myIcon.ico"> Please explain this notation for me! Say I want to set the Icon in the code behind. How do I translate the XAML to C#? ...

Using integrated authentication with EWS (exchange web services)

I'm in the process of setting up a company intranet. One of the requests is to do some intregration with Exchange Server 2007. In my tests I can authenticate to EWS just fine using NetworkCredential, as long as I'm passing in my username and password. In our intranet, I'd like to pass on the credientials of the logged in user. We'll be ...

What is the equivalent to System.nanoTime() in .NET?

The title is pretty much self-explanatory, I'm killing myself over this simplicity. Looked here, but it isn't much helpful. ...

[.NET] How to talk to a database in a portable way?

I'd like to start an application that makes heavy use of a database, and is supposed to run on Windows under .NET as well as Mac/Linux under Mono. Having done some research, I've realised that neither LINQ-to-SQL nor LINQ-to-Entities are production-ready in Mono at the moment (here and here). According to the former link, LINQ-to-SQL ma...

Why is the Process class in the Diagnostics namespace?

Why is the Process class part of the Diagnostics namespace? This is a part of design of the BCL that kept me wondering for some time now. I find it kind of counter-intuitive, I fail to see the connection between Process and for instance the Debug and Trace classes. ...

Calling a store procedure with nHibernate

How do you call a stored procedure with nHibernate? Specifically there are two cases where I am using store procedures: to return a scalar value and to return a set of results mapped to entities. ...

Action<object, EventArgs> could not be casted to EventHandler?

I was wiring up an event to use a lambda which needed to remove itself after triggering. I couldn't do it by inlining the lambda to the += event (no accessable variable to use to remove the event) so i set up an Action<object, EventArgs> variable and moved the lambda there. The main error was that it could not convert an Action<object, E...