Using an ObservableCollection and need to filter its contents? A quick and easy way I found was to create and bind to a CollectionView to perform the filtering for you. Step 1 : Create the Observable Collection The first step is to create the observable collection. This will work for […]

Continus reading  

Ever need to check the status of a server, but through a port as well? I needed to as well recently, and came up with a quick, clean method to check the status of a server address and port. This will return a boolean, giving the status of whether the […]

Continus reading  

Need a quick way to save a byte array to file and read back? So did I, and thought I’d include this simple code snippet for anybody who needed it as well. Includes Code : Saving to File Note below, there are two additional options (besides the name) you can […]

Continus reading  

The┬áDecimal, Double, and Float variable types are very similar in the fact that they use a decimal in their value (Actually called the Radix Point), but are different in the way they store that value (Amount of bits reserved for the mantissa and exponent), and should be used in specific […]

Continus reading  

I don’t know how many times when I was debugging my application which had two databases communicating, I got the following error : Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries. […]

Continus reading  

I was deploying a build on a cloud test machine with its own SQL Server and data. I was testing a sync function (a mobile handheld grabbing information from a server) and got the following error. Unable to update the EntitySet ” because it has a DefiningQuery and no element […]

Continus reading  

Getting a Reflection Type Load Exception, and confused by the message or simply can’t figure out what the issue is? As Microsoft defines the exception as, “The exception that is thrown by the Module.GetTypes method if any of the classes in a module cannot be loaded…” which is pretty broad. After debugging […]

Continus reading  

Have you ever assigned a value to an IEnumerable from a database, then try to access in a foreach or something similar and get the following? “ObjectDisposedException was unhandled by user code : The ObjectContext instance has been disposed and can no longer be used for operations that require a […]

Continus reading  

When converting values in C#, we are given three options : Parse, Convert, and TryParse. My suggestion would be to use which method based on where the conversion is taking place. If you are validating user input, an int parse or a convert will allow you to give specific error […]

Continus reading  

You have multiple updates and want to implement transactions into your database updates in the Entity Framework? I had to do just that in C# , so I thought I’d share what I learn for to remember, and for you to learn. To do this, we must create a TransactionScope, […]

Continus reading  

I noticed that my code was not being reflected in the current build of my application. Then taking a closer look and setting a break point at the code that was not being ran, I hit F5 and noticed a bubble with a warning triangle that had the following message. […]

Continus reading  

I had spent a great while debugging an operation which returned a collection an entity object. However, I had a bug in my code and I could not find what was causing it. I was given the following message over, and over, and over. The socket connection was aborted. This […]

Continus reading  
%d bloggers like this: