Learning Azure SQL

Recently I decided that I wanted to stretch myself by learning some new technologies. The “cloud” has been around for a few years now, but I haven’t yet used it, at least from a developer’s point of view. So I’ve decided to start with Microsoft’s Azure. I’m going to chronicle my learning experience here, if for no other reason than I’ll have something to refer to in the future. Smile

Since I’m doing this on my own, mostly on the weekends and whenever I can sneak in 30 minutes some weekday evening, I’ve had to ask around to learn how to do it. It was recommended to me that I take something I’ve used in the past and upload it to Azure. Years ago I started a SQL Server database at home, so that I could learn new (to me at least) technologies. (I used this to help me learn ASP.NET and WPF/XAML.) This database is for our fairly extensive DVD (and now Blu-ray) collection. I called it MediaLibrary.

The first thing I had to decided was how to get my MediaLibrary into Azure. I asked around and got two suggestions. First, I could create a VM in Azure, install SQL Server into it and upload my database into it. (What I believe is called Platform as a service, or PAAS.) This idea attracted me at first, but others suggested that doing this I really wouldn’t learn anything new. They recommended that I learn Azure SQL instead. (Infrastructure as a service, or IAAS.) So that’s the approach I’ve decided to follow.

A Useful Tutorial on Getting Started with Azure SQL

The first big help I got was to go to a link for a tutorial on how to do this, titled SQL Database tutorial: Create a SQL database in minutes using the Azure portal. I’m finding this to be a very helpful tutorial so I highly recommend it.

Single IP vs. Range of IP Addresses

Being a novice at this there are some obstacles I’ve run into. I read through the tutorial before starting. The first thing I ran into right away was where it said, “Create a server-level firewall rule for a single IP address or for a range of IP addresses.” Again I asked about this and was told that either I could get a static IP address or I could ask my ISP for the range of IP addresses they have. I thought that my ISP would have a huge range of IP addresses and I certainly didn’t want someone else potentially getting to my database in Azure, so I’ve decided to get a static IP address from my ISP. If you’re following this blog post, you have to make your own decision in regards to this. For myself I thought the static IP would work best.

Next Steps

Next I created a new SQL Server (logical server). As I understand it now, this is a place where a Azure SQL database can be put. You need this first before you can go on. When I entered all of the information required (see the link above to the tutorial) it took about 5 minutes to create after I clicked the Create button.

Next I went to create the Azure SQL database itself. This is as far as I’ve gotten. I’m now at the section titled, “Create a new Azure SQL database”. Where I’ve gotten stuck is selecting the source. The Select source dropdown has three options: Blank, Sample or Backup. I don’t want a blank database, as I’ve already got one. I don’t want a sample like AdventureWorks. Really the best choice for me is Backup, because I’ve backed up my MediaLibrary database. However this is where I’ve gotten stuck; selecting Backup makes Azure look only at itself for the backup. At least that’s the idea I’ve gotten. It certainly doesn’t give me the option to upload my .bak file. So, until I learn what I’m supposed to do next, I’m stuck. Hopefully I’ll learn later today. I’ll post after that.

C#’s HashSets

One thing that you encounter whenever you interview for a position as a .NET developer the technical question. That can make many forms, such as the famous “fizz-buzz” puzzle. But one that has always stumped me is how to find common elements between two arrays of the same data type. I’ve always come up with using two loops, one within another, which is of type O(n2). In the .NET framework I’ve recently learned of HashSets, which are extremely cool. This makes finding common elements easy. To learn more about them I decided to write a simple console app to try it out. This is based upon the MSDN online article on HashSets, which I’ve expanded upon. Here’s the source code:

