Intended for new developers, or at least new to ADO.Net, this post will demonstrate how to Create, Read, Update and Insert data into a MS SQL Server database. We will use a VB.Net winforms project, DataGridView and SqlDataAdapters. You can pull down the complete project from GitHub here.
UPDATE: I have also published a similar example application done with Code First EntityFramework 6.
The finished Form looks like this:
Do you remember, or have you at least heard of the old game show “Let’s Make a Deal”? This was the show where a contestant had to opportunity to win a car. All they had to do was guess which door the new car was behind. Two of the doors had a farm animal but there was a trick to it. After choosing a door, the contestant was shown one of the farm animals and then had to decide to stick with their first choice or switch their guess to the door they didn’t choose. What do you think the chances are of winning when keeping the first choice versus switching guesses?
The Visual Studio integrated tools for SQL Server are getting better all the time. While working solely in VS might not always be optimal, it is very convenient to not have to switch over to SQL Server Management Studio to do simple queries. Although the VS SQL tools may not be full-featured, you might just be able to get by with them and not need to install SSMS at all.
One of the less intuitive things to do is to restore a backup file that was created on another server. In this post I will show you how to easily do this in the absence of a right-click restore shortcut. For this you must run the SQL for RESTORE.
Today I thought I’d break out of the mold a bit and give the VB.Netters a little love.
I recently came across some code that was generating server-side HTML from rows of a DataTable. The data was similar to this one, rows would contain redundant header values (Category) and unique content values (Name, Value):
As a .Net developer, I have naturally gravitated toward Asp.Net for building web applications. However, the past few years I have eschewed web forms for the modern ajax style of development, especially the SPA. One reason I do still create .aspx pages is to build reports with tools like Telerik reporting or Microsoft .rdlc. I couldn’t find a good way to make reports without a server-side technology and The Google lead me down many sub-optimal paths. Finally, I have figured it out, and it was easy. I am embarrassed to announce that I didn’t know this before, but maybe some of you are as dumb as I am and this blog post could help.
If you need to do basic TIFF file manipulation you don’t need to reach for a 3rd party library. The Windows.Media.Imaging namespace provides tools you can use to:
- Create Multi-Page TIFF files
- Extract Pages
- Remove Pages
- Get page count
- Work with other encoder/decoders like gif, png, jpeg, bmp, etc.