.net

How not persist property EF4 code first?

How do I make non persisted properties using codefirst EF4? MS says there is a StoreIgnore Attribute, but I cannot find it. http://blogs.msdn.com/b/efdesign/archive/2010/03/30/data-annotations-in-the-entity-framework-and-code-first.aspx Is there a way to set this up using EntityConfiguration? ...

Entity Framework 4: Eager Loading (Include) with filters using Self Tracking Entities

I have a solution where I have created self tracking entities using the RTM templates. I have split the entities and context between 2 projects so that I can reuse the type definitions as I plan to run client/server via WCF. One of my service methods is required to return a graph of "Product" objects with child objects of "ProductSku" a...

Multiple keyboard hooks in .NET and Delphi

Hi, I have an application with both .NET and Delphi components I register to a keyboard hook (with SetWindowsHookEx) in both components. I first register in .NET, and later in Delphi. The problem is, the hook delegate in Delphi is called before the hook delegate in .NET. According to MSDN, the hook chain is just a list, and as I under...

Does EF update objects just because a property changes or only if it has a different value?

I have an import, from flat file to an EDM against SQL Server, where very few records actually change (running it the umpteenth time with the same import file), but nonetheless the SaveChanges call to update 500 records takes quite long. I'm guessing this is because I set each property on the entity object, and EF then uses ReportProper...

Meh, C# SortedList has no .Find

Silly if you ask me. But this message is here because I will assume (probably correctly) that I am the silly one, not Microsoft. So... is there something I'm missing? Why didn't they include a "Find" method to this baby? The find could work on the Values, which are objects, so then I could do this: someObject = SortedList.Values.Find(or...

How map objects to a view with EF 4 code first?

How can you map an entity to a database view with EF 4 code first? Is there a way to do this by deriving from the EntityConfiguration classes? ...

how to start with windows API in .net

I want to work on windows API. I have an interest in creating network application that can communicate with web as well. I haven't thought any application yet. But before doing all this . I want to know where to start with. What all I need to start reading. I have created lot of database interactive applications with window forms. But w...

Adding background image to MDI form

Hi I would like to request people to give me inputs on how to show a background image in a winforms MDI Application. I understand that it is possible through the MDI form. Any inputs on how to go about it would be welcome. Thanks so much Regards bornagaindeveloper ...

How to get a unique object reference as a string for items in a list

I'm working on a .NET phone application where I have a list of items in memory that are displayed to the user. When the user clicks on an item in the user interface, they'll be brought to the "details" view for that item in a second view. I'm currently using an identity property in my class to reference unique items in the list, but I'...

Why are some open source projects (eg. NHibernate/Mono) reluctant to apply patches that fix blocking issues?

Hi everyone, I encountered a very embarassing problem yesterday. My particular experience is with NHibernate and Mono, but I see similar cases involving other projects everywhere. While everyone seems to claim that NHibernate is working on Mono, I must admit that I actually tried yesterday, and the 3.0 trunk doesn't work. To me, this i...

Convert non-English text into readable format

Hi, I am obtaining strings from the web which often contain accented characters not recognised from within my application. Edit - I'm obtaining my string using the HtmlAgilityPack. I am taking the InnerText of a <title> tag. Whilst doing this the Pack uses a different encoding from the original HTML document (I'm not sure which ones th...

Technology for a reliable, persistent stack

Trying a mental reset here: I tried to create a reliable, persistent stack with MSMQ, didn't work So in more general terms: I have producer (a webservice, so multithreaded although "only one") / consumer (multiple processes, as many as needed) setup. The key problems are - The data needs to be consumed/processed in LIFO order (~> stack...

Logging to files or to event viewer?

Hi, I was wondering what is the 'correct' way to log information messages; to files, or to a special log in the event viewer? I like logging to files since I can use rolling flat file listener and see fresh new log from each day, plus in the event viewer I can only see one message at a time - where in a file I can scan through the day m...

Socket Exception when connecting to Analysis Services Locally

I keep getting this error when trying to connect to an Analysis Services on the same machine the service is running on. If I connect via my desktop I don't see this error. I did quite a bit of googling, haven't found any solutions yet. When connecting from my desktop I am authenticated over a VPN. I get the feeling this error has somet...

Backgroundworker thread causing UI to hang

I have a background worker that's checking the status of four services on a remote server. This is setup on a timer (5 Seconds) as below. For some reason it's hanging the UI thread causing the application to 'lock' for a second each tick, I cannot work out why?! Private Sub ServiceTimer_Tick(ByVal sender As System.Object, ByVal e As Sys...

richtextbox text range attributes -- protected, hidden, backcolor, etc -- can i set them without selecting a range?

i want to be able to protect, hide, and highlight different ranges of text within a richtextbox without actually selecting the text -- which is what you seem to have to do for the SelectionProtected and SelectionBackColor or w/e properties. how can i do this programatically? I looked around in reflection and found the SetCharFormat met...

How to implement OAuth2 provider and consumer in C# .NET

I have been doing a bit of searching around on oauth2 and think it may be a good fit for some WCF rest services I am building out that will be consumed by some WPF apps and MVC web apps. The idea would be that the user is initially asked to login with their username / password and receives an access token which gives them access to the a...

Updating local SQL Server databases with ClickOnce Deployment

I'm building an application which will use some settings and a local SQL Server. My question is, when it comes time to update the application; will the settings or data be overwritten? What happens if I want to change some tables around in the future? ...

Can a socket be closed on local end without Close being called?

I'm having a problem where a socket appears to be closing by itself. Here's the (edited) network diagnostic trace: Exiting Socket#62696216::BeginSend() Exiting Socket#62696216::EndSend() Socket#62696216::BeginSend() Exception in the Socket#62696216::BeginSend - An established connection was aborted by the software in your host machi...

Does EF have ordered collections? The equvilant of list in the NHiberante Bag Vs Set Vs List world

Does the Entity Framework 4 have ordered collections? For example my Order has a property that is a collection of OrderItems, but the order is important and I would rather not sort them before I access them. See Nhibernate for an example: http://stackoverflow.com/questions/1916350/set-bag-and-list-set-in-nhibernate ...