Category Archives: C# Development

ADO.NET EF – Delete a record

A nice simple bit of code to delete a record from a table

Posted in C# Development | Comments Off on ADO.NET EF – Delete a record

ADO.NET Insert or Update

This bit of code is great for inserting a record if it does not exist or update the one that does exist in the table.

Posted in C# Development | Comments Off on ADO.NET Insert or Update

LINQ Queries: handling nulls

Quite often when querying databases using data from text boxes, you can run into problems dealing with a blank string and fields containing a null. A field in a table may contain a null which could also mean a blank … Continue reading

Posted in C# Development | Comments Off on LINQ Queries: handling nulls

Left Outer Join LINQ Query

Here is a good example for creating a left outer join in LINQ for entities;

  If you need to perform other queries to get extra data for your main query list, first perform your main query first and … Continue reading

Posted in C# Development | Comments Off on Left Outer Join LINQ Query

Serialize a List to XML

Here is a very good simple way to convert a list of objects to XML. First, create a class for your list of objects. This class could be declared next to your routine if it is just to capture query … Continue reading

Posted in C# Development | Comments Off on Serialize a List to XML

AX BC – Another Example for Reading Records

 

Posted in C# Development | Comments Off on AX BC – Another Example for Reading Records

AX BC – Insert Records

 

Posted in C# Development | Comments Off on AX BC – Insert Records

AX BC – Call a Static Method

 

Another good example for finding a record ID by calling the standing find method from a table

And another…

 

Posted in C# Development | Comments Off on AX BC – Call a Static Method

Dynamically handling lists of objects

  The following code shows how to create a list of different objects and handle there properties and methods. This example deals with a list of services. Create your object classes and add them to your list like this;

Continue reading

Posted in C# Development | Comments Off on Dynamically handling lists of objects

Enum Declaration

Simple enum declaration

Posted in C# Development | Comments Off on Enum Declaration