Posts in Category: data

Dynamics365 is Not a Database

Yes, it has a database, more than one to be correct and it has this very cool and fancy thing called CDS which is equally awesome.

But it’s not a database.

Which right now is reminding me of this…

Image result for its not a tumour

As you embark on your next DTS (Digital Transformation Services) project and you decide to move to this new platform, it’s important to remember this concept.

It’s Not a Database.

Even though you can configure it with entities (that look an awful lot like tables) and you can create relationships (that look an awful lot like foreign keys) that have attributes (that look an awful lot like columns).

It’s Not a Database.

Hiring a Database Architect to develop a schema for you in Dynamics will not be as efficient

Read More


Eliminate Lazy Error Handling

Here is an error I received the other day…

“Authentication Failure”

Here is another…

“Format of the initialization string does not conform to specification starting at index 0, without any typo in connectionString”

And finally my favourite…

“The entity cannot be updated because it is read-only.”

They are all from different applications and implementations and have been my life for the past two days as I tried to figure them out and wasted an insane amount of time trying to figure out what they related to and what I had to do to resolve them.

Here were the resolutions (in order)…

“Multi-Factor authentication is not supported here.”

“You need to enter the string in a special way, but we won’t tell you how.”

“It’s not that the entity was read-only, it’s that a function was trying to modify it while

Read More


Connecting to Azure Db via Code

Getting started with a new platform can be a little daunting, after all, there is so much to learn and where do you start.

From a client-side perspective, the only difference in connecting to an Azure Db over a server Db is the connection string.

string connectionstring = "Server=tcp:#SERVER#,1433;Initial Catalog=Signal;PersistSecurityInfo=False;User ID=#USERNAME#;Password=#PASSWORD#;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30";

SqlConnection cn = new SqlConnection();
cn.ConnectionString = connectionstring;

cn.Open();

From there, it’s a simple job of opening a connection, creating a command and querying your data.

The biggest problem I ran into was having to create the firewall rule to allow access (this will not be enabled by default).  Thankfully Visual Studio took care of this, giving me the prompt to do so and quickly enable.

firewall.png

Read More


Creating you First Azure Database

If you’re still creating databases locally for all your development and testing needs, it’s time to give yourself the kick you need to start doing things a little differently and learn something new in the process.

Going to Azure isn’t as complicated as you think (if you start small).  If you’re worried about costs, there are tons of credits floating around to make the learning cycle quick and painless.

First, setup a Resource Group, for a listing of all Azure related terminology, check here.  When you’re done doing this, navigate down to SQL Databases and create a database server (a URL) and whatever associated database you want to go along with it.

In my portal view, this looks a little like this where I now have a server and a database.

Read More


Dynamics365 Alternate Keys and UpSert

Using Alternate keys is an easy way to stop doing pre and post checks for whether you can insert data into Dynamics.

Before you had to do a check behind the scenes for whether an “Id” existed and if not go and insert it.

Now using the “Upsert” pattern in Dynamics, you can accomplish this task in one method call using an alternate key.

At’s it’s most simplest implementation, I created a custom entity and a field (wholenumber) that I then declared as my alternate key.

altdesign.PNG

Then I wrote the following code to insert the following record into my system.  You can

Read More