Featured Posts

A Little Love for Radzen and a Welcome

       Welcome to my Blog on Radzen. Radzen is a tool for developing real world applications for businesses quickly. It is a Rapid...

Sunday, February 24, 2019

The first application. A Hello World with Radzen and Northwind.

 

   Now that we have our Radzen environment setup we can move on to bigger and better things, our first application (If you do not have your Radzen environment setup please see this article, First things First - Getting Started with Radzen). I consider myself a SQL database admin. I do not claim to be the world's best developer or coder. I am a very good business analyst and problem solver. That is what you need to be successful with Radzen, problem solving skills and understanding what the goal is for your application. Before you jump in and begin on your own custom app it's a good idea to become familiar with the Radzen environment, how it works, and the capabilities it offers. That being said, Radzen needs a database in which to work from so without taking the time to create one from scratch, we can use one provided by Microsoft. We can download a copy of that database script here at this link. This is from the Github repo from the Radzen team.


  • The Northwind database has been used for years in application samples, training materials, and 3rd party use cases.  
  • Several Radzen examples they provide on their github repo use the Northwind database. 
  • You can become familiar with the database, browse through real code, and create some of your own all in one shot.


Let's get started. Now that we have the database script file downloaded, open the folder where you downloaded it to.

   Extract or UnZip the Northwind.zip file. You should end up with a Northwind.sql file.

Now double click the file. It may ask you how you would like to open the file. You should be able to select SSMS or SQL Server Management Studio.

   Once the file is open you can simply click Execute. This will create your Database and all of the sample data.


Now we have our database ready we can open Radzen and create a new application. 

Now fill out the application details.

  1. Make sure to use the Empty application setting as we do not want a sample application built for us. 
  2. Choose a name for your application, I chose "FunTimes".
  3. Now set a location to store the data on your computer.
  4. Keep Angular selected for the Framework type
  5. Check the box to enable server-side code (.Net Core) and leave the rest of the defaults.
  6. Click Create


Now we need to attach the Northwind database that we created earlier. To do that select Data on the top of our application window.


Now select New on the data sources window.


Fill out the form for the data source.

  1. Select MS SQL Server as the source
  2. Give your Connection a name
  3. Fill out the server name or IP address (Make sure to use the instance name in SQL if you specified one other than default such as "ServerNameOrIP \ InstanceName"
  4. Specify Northwind as the database
  5. For authentication you can use Windows or SQL depending on what you have enabled on your server. I am using Windows authentication so I do not need to specify a username or password as it will use my current user credentials. 
  6. If you use SQL Authentication specify a user account and password.
  7. Click the Infer Schema Button


You will see one more dialog. We want to check the box to Generate pages for CRUD operations. Then click Finish. Now click the X in the top right corner to close the data source setting window.


We have now generated a Radzen application from a database. You can Click Run at the top to test it out. Give it a few seconds to compile and start the web services for the first time.


No comments:

Post a Comment