Questions tagged [linqpad]

A lightweight code scratchpad for C#/F#/VB and database querying tool that supports both SQL and LINQ. Written by Joe Albahari.

LINQPad can be downloaded free from http://www.linqpad.net. Its main features are:

  • Runs code snippets in C#, VB.NET and F#, for .NET 3.5, 4.0, 4.5 and 4.6.
  • Executes queries on databases and other sources directly in LINQ (or SQL).
  • Explicit support for popular APIs such as LINQ-to-SQL, Entity Framework and OData, and databases such as SQL/Azure, SQLite, MySQL, Oracle and PostgreSQL.
  • Allows referencing custom assemblies and NuGet packages.
  • Built-in "object dumper" to facilitate easy experimentation. Recognizes and specially formats output from popular APIs such as Reactive Extensions.
  • Command-line support for automating scripts.
  • Built-in autocompletion and debugging (license purchase required).

LINQPad is popular for testing C# snippets. It also has built-in samples to help with learning LINQ.

Another program similiar to linqpad is You even can query stackoverflow using linqpad

1017 questions
13
votes
1 answer

VB.NET linq group by with anonymous types not working as expected

I was toying around with some of the linq samples that come with LINQPad. In the "C# 3.0 in a Nutshell" folder, under Chater 9 - Grouping, there is a sample query called "Grouping by Multiple Keys". It contains the following query: from n in new[]…
mattmc3
  • 17,595
  • 7
  • 83
  • 103
13
votes
2 answers

Creating WPF examples in LinqPad

Is there any way to sanely instantiate WPF objects in LinqPad? Here's my example (the correct assemblies are added in the query, etc): var w = new Window(); w.Loaded += (o,e) => { w.Content = new TextBlock() { Text = "Foo"…
Ana Betts
  • 73,868
  • 16
  • 141
  • 209
13
votes
2 answers

Is there a way to get LinqPad to work with an EF Core context?

I am trying to figure out if there is something I am missing or some way to hack around the lack of support (yet) for Entity Framework Core DbContexts in LinqPad. I've compiled my code targeting 4.6.1 (as suggested on the LinqPad forum) and tried…
AJ.
  • 16,368
  • 20
  • 95
  • 150
13
votes
4 answers

How to export data from LinqPAD as JSON?

I want to create a JSON file for use as part of a simple web prototyping exercise. LinqPAD is perfect for accessing the data from my DB in just the shape I need, however I cannot get it out as JSON very easily. I don't really care what the schema…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
13
votes
3 answers

LINQPad and Oracle

Does LINQPad work with Oracle? Has anyone tried? What do you suggest?
user118190
  • 2,139
  • 7
  • 29
  • 45
12
votes
2 answers

How to generate the F# type signature similar to FSI in my own code?

If one uses the F# Interactive Shell (FSI), the inferred expression type (signature) is printed to the console along with its value: val it : int * string * float = (42, "Hello F#", 42.0) How can I mimick the same behaviour in my own code, e.g. to…
Alexander Galkin
  • 12,086
  • 12
  • 63
  • 115
12
votes
3 answers

Has anyone used LINQPad to connect to Tridion Core Services?

I love LINQPad! I'm trying to connect to Tridion Core Services using a WCF connector in LINQPad to help with my rapid development & learning of Core. Currently, LINQPad is reporting a 404 (not found) error for the URI, but this same URI works in my…
MADCookie
  • 2,596
  • 3
  • 26
  • 46
12
votes
2 answers

Query an XML file containing nested elements using LINQPad?

I'm using LINQPad to query and visualize XML files with C#. For example: var xml = XElement.Load(@"C:\file.xml"); xml.Elements().Where(e => e.Element("trHeader").Element("trTickNum").Value == "1").Dump(); However, I'd like run a query using SQL…
Ryan Andres
  • 312
  • 3
  • 13
12
votes
1 answer

Is it possible to define a usable Object Context variable in LINQPad?

I'd like to be able to write against an object context variable within linq pad so the code is identical to what I'll be using in my production code. For instance if my object context variable was 'oc': oc.Products.Where(p => p.Price >…
BrooklynDev
  • 900
  • 2
  • 12
  • 25
12
votes
1 answer

Why does LINQPad dump enum integer values as strings?

I was using LinqPad to test out some Enum functions and I didn't get integers like I expected when I used .Dump(). Why did the ToList() solve the problem? void Main() { Enum.GetValues(typeof(Options)).Cast().Dump(); …
Ryan
  • 4,602
  • 8
  • 37
  • 43
11
votes
2 answers

Is the c# compiler smarter than the VB.NET compiler?

If I look at the IL that is created in Linqpad for the two following code snippets, I wonder what happens here. In c# int i = 42; results in the following IL code IL_0000: ret whereas in VB Dim i As Integer = 42 it is IL_0000: ldc.i4.s 2A…
Olaf
  • 10,049
  • 8
  • 38
  • 54
11
votes
1 answer

What is LinqPad's lambda window for?

I may be being stupid but never seem to get anything showing in the 'lambda window' after running code. Can anyone explain how it is supposed to work?
Joe Fawcett
  • 307
  • 2
  • 7
11
votes
2 answers

Is it possible to use LinqPad with PostgreSQL?

The comment here says I can use LightSpeed, which I've downloaded and installed. Then I get to this screen: And I'm not sure what to do. I'm not too familiar with connection strings, first of all. I found this, but... I think "Model assembly" and…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
11
votes
3 answers

LinqPad Error: Unable to find the .Net Framework Data Provider

I am new to LinqPad. I downloaded a .sdf file from the internet (i know what it is) I wanted to view its tables. So I googled "how to read .sdf files" and came across Linqpad, which I installed. When I browse to my .sdf file from LinqPad and try…
jon rios
  • 388
  • 1
  • 3
  • 11
11
votes
2 answers

linqpad and mongodb

is it possible to use linqpad with MongoDB? or any other tool for that matter that allows you to use linq to run adhoc queries on mongo. I've tried using the shell to write the queries in json, but the brackets, quotes, colons are driving me…
Jamona Mican
  • 1,574
  • 1
  • 23
  • 54