Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts

Friday, July 13, 2018

What is Dynamic Language Runtime (DLR)?

Dynamic Language Runtime(DLR) is a runtime environment that adds set of services for dynamic languages to the Common Language Runtime.

The difference between dynamic languages and statically typed languages such as C# and Visual Basic is that you need to specify the object type at design time for the latter.

There are a lot of popular dynamic languages such as the following:

LISP
SmallTalk
Javascript
PHP
Ruby
Python
ColdFusion, Lua
Cobra and
Groovy

Dynamic languages are also excellent scripting languages used in designing Web sites; data transformations; artificial intelligence, etc.

The main driver for DLR is to create the ability to run the dynamic languages on top of the CLR. Dynamic objects (in System.dynamic) now can be used in C# and Visual Basic. This in Visual studio Community 2017.


DLR_0
Here is the architecture of DLR for IronPython and IronRuby from Microsoft documentation in MSDN.


DLR.png

Sunday, November 8, 2015

What is SQL CLR or SQLCLR?

In order to understand what is SQLCLR, you need to know what the individual parts, Sequential Query Language (SQL) and Common Language Runtime (CLR) are.

Common Language Runtime is the programming that manages the execution of programs written in any of the supported languages such as C#, VB, Visual C++ etc to share common object orineted classes. Thiss is somewhat like Java Virtual Machine for programs run from Java. CLR is also called 'managed execution environment'. CLR is therefore related to .NET programming.

SQL is a language that is needed to run queries (post questions to) against SQL Server databases. It is not specific to Microsoft SQL Server. It can also be used with other databases like Oracle, Sybase, etc.
However Transact SQL (T-SQL) is the enhancement to add some progrmmability to SQL.
SQL Common Language Runtime (SQLCLR) is the combo technology (SQL Server and .NET) for hosting .NET common language runtime engine within SQL Server. In other words you can run managed code from within SQL Server.

Since T-SQL already adds to SQL the programming capability why does one need SQL CLR?

The reason I that there are certain useful class of programs that are just not handled by T-SQL, or make it much more complex and less secure. Of course there are more reasons why SQL CLR is needed. This is the reason for the development of SQL CLR. Also Microsoft made extensive integration of SQL Server with its massive .NET programming which makes it lot more flexible.

For, Creating a Visual C++ CLR Console Application in Visual Studio 2015 go here.

Sunday, December 7, 2014

What is LINQ?

We know that a query is a question we pose to the database to retrieve some information that we would like to know. For example, in a database that consists of men and women, you may want to know how many men and how many women. Let us go a step further and say that there are people of all nationalities in the database of men and women. You may want to know how many women who hail from Europe are there. This is only filtering of the information but a query can much more complex. This is of course querying a database, let us say a relational database such as the SQL Server where you use the Structured Query Language(SQL), a special language you have to learn.

All data are not in relational databases and they could be in some kind of an XML document, a web service or something else. For example, in order to find some filtered content in an XML document you would use a language called XQuery which is not the same as SQL. This means there is need to learn another query language.

Beginning with Visual Studio 2008 and .NET Framework 3.5 Microsoft introduced LINQ which stands for Language-Integrated Query an innovation that made it possible to query a SQL Server database, an XML document, Web Services etc with a single lanugage and it is a first class query language.

In Visual Studio you can write LINQ in both VB and C# for any collection that supports IEnumerable or the generic IEnumerable interface (or to put it simply a collection in which one can go through the collection item by item).

For example you may have a list  of names ("John", "Tom", "June", "Diana") etc.  or  the number of rows in a database table , etc. and they can be queried using LINQ.

Need to query SQL Server with LinqPad, review the following posts:

http://hodentekmsss.blogspot.com/2014/12/learn-querying-sql-server-using-linq.html
http://hodentekmsss.blogspot.com/2014/12/learn-querying-sql-server-2012-using.html