A Basic Example of CRUD with DataGridView in VB.Net

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:
finishedform
Continue reading

66% chance of new car

carsandgoatsDo 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?

You can find out here. This little javascript simulator uses one or two fancy new javascript tricks so you  need a modern browser. If it isn’t working for you then switch to Chrome or Firefox.

enjoy.

Restore SQL Server backup to localdb in Visual Studio

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.

Continue reading

Interactive Search Builder for Javascript now on NuGet

isbjsiconInteractive Search Builder for javascript has been released in NuGet. ISBjs is a configurable javascript “widget” that empowers your users to build their own search queries, significantly reducing the complexity for you, the developer from providing many search options.
Read more about how it works, how to make it pretty, etc. on the github page HERE.

Continue reading

Printable Reports Using only CSS and HTML

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.

Continue reading