In this blog I am going to show you how to setup LINQPad v2.26.2 to access a Teradata Database.
LINQPad is a very flexible query tool. I use LINQPad to primarily execute LINQ to Entities and Entity Sql statements against Teradata when testing the Entity Provider for Teradata. It is free to use and is available here:
However, you will have to pay for the auto-completion feature. I highly recommend that you purchase this feature.
In order to access a Teradata Database using LINQPad you will first need to install the .Net Data Provider for Teradata (TDNETDP) 13.10. After this has been done, you will need to either create an executable or library that includes an Entity Data Model (EDM).
A project (NorthwindEDM) is included in the zip file attached to this blog. It contains the Northwind EDM for Teradata. The program that is used to create the Northwind Database is contained in the attached file to the blog Introduction to the Entity Provider for Teradata .
The Northwind EDM expects the data of the entities to be contained in a USER or DATABASE that has the name northwindef.
To setup LINQPad so that an EDM that references Teradata Database objects can be accessed, a connection needs to be created. To create the connection click on the Add connection link.
In the list for "Use a typed data context from your own assembly" choose "Entity Framework" and then press Next. The next form that is displayed will allow you to specify the EDM that will be used:
In the "Path to Custom Assembly" field either type in the path to the .exe/.dll that was created from the EDM project or Browse for the file. After this has been done click on "Choose".
From the "Choose Custom Type" window, press the OK button.
For the "Provider" you will need to choose Other. The "Provider Name" must be set to Teradata.Client.Provider. Enter the connection string to your Teradata Database, and then press the "OK" button.
Now LINQPad is setup to access Teradata. However, before executing statements the "Language" and "Database" fields must be set.
The "Language" field indicates what type of statement is to be executed. Here is a list of Language Settings that I have used and a brief description of what can be performed for each setting:
Used to execute LINQ to Entities statement. Other expressions such as arithmetic and String operations can also be executed.
This setting can be used to execute C# code. I use this to execute LINQ to Entities and Entity Sql statements. This setting is useful when specifying parameters or setting up a "nested" LINQ to Entities statement.
A program can be written in the editor and LINQPad is able to compile and execute it. I use this setting when testing parameter passing and prototyping more "complex" LINQ to Entities and Entity Sql statements.
Used to execute Entity Sql statements.
There are other language settings that can be specified. You will have to read the LINQPad documentation for more information on these other settings.
Before any type of statement can be executed, the "Database" has to be specified. The Database refers to a connection that you have created.
Once these fields have been set, the EDM specified in the Connection can now be queried and the data contained in your Teradata Database can be retrieved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.