using System;
using System.Collections.Generic;
using System.Linq;
namespace SimpleHashSet
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Learning about HashSets\r\n\r\n");
HashSet<int> setA = new HashSet<int>();
HashSet<int> setB = new HashSet<int>();
for (int i = 0; i < 5; i++)
{
setA.Add(i * 2);
setB.Add(i * 2 + 1);
}
//now, just add 100 to both
setA.Add(100);
setB.Add(100);
Console.WriteLine("setA contains {0} elements:", setA.Count);
DisplaySet(setA);
Console.WriteLine("setB containts {0} elements:", setB.Count);
DisplaySet(setB);
Console.WriteLine();
//what is the intersection?
HashSet<int> theIntersection = new HashSet<int>(setA);
theIntersection.Intersect(setB);
Console.WriteLine("Using the Intersect method on setA with setB");
DisplaySet(theIntersection);
Console.WriteLine();
//what is the intersecion with about?
HashSet<int> intersectWith = new HashSet<int>(setA);
intersectWith.IntersectWith(setB);
Console.WriteLine("Using the IntersectWith method on setA with setB");
DisplaySet(intersectWith);
Console.WriteLine();
//what about the union method?
HashSet<int> theUnion = new HashSet<int>(setA);
theUnion.Union(setB);
Console.WriteLine("Using the Union method on setA with setB");
DisplaySet(theUnion);
Console.WriteLine();
//what about the UnionWith method?
HashSet<int> unionWith = new HashSet<int>(setA);
unionWith.UnionWith(setB);
Console.WriteLine("Using the UnionWith method on setA with setB");
DisplaySet(unionWith);
Console.WriteLine();
//what is the Except method all about?
HashSet<int> theException = new HashSet<int>(setA);
theException.Except(setB);
Console.WriteLine("Using the Except method on setA with setB");
DisplaySet(theException);
Console.WriteLine();
//now try the ExceptWith method
HashSet<int> exceptWith = new HashSet<int>(setA);
exceptWith.ExceptWith(setB);
Console.WriteLine("Using the ExceptWith method on setA with setB");
DisplaySet(exceptWith);
//this is the end
Console.WriteLine("\r\n\r\nPress any key to quit.");
Console.ReadKey();
}
private static void DisplaySet(HashSet<int> passedSet)
{
Console.Write("{");
foreach (var item in passedSet)
{
Console.Write(" {0}", item);
}
Console.WriteLine(" }");
}
}
}
If you run the preceding code you’ll get this in the command window:
2016-03-11
Don’t know about you, but I find things like this handy to use a refer back to.

I’m finally giving up trying to upgrade to Windows 10

I have Windows 10 installed on some desktops and laptops. It’s gone well, until I tried it on my 3 year old Sony VAIO. Initially I got an email from Sony strongly suggesting that I not upgrade my VAIO until they had made necessary changes to the device drivers. I waited until they told me that they were ready. Some months ago I got a follow-up email from Sony informing me that they had fixed their device drivers so that I could upgrade my Sony VAIO. So I started trying to update my Sony VAIO.

That was about 3 months ago. Over that period of time I’ve made at least 11 attempts to update from Windows 8.1 Professional to Windows 10 Professional on my Sony VAIO. I tried the update wizard 5 or 6 times. All failed.

I tried another method (can’t remember exactly what it was called, but it’s the next method after trying the general Windows 10 Update Wizard). I tried that 4 or 5 times, and that failed each time.

Finally I was advised to go to a Microsoft website to download the .ISO file and run the setup from that. I did that and man, did that ever fail badly. I had no access to my keyboard or mouse. It took me days to finally get the keyboard and mouse working again so that I could back out the Windows 10 upgrade.

11 failed attempts to update my 3 year old Sony VAIO.

Sony, I don’t know if you’ll read this or not. I hope you do. Please, when you send out emails to your customers telling them that you’ve fixed your device drivers DO A BETTER JOB OF TESTING!!

To anyone else who reads this who owns a Sony VAIO that’s 3 or 4 years old. Trust me, don’t try to upgrade to Windows 10. The machine won’t accept Windows 10 at all. I use Windows 10 on other systems, it works fine. Sony just haven’t done the job they said they were going to do to update their device drivers to allow the update to Windows 10. Save yourself the aggravation, don’t make the attempt. Instead save up some money and get some other machine that will allow you to upgrade or is already at Windows 10.

Yet another failed attempt at upgrading to Windows 10

Tonight I had the time to try upgrading from Windows 8.1 Professional to Windows 10 Professional again. I think this is my 11th attempt to upgrade to Windows 10 (I’ve honestly lost count). And tonight I downloaded the .ISO file and run the setup from within it. It did get past the place where it was hanging before. So I thought I was out of the woods, finally.

In that I was deceived, because when it was trying to finalize things and let me log in, I got the following error:

“KERNEL SECURITY CHECK FAILURE”

now the keyboard doesn’t work, it refuses to connect to my Wi-Fi network and basically I’ve now got a nearly useless laptop. I’m not even sure I can get it back to Windows 8.1 Pro anymore, if I cannot use the keyboard. I cannot even power it down or log it off because its refusing to work. Pretty bad.

My upgrade to Windows 10 continues to encounter problems

I continue to encounter problems trying to upgrade my Sony VAIO from Windows 8.1 Pro to Windows 10 Pro. I called Microsoft technical support to get more help. They wanted me to try the regular update routine. However I suspect that the issue is still with Sony, who suggested that I upgrade to Windows 10 first before upgrading the device drivers. Next I get the error. See the picture attached.

Posted from WordPress for Windows Phone