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
8
votes
2 answers

Give `string[] args` to Linqpad script

How can I test how my Main method handles command-line arguments in Linqpad? I tried void Main(string[] args) { args.Dump() } but it errors No overload for method 'Main' takes 0 arguments Edit: I don't want to run Linqpad from the…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
8
votes
2 answers

Using linqpad as primary query tool

A member of my team recently moved to LinqPad as his primary query tool (still will use SQL Studio at times) for the simple purpose of forcing himself to make using LINQ more natural to use. I thought this was a pretty good idea and am considering…
Cody C
  • 4,757
  • 3
  • 29
  • 36
7
votes
3 answers

Moving From LINQpad to a Proper Visual Studio Project?

I'm learning LINQ to SQL in LINQpad and it's been great, but there's a lot of magic happening under the hood that I don't quite understand. I am connecting to an Oracle database using the optional IQ driver that can be downloaded inside of LINQpad.…
technomalogical
  • 2,982
  • 2
  • 26
  • 43
7
votes
1 answer

How to provide Console input to when running Linqpad?

Within LinqPad I can use things like Console.ReadKey(); OR Util.ReadLine(); But how do you run these in such a way you can actually enter the input? The UI doesn't have a console window!
Choco
  • 1,189
  • 1
  • 14
  • 29
7
votes
2 answers

Linqpad Charting. Combination of Column and StackedColumn

I am trying to do some charting in LinqPad. I have some logs from an api and i know, what api was called and if the request was cached (in our real case we resolve address with coordinates from bing api or we get addres from cache table if we have…
Maksim Simkin
  • 9,561
  • 4
  • 36
  • 49
7
votes
2 answers

How can I set a timeout om my query on LinqPad on ExecuteQueryDynamic?

How can I set a timeout om my query on LinqPad on ExecuteQueryDynamic? Util.CurrentDataContext.ExecuteQueryDynamic($"SELECT count(*) FROM MyDb.dbo.{viewName}"); I would like to use this timeout to detect the too slow views. For each view I request…
Bastien Vandamme
  • 17,659
  • 30
  • 118
  • 200
7
votes
1 answer

How to use LinqPad with Entity Framework Core?

I feel like I've missed something obvious. I want to test my EF Core DbContext in LinqPad like I usually do with regular EF. I have a simple DbContext: public class NotificationManagerContext : DbContext { public virtual DbSet
7
votes
5 answers

How can I run a SQL query in C# statement/program with Linqpad?

How can I run a SQL query in C# statement or C# program with Linqpad? Yes I have to mix SQL statements with Linq for compatibility reason. I use linqpad with postgres driver and these driver doesn't recognize the hstore of postgres. I already knows…
Bastien Vandamme
  • 17,659
  • 30
  • 118
  • 200
7
votes
1 answer

Can I programmatically assign linqpad config file to be used?

Linqpad is the only scripting like environment where I can work with my large code base. The reason it is the only environment that works for me is that other solutions (ironpython etc) always fail to properly load configuration from app.config, but…
mahonya
  • 9,247
  • 7
  • 39
  • 68
7
votes
2 answers

How to reload plugins/AppDomain for LINQPad

I've observed that if I refresh or reload the dll's in LINQPad's specified Plugins directory, that I must also close and re-open the current script for the library changes to take affect - which makes sense of course. My question is if there is a…
mdisibio
  • 3,148
  • 31
  • 47
7
votes
3 answers

How to add multiple query folders in LINQPad?

In the lower left corner of LINQPad, there is an area for display queries. One tab is My Queries and another one for Samples. I could not find a way to add more than one folder like in My Queries, just like one in Samples tab. I tried right click…
David.Chu.ca
  • 37,408
  • 63
  • 148
  • 190
7
votes
1 answer

How do I use Linqpad to insert record with specified primary key?

So when I run the following, the role is inserted but the ID column is auto generated. How do I stop this from happening when using Linqpad? Roles.InsertOnSubmit(new Role(){ID = 26, Name = "TheRole", Created = DateTime.Now, Updated = DateTime.Now});…
LivingOnACloud
  • 1,151
  • 1
  • 11
  • 20
7
votes
2 answers

linq query for varchar field not returning any results

When I run this query in linqpad: Customer.Where(c => (c.CustomerName == "test")) It returns a record that matches. When I try running the same query in visual studio it does not return any matching records. This is the code I am using: …
user1696698
  • 219
  • 3
  • 12
7
votes
1 answer

How to get linqpad to update columns

I am trying to do the equivalent of an SQL UPDATE with C# statements in linqpad but the data doesn't change and I'm not sure to even debug it further to figure out why. The User table is pretty standard with just a string to store Sid. var…
Kevin
  • 4,567
  • 1
  • 28
  • 36
7
votes
2 answers

Linq query works with null but not int? in where clause

I have a linq query function like (simplified): public IList ListDocuments(int? parentID) { return ( from doc in dbContext.Documents where doc.ParentID == parentID select new Document { ID =…
Kelsey
  • 47,246
  • 16
  • 124
  • 162