.net

Entity Framework - Is there a way to reorder properties in the EDMX designer?

I'm using Entity Framework's model designer to design the model for a new project. Adding properties is relatively easy, however they're always appended to the entity. Is there a way to reorder the properties once they've been added? This is quite annoying! ...

are dot net exceptions dependent on computer's locale

this is a bit of newbie question. if i'm running my dot net application on a server configured for english location, the dot net exceptions have english text. what happens when the server is configured for a different locale: such as french or russian? ...

C# - is there a way to flush the DNS cache from a C# WPF app? (on XP, Vista, Win7)

Hi, Is there a way to flush the DNS cache from a C# WPF app? The application would be running on either XP, Vista, or Windows 7. ...

Converting NUnit Test Project to MS Test

Hello, Has anyone tried to replace NUnit tests with MS Test, and would be willing to share any tips or points about the complexity? I was considering this, but I have a lot of tests, so outside of assembly/type switching/attribute replacement and all, any pointers? Thanks. ...

Visual Studio 2010 keeps changing my winforms control

I have an odd situation with a user control in VS 2010. The form designer keeps changing my entry and then telling me it does not exist! It compiles and runs the first time, and then if I change something unrelated, it gives me an error in the designer.cs file (Cannot resolve symbol SomeEntry). private SomeEntry someEntry; // ... this.s...

.NET ApplicationSettingsBase Should I call Upgrade() every time I load?

We have application settings derived from ApplicationSettingsBase. When we push a new version of our app we need to call // // Summary: // Updates application settings to reflect a more recent installation of the // application. public virtual void Upgrade(); (from the meta-data) now there are some tricky ways to de...

Issue with NotifyIcon.ShowBalloonTip, time interval

I've created notifyIcon object. But after I click button1 balloon seems to be shown infinitely, despite the fact that I've specified 1 millisecond (!!!) as interval. private void button1_Click(object sender, EventArgs e) { notifyIcon1.ShowBalloonTip(1); } What have I done wrong? UPD: i've found this: http://www.cs...

how to monitor/sniff local DNS lookups to the windows local DNS? (on XP, Vista, Win7)

Is there a way in .NET (for a WPF application running on XP, Vista, or Windows 7) to monitor/sniff DNS lookups that the application is making to local DNS? For example, is there a log file for a windows local DNS cache somewhere? (Background - parsing network packets doesn't seem to work as a DNS lookup may not have to be issued out...

Proper xml comments on .NET interface

if there is an interface and a class that implements it and you want to have the the xml comment on it to be used in VS intellisense or documentation where would you put the xml comment? on the interface's methods or on the concrete class methods? What is the correct way? My thoughts are to put it in the interface because we are declari...

difference between DateTime and DateTime2

Possible Duplicate: SQL Server datetime2 vs datetime What is the difference between DbType.DateTime and DbType.DateTime2 in .NET? If I am using DbType.Date and I want to change to a DateTime type should I use DateTime or DateTime2? ...

Silverlight Browser App to Desktop App

I saw this Silverlight application that works inside the browser but if you clicked Install it will be downloaded on your machine and runs as Desktop Application how this can be done !! http://os75.com/apps/Translator.html ...

Is there a table of the matching types for marshaling in P/Invoke & InterOP?

I am almost buried by how the different dialects of types are matched between .NET world and native world. Such as MFC CList and other stuffs. I am desperately hoping for this: Some kind of table or cheetsheet that lists all the mappings between types of .NET world and native world. A table that lists all the types that can be marshal...

System.Comparison<T> understanding

List<T>.Sort() method has 3 overloads. One of them is the following System.Collections.Generic.List<T>.Sort(System.Comparison<T>) On seeing Comparison<T>, I thought that it should be a class which is derived from Comparison<T> class. (An usual interpretation on the parameters) But the following works really well and said to be using...

how to create a null string?

I have two constructors MyObj(String s){ //first constructor ... if(s==null) s = somecode; this.s = s; ... } MyObj(): this(null) { } //second constructor In this way, if the empty constructor is called, it will redirect to the first constructor and initialise the value as determined by some code. However, now...

Thread Safe Publish Subscribe in .Net

I created a simple set of interfaces and a class that allow me to publish the additions and removals of items in a generic dictionary. Subscribers receive the entire list when they subscribe and after that, they get only the changes. Although my solutions work, I am looking for something a little more standard, a little less home-grown....

.NET MVC Linq -> XML RSS reader : Twitter XML Parsing Error

It seems like no matter what I do, I cannt get my twitter RSS feed to show up on my view. I'm not getting any errors, and the RSS feed loads correctly, I just can't grab the Model's information... Here's my ViewModel namespace MvcMusicStore.ViewModels { public class HomeRssFeedViewModel { public IEnumerable<TwitterPosts...

Why NHibernate auto-truncates instead of throwing an exception on save?

Hi, I have been studying the Summer Of NHibernate Tutorials and when I have reached the Session 04: Exploring Transactions and Concurrency -just like in the tutorial- I wanted to create a SAVE test which should fail because of an invalid object. The purpose is to test if it can rollback the transaction properly. Idea is to create an i...

Extending classes and overriding properties in a C# .NET constructor

I'm a PHP programmer by default, and I need a little help with a C# .NET (Micro Frameworks, but that doesn't matter here) project. Basically, I have a class that allows for control of an RC car or airplane speed controller. The class is already written, but I need a way to import settings into the class, since diffident electric speed ...

export multiple (same) dbs and import into one automatically

I need to write a program or script which a client can run to do the following. I have an application which runs offline on multiple computers which is exactly the same but the data will differ. Let's call this SourceDB. Therefore, there is SourceDB1, SourceDB2, and SourceDB3. Then there is a server which hosts the main application whic...

Testing ProcessStartInfo processes execution

Let's assume I have some method that executes CLI application. For example: public string SomeMethod(string cmd) { var p = new ProcessStartInfo(cmd); // processing execution results return result; } How can I change this method to make it testable? I see that I can split that method into 2: 1. Executes CLI app and passes ...