Microsoft recently made available Visual Studio 2017 for download. I decided to give it a try. I like to see how easy it is to get started, what hurdles might present themselves, see what’s new and how this latest version handles. At the same time I downloaded and installed SQL Server 2016 SP 1. I am going to build a simple CRUD desktop app.
One of the things I noticed was .NET Core for cross platform development. However, this is currently only available for console, library and ASP.NET development. The setup file for Visual Studio 2017 is small and downloads the needed files based on your selections. I downloaded the single developer Community Edition. I browsed Twitter to get a sense of what others were saying. One article said it was faster and leaner. Another article described it as slimmer and nimbler. Some third party tools were announcing compatibility with the new version. One person complained that his attempt at creating a Xamarin Form blank project failed. Another person said it works great but he only uses it for basic stuff.
So what’s new in Visual Studio 2017? I found these two links (here and here) useful in answering this question. Also this YouTube video. Improvements include better performance, uses less memory, smarter user experience, better support for Azure development, interact easily with Git, added readability with Structure Visualizer, new Exception Handler, Run to Click, live editing and improvements for mobile development among other things. Also, I read about the built-in configurable style rules and that is really useful.
From my experience and generally Microsoft products work well together. I created my database and tables and created a login and gave it permissions. However I was getting the following error when trying to login and connect.
TITLE: Connect to Server
Cannot connect to MYSERVER.
Login failed for user ‘MyUser’. (Microsoft SQL Server, Error: 18456)
I found out that the reason for this was that I did not enable SQL Authentication. I had opted for the Express installation for the purposes of this blog post. From Management Studio, right click server and select properties. Under Security then Authentication then select SQL Server and Windows Authentication mode (if you are using SQL Server authentication like me).
When troubleshooting that error I decided I was going to delete and recreate the user and encountered this error
TITLE: Microsoft SQL Server Management Studio
Drop failed for User ‘MyUser’. (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)
To find out which schema is affected run the following query
SELECT name FROM sys.schemas WHERE principal_id = USER_ID(‘MyUser’)
Find the schema in object explorer under Security and change the owner e.g. back to dbo.
In creating one table I forget to set the Primary Key and got the following error using the automatically generated Grid View – Update requires a valid UpdateCommand when passed DataRow collection with modified rows. I set the primary key and I believe I had to refresh the table in the data source.
The last problem I had was that I couldn’t remember how I was able to drag the table over to the form to automatically create the Data Grid together with the Binding Navigator. Turns out I dragged it from the Data Sources window. If this window is not visible go to View – Other Windows – Data Sources. Once that was done I removed the unwanted columns from the Grid through the collection and changed one column in the Grid to a dropdown box. Not bad for a few hours of work. What’s your thoughts on Visual Studio 2017 and what has your experience been like?