.net

Unsubscribe to child object prop changed events

Say I have a object Client that has a child StatusType object. Both implement INotifyPropertyChanged. The Client subscribes to the prop changed event in the property after checking for null and making sure value is different public StatusType Status { get { return _status ?? (_status = this.GetNewStatusType()); } set { ...

How do I pull data from my old server to my SQL server?

I want to write a code that transfers data from on server to my SQL Server. Before I put the data in, I want to delete the current data. Then put the data from one to the other. How do I do that. This is snippets from the code I have so far. string SQL = ConfigurationManager.ConnectionStrings["SQLServer"].ToString(); string OLD = Co...

Standard .Net TDD Memory Test

Is it useful to write a standardised TDD [Test] method that would expose common memory issues ? The set of tests could be easily, quickly applied to a method and would red-fail 'classic' .NET memory issues but would green-pass the classic solutions. For example common memory issues could be : too much relocation by the garbage collec...

Is it bad practice to use LINQ to loop over and perform actions rather than just select data?

Big Subjective Question: I often find myself using LINQ to filter a set of objects and then, after the query, doing an old fashion foreach to perform an action on each of the results. Is there a good way of combining these two tasks such that an action is performed on each object that matches the Where() predicate? Almost like passing an...

ASP.NET MasterPage + Javascript Error

After converting an ASP.NET webform (v3.5) to use a master page, I started getting a strange Javascript error. The content page has a block of javascript. Here it is: <script type="text/javascript"> var attCount = 0; function CreateAttachmentControl() { var newAtt = document.createElement('span'); var newAttN...

Is there Java CAPS equivalent from .NET

I am looking for an integration framework for building and managing SOA composite applications consist of exposing web services, calling 3rd party web services, performing business logic and invoking database. It is similar to Sun Java Composite Application Platform Suite (Java CAPS). ...

The EnforceConstraints property doesn't seem to work?

My boss has asked me to disable constraints for the dataset layer of our application. Seemed easy enough to me, since the .XSDs had the EnforceConstraints boolean. However, after turning that off I'm still getting the "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."...

WPF: How to implement Drag and Drop with nested (hierarchical) controls

Using WPF I've succeeded at implementing drag and drop to rearrange items within a list(view or box) and also to drag and drop items between lists. Now I am trying figure out how to implement drag and drop with NESTED lists. For instance I have a listview containing projects and each project item contains another listview of tasks. I ...

Asynchronous TCP Communication in .NET

Quick question here: is there any obvious benefit to use asynchronous communication with the NetworkStream class (generated by TcpClient), i.e. the BeginRead/BeginWrite methods rather than running a separate thread and using synchronous operations on that, i.e. Read/Write? My impression has been (it could easily be quite wrong) that the ...

.net compact framework accessing audio metadata

Are there any libraries which exist for accessing audio (mp3 wmw) metadata using the .net compact framework? ...

How do you build a Visual Studio like UI?

I'm looking to build a .Net application that has a UI similar to that of Visual Studio. Is there a name for that paradigm? Or does anyone know of a tutorial to do so...or even an OSS project that utilizes that paradigm? I'm looking for like the docking aspects and the interaction between panels... 99% of my experience is in the web s...

Should I wait to buy Resharper until VS 2010 is released?

I have used up my 30 day trial and want to buy Resharper now. But, I'm poor and $150 is a lot for me to handle right now. Is anything in VS 2010 going to make buying Resharper now a mistake? I heard that VS 2010 is like VS 2008 + Resharper. I find it hard to believe but wanted to ask SO before spending my money. Thanks! Result: ...

Automatic Cookie Handling C#/.NET HttpWebRequest+HttpWebResponse

Is there any way to automatically handle cookies in .NET with the HttpWebRequest/HttpWebResponse objects? I'm preferably looking for an equivalent to LWP::UserAgent and its behaviour (perl), only in a .NET environment. Any suggestions or advise? Thanks in advanced. ...

Is there a .Net attribute to prevent property evaluation within the debugger?

I've seen several classes in the framework with this behavior (a refresh symbol in the watch window, and a warning). Is this controlled by an Attribute? If so, how can I emulate this in my library? EDIT: Thanks for the info! To clarify, I am developing a framework with properties that must access data from a single thread. Unfortunately...

Passing ViewData to ViewPage in ASP.NET MVC

Hello, I'm trying to build a custom control in ASP.NET MVC. The thing that I want to avoid is mixing the view (html) and the code (C#) in these controls. After hours of googling and struggling with this problem I've finally thought of creating helper methods that use the ASP view Engine thought the ViewPage class. I'm able to create a...

Using MySQL Connector/NET with VS2008 Crystal Reports Basic

I'm having difficulty getting crystal report to load data from a MySQL DB. I am using the Connector/NET and have a DataSet in the project which can access the data just fine. I am able to set the report data source to a DataTable from the DataSet. Crystal reports seems to know all about the column information, as I can create fields etc....

Does the book Programming WPF has insufficient XAML coverage?

I am about to buy Programming WPF, but am undecided after reading this. Can anyone who has read this book tell me if it has insufficient XAML coverage. In fact one of the reviewers at Amazon mentioned that the following topics are not covered. dynamic data binding how to create an app start to finish using expression and all of the ...

C# .NET single-user database options

I'm going to be writing a Windows application using the .NET framework and C#. The application will need to store relational data which will be quieried, joined and processed. Previously I've done this using SQL Server, but that is a total overkill for the application I am now making. What's the simplest, easiest way to store relationa...

C# Scaling UserControl content to match users Dpi/Font Size

How do I get my OwnerDrawn UserControl to respect the users dpi (96/120/xxx) and/or font-size (normal, large, extra large)? Some people suggest to use the DpiX and DpiY properties on a Graphics object, but that doesn't seem to to anything in my control (i.e. they are always set to 96, regardless of which font-size or dpi I choose). The...

How to elevate privileges only when required?

This question applies to Windows Vista! I have an application which normally works without administrative privileges. There is one activity which does need administrative privilege but I don't want to start the application itself with higher privileges when I know most of time user wont even be using that feature. I am thinking about c...