Getting started
Download and install QPad, and start it from the Start menu. The first time, a small example is ready in the editor. Press F5 (or ▶ Run) and the result appears as a table below the code.
Enumerable.Range(1, 5)
.Select(x => new { x, Square = x * x })
.Dump("Squares");
The window has three parts: connections and queries on the left, the editor with tabs on the right, and the results below it. Drag the dividers to resize. Drag the divider next to the left panel all the way left to hide the panel, and back to show it. QPad remembers your tabs, the window size and the layout until next time.
Run modes
Choose the mode in the drop-down list next to ■ Stop above the editor. New tabs start in C# Statements.
- C# Expression
- A single expression, such as
DateTime.Now.AddDays(30). The value is shown automatically – no.Dump()needed. A semicolon at the end is fine. - C# Statements
- Ordinary code line by line, like a
Program.cswith top-level statements.usingat the top,awaitand your own classes at the bottom are allowed. - C# Program
- A
void Main()(orasync Task Main()) with your own methods, fields and classes around it. A complete file with its ownstatic Mainworks too. - SQL
- SQL straight against the tab's database (Pro). See SQL mode under Databases.
When you switch to C# Program, the code is wrapped in void Main() { … } automatically (or async Task Main() if it uses await).
Undo with Ctrl+Z if you change your mind. If the code is in the wrong mode, the error message tells you which mode to choose.
void Main()
{
var total = Sum(1, 2, 3);
total.Dump("Sum");
}
int Sum(params int[] numbers) => numbers.Sum();
These namespaces are always available without using: System, System.Collections.Generic,
System.IO, System.Linq, System.Text, System.Threading and System.Threading.Tasks.
Results and .Dump()
Write .Dump() after a value to show it. Lists and objects become tables, dictionaries become Key/Value,
and nested objects are shown inside the cells. Give the table a heading with .Dump("Title"). Dump returns the value,
so it can sit in the middle of a chain.
var people = new[]
{
new { Name = "Kari", Age = 29 },
new { Name = "Ola", Age = 41 },
};
people.Dump("Everyone");
people.Where(p => p.Age > 30).Dump("Over 30");
Console.WriteLine($"Count: {people.Length}");
Console.WriteLinewrites straight into the results. Text written toConsole.Erroris shown as an error.- A list shows up to 1000 items. A database query without
.Take(n)fetches the first 1000 rows and tells you if there are more. - Export (Pro): above each table are Copy (pastes as a table into Excel, Word or a mail), CSV…, Excel… and Open in Excel. Numbers, dates and true/false keep their types in Excel. Nested objects in cells are exported as a short text.
- Switch between Results and SQL above the results. SQL shows every SQL statement that ran against the database, with parameter values.
- Compilation errors are listed with line and column. Click an error and the cursor jumps there in the code.
- Exceptions are shown with type and message, and the stack trace can be expanded. Error text can be selected and copied.
- ■ Stop (Shift+F5) cancels the run. Scripts run in a separate process, so even an infinite loop is stopped without QPad hanging.
- Output over 20 MB in one run is cut off with a message. The status bar at the bottom shows how long the run took.
The editor
- Code completion appears when you type . or start a word, and with Ctrl+Space. Enter, Tab or a separator such as ( inserts the suggestion. Space closes the list.
- Parameter info appears when you type ( or , in a method call, and with Ctrl+Shift+Space. It shows the overload that matches the arguments you are typing.
- Hover over a name to see its type and documentation, or over an underlined error to read the message.
- Errors as you type: a red squiggle is an error, a green one a warning. The code is checked half a second after you stop typing.
- Format the code with Ctrl+K followed by Ctrl+D, as in Visual Studio, or Edit → Format document. Only indentation, spaces and line breaks change, and a single Ctrl+Z undoes it all.
Code completion also knows the NuGet packages you have added and the tables in the database the tab is connected to.
Code completion, parameter info and info when you hover over a name require a license: Pro, Educational, or Free during its 14-day trial. Error highlighting and formatting work without one.
Debugging
Set a breakpoint by clicking left of the line numbers, or with F9 on the line. A red dot marks it. When the tab has breakpoints, F5 runs the query with the debugger, and it stops on the first breakpoint it reaches. Without breakpoints the query runs as usual. The debugger is a Pro feature.
- A yellow arrow marks the line that runs next.
- F5 continues, F10 steps over, F11 steps into a method, Shift+F11 steps out, and Shift+F5 stops. The same commands are in the Debug menu.
- Locals below the code shows the variables and their values. Expand a variable to see its members.
- Call stack shows the methods of your query that led to the line. Click one to see its line and variables.
- Hover over a name to see its value.
- If the query throws an exception it does not handle, it stops on the line where the exception was thrown, so you can look at the variables. F5 then lets the query fail as usual.
- Breakpoints are saved with the tab, but not in the
.qpadfile. You can add or remove them while the query runs.
AI assistant
The assistant writes, explains and fixes queries for you. It uses your own API key from Anthropic (Claude) or OpenAI, so the use is billed by the provider on your own account. The assistant is a Pro feature.
- Get an API key from Anthropic or OpenAI.
- Choose Edit → AI assistant settings, pick the provider, and paste the key. The model is filled in for you (
claude-opus-5-5orgpt-5); you can type another. - Open the assistant with Assistant next to Results and SQL, with Edit → AI assistant…, or with Ctrl+I.
- Write what you want, for example "customers in Oslo with more than three orders", and press Enter. Shift+Enter gives a new line.
- The buttons Explain the error, Fix the error and Explain the code ask about the tab as it is. New chat starts over.
- The answer appears as it is written. Under each code block, Insert at cursor puts the code into the editor, and Replace the query replaces all the code in the tab.
- The assistant knows the tab's language (C# or SQL) and, with a connection, the tables and columns, also for your own EF Core DbContext.
What is sent
When you ask, QPad sends your question, the conversation so far, the tab's code, the selected text, the errors above the code and, if the tab has a connection, the names and types of its tables and columns. It is sent only to the provider you chose. Query results, connection strings and passwords are never sent. The code and the error messages are sent as they are, so they can contain values you have typed or that an error quotes. The API key is stored encrypted for your Windows user and is only sent to the provider.
Tabs
- New tab: Ctrl+T, File → New query or the + tab.
- Close: Ctrl+W, × on the tab or a middle click. If the tab has unsaved changes, you are asked whether to save.
- Switch tabs with Ctrl+Tab and Ctrl+Shift+Tab.
- Double-click the tab title to give the tab a name of its own. Enter saves, Esc cancels.
- An asterisk (
*) after the name means unsaved changes.
When you close QPad, all tabs are kept – unsaved ones too – and they are back the next time you start it. That is why you are not asked to save when you exit. If you want a query as a file, save it with Ctrl+S.
qPad files
A query is saved as a .qpad file. It contains the code, the run mode, the NuGet packages (with exact versions),
the DLLs you reference and which connection the query uses. The connection is only stored as a reference – never
server names or passwords – so the file is safe to share or check into a repository.
- File → Save (Ctrl+S) saves. The first time, the My qPads folder and the tab's name are suggested.
- File → Save As… (Ctrl+Shift+S) saves a copy with a new name or in a new place.
- File → Open… (Ctrl+O) opens one or more files. If a file is already open, QPad goes to that tab.
A tab name of your own (set with a double-click) is not stored in the file. The file gets the name you choose when you save.
Examples and My qPads
Below the connections on the left is the Queries panel with two folders:
- Examples
- Ready-made examples to learn from: Hello QPad, Dump basics, LINQ to objects, Async code, C# Program, Using a NuGet package and Querying a database. They open as new, unsaved queries, so you can change them freely and save a copy of your own.
- My qPads
- Your own
.qpadfiles, with subfolders. The default isDocuments\QPad. Choose another folder under Edit → Settings….
This is how you organize the files, much like in Windows File Explorer:
- Open: double-click or Enter.
- New folder: right-click My qPads or a folder and choose New folder…. The folder is called “New folder”, and you can type a new name right away.
- Rename: select the file or folder and press F2, or right-click and choose Rename. The name changes right in the tree. Enter saves, Esc cancels.
- Move: drag a file to another folder. If you drop it on a file, it ends up in that file's folder.
- Delete: select the file and press Delete, or right-click and choose Delete…. The file goes to the Recycle Bin, so you can undo there. Folders are deleted in File Explorer.
- File Explorer: Show in Explorer on a file and Open in Explorer on a folder.
Open tabs follow along when a file is moved or renamed. Changes you make to the folder outside QPad show up in the tree by themselves.
Databases
QPad connects to SQL Server (LocalDB too), PostgreSQL and SQLite.
Adding a connection
- Click Add connection at the top of the left panel.
- Choose the Server type and enter the Server, for example
localhost,.\SQLEXPRESSor(localdb)\MSSQLLocalDB. For PostgreSQL you can add a port:db.example.com:5432. - Choose Windows authentication or User name and password.
- Pick the database in the Database list (fetched from the server), or type its name.
- Press Test connection to check it, and OK to save.
For SQLite, choose SQLite as Server type and point to the database file under File, or use Browse…. No login or database list is needed. The file must already exist.
The password is stored encrypted for your Windows account and is never written in plain text to disk or logs. Right-click a connection for Use in active tab, Refresh, Edit… and Delete.
Connecting a query to the database
Each tab has its own connection, shown below the editor. Choose Use in active tab on the connection, or drag a table into the editor. Disconnect removes the connection from the tab. A new connection is used automatically in the current tab if it doesn't have one already.
The schema tree
Below the connection are Tables and Views with columns (with type, primary and foreign keys) and relationships.
Drag a table into the editor to insert Customers.Take(100) – on an empty line it becomes Customers.Take(100).Dump();.
Drag a column to insert the name of the property.
Tables in your code
When the tab has a connection, the tables are available directly in code as LINQ sources (linq2db). Classes get singular names and
tables plural ones, for example the class Customer and the table Customers. Tables outside the
default schema (dbo, public or main in SQLite) get the schema in front: Sales_Order. Foreign keys become navigation properties,
so order.Customer.Name works.
Customers
.Where(c => c.City == "Oslo")
.OrderBy(c => c.Name)
.Select(c => new { c.Name, Orders = c.Orders.Count() })
.Take(20)
.Dump();
- See exactly which SQL ran in the SQL view.
- Insert new rows with
this.Insert(new Customer { … }). There is noSaveChanges. - If the database has changed, choose Refresh on the connection. The schema is stored locally, so the tables are known even when the server doesn't respond.
- ■ Stop also cancels a database query that takes a long time.
Your own EF Core DbContext
If your project uses Entity Framework Core, QPad can query with your own DbContext and its model instead of
one generated from the database. This is a Pro feature.
- Build your project, then click Add connection and choose My EF Core DbContext under Data model.
- Pick the built DLL with the context, for example
MyApp\bin\Debug\net8.0\MyApp.dll. QPad lists the contexts it finds. - Choose the context and how QPad should create it. QPad suggests the best way the context supports: the project's design-time factory
(
IDesignTimeDbContextFactory, as used for migrations), a constructor withDbContextOptions, a constructor with a connection string, or a parameterless constructor. - For the two constructors that take settings, give the database in the server fields, or let QPad read the connection string from the
project's
appsettings.json. Click Read the model to check that everything works.
Customers
.Where(c => c.Orders.Any())
.OrderBy(c => c.Name)
.Take(20)
.Dump();
Customers.Add(new Customer { Name = "Kari" });
SaveChanges();
- Each
DbSetis available by name, andContextis your context itself. Changes are saved withSaveChanges()orawait SaveChangesAsync(). - The SQL that EF Core runs is shown in the SQL view, with its parameters.
- The schema tree shows the tables, columns, keys and navigations from your model.
- QPad works on a copy of the build output, so you can rebuild while QPad is open. After a rebuild, the tree and code completion are updated by themselves.
- Your project's own EF Core version is used, from EF Core 6 onwards. Projects that need ASP.NET Core run with it.
- SQL mode works with the context's own database connection.
SQL mode
Choose SQL in the drop-down list above the editor to write SQL instead of C#. The query runs against the tab's connection, so the tab needs one. SQL mode is a Pro feature.
SELECT TOP (20) c.Name, COUNT(o.Id) AS Orders
FROM Customers c
LEFT JOIN Orders o ON o.CustomerId = c.Id
WHERE c.City = 'Oslo'
GROUP BY c.Name
ORDER BY c.Name;
- Each result set is shown as its own table, with the same export buttons as other tables. Up to 1,000 rows are shown per result set.
- Statements that change data show how many rows were affected.
PRINT(SQL Server) andRAISE NOTICE(PostgreSQL) are shown as text. - In SQL Server,
GOon a line of its own splits the script into batches, as in SQL Server Management Studio.GO 5runs the batch five times. - Select part of the script to run only that part.
- An error is shown above the code with the line it is on. Click it to go to the line.
- Code completion suggests tables, views, columns and SQL keywords. After an alias, such as
c.in the example, it suggests that table's columns. - Drag a table from the schema tree onto an empty line to insert a
SELECTfor its first 100 rows. - Each statement runs on its own, without a transaction around the script. Use
BEGIN TRANSACTIONyourself if you need one.
NuGet packages and DLLs
Click References… in the toolbar. The packages apply to the query in the active tab and are stored in the .qpad file.
- Type in the search box, for example
newtons. All enabled sources are searched at once, and each hit shows which source it comes from. - Check Include prerelease for prerelease versions. Pick another version in the list next to the hit if you don't want the latest stable one.
- Add downloads the package with its dependencies right away. If the query has another version, the button says Update. Remove a package under Installed packages.
- Add your own DLLs under Assemblies with Add DLL….
- Packages are downloaded once and stored locally. The first run after a package is added shows “Restoring packages…”.
Private package sources
Under Sources… you add your own sources, for example an Azure DevOps feed. Enter a name and the URL of
index.json (v3), and optionally a user name and password or a personal access token (PAT). Passwords and PATs are stored
encrypted for your Windows account. nuget.org is built in and can be turned off, but not removed. On first start, the
sources are read from your nuget.config.
Settings and storage
Edit → Settings… has three options:
- Theme: System (follow Windows), Light or Dark. With System, QPad follows the Windows setting while the app is running.
- qPad folder: the folder shown as My qPads and suggested when you save. Use default goes back to
Documents\QPad. - Error reports: whether errors in QPad are sent to qpad.no. See Error reports.
This is where QPad stores its files:
| Folder | Contents |
|---|---|
Documents\QPad | Your .qpad files (My qPads), unless you have chosen another folder. |
%APPDATA%\QPad | usersettings.json: theme, connections (passwords encrypted), package sources, open tabs and window layout. |
%LOCALAPPDATA%\QPad | Cache for database schemas, downloaded packages, logs, error reports and data for the results view. Can be deleted; everything is rebuilt. |
Error reports
When something goes wrong – an exception in the script, an error in QPad or a schema that can't be read – a report is saved in
%LOCALAPPDATA%\QPad\errors. Below the error message it says “Saved for troubleshooting”, with a link that shows the file in File Explorer.
The report contains the error message, the code as it was when you ran it, the run mode, packages and which database it concerned. It never contains passwords or connection strings. Attach the file if you report an error. The 200 newest are kept.
Sending to qpad.no
Errors in QPad itself are sent to qpad.no so they can be fixed. The first time you start QPad, you are asked whether you want to send errors. You can change your choice at any time under Edit → Settings… → Send error reports to qpad.no.
- What is sent: the error message with stack trace, the QPad, .NET and Windows versions, and the query you ran (code, run mode, packages and database type).
- What is never sent: passwords, connection strings, names of servers, databases, connections or files. Your user folder (
C:\Users\…) is masked. - What stays on your machine: errors in your own code and errors from the database or the network, such as a wrong password or a server that doesn't respond. They are only stored locally.
Keyboard shortcuts
| Keys | What it does |
|---|---|
| F5 | Run the query, or continue when the debugger has stopped it |
| Shift+F5 | Stop the run |
| F9 | Set or remove a breakpoint on the line |
| F10 | Step over (while stopped) |
| F11 | Step into (while stopped) |
| Shift+F11 | Step out (while stopped) |
| Ctrl+I | Open the AI assistant |
| Ctrl+Space | Show code completion |
| Ctrl+Shift+Space | Show parameter info |
| Ctrl+K,Ctrl+D | Format the code |
| Ctrl+Z | Undo (also formatting and switching to C# Program) |
| Ctrl+T | New tab |
| Ctrl+W | Close the tab |
| Ctrl+Tab | Next tab (with Shift: previous) |
| Ctrl+O | Open file |
| Ctrl+S | Save |
| Ctrl+Shift+S | Save as |
| F2 | Rename a file or folder in My qPads |
| Delete | Move the selected qPad file to the Recycle Bin |
| Enter | Open the selected file or example |
License and activation
QPad works without a license: you can run code, use .Dump(), query databases and add NuGet packages.
A license adds IntelliSense (code completion, parameter info and info when you hover over a name) and quick fixes.
Licenses are managed on your account at qpad.no.
- Free
- Everything, with IntelliSense and quick fixes for the first 14 days after you activate. After that, the rest of QPad keeps working.
- Pro
- Everything, all the time. Free for now: click Get Pro on your account page.
- Educational
- Everything, free for students and teachers, for learning and teaching. Apply on your account page; it lasts a year and is renewed with the same form.
- Create an account and confirm your e-mail address. Your account page shows your license key, for example
AB12-CD34. - Click Activate license in the top right corner of QPad.
- Enter the e-mail address of your account and the key, and press Activate.
The top right corner shows the edition, and for Free how many days of the trial are left. Click there to open the license. After Get Pro or Educational on the account page, QPad picks up the change within a week, or right away with Refresh.
A license can be active on up to 3 devices. To free a device's place, click Remove license from this device in the license window, or remove the device on your account page. QPad checks the license with qpad.no once a week. Without contact for 30 days, IntelliSense is turned off until QPad can check it again.
On activation, your e-mail address, the license, the QPad and Windows versions, the computer name and an anonymous machine ID are stored. Read more in the Privacy Policy.
With an activated license, Feature request appears in the top right corner. There you can describe functionality you are missing and press Submit. The request is sent to qpad.no and stored with your license, so we can get in touch if anything is unclear.
Tips and troubleshooting
- The installer stops and asks for the .NET 10 Desktop Runtime
- Download “.NET Desktop Runtime” (x64) from dotnet.microsoft.com, install it and run the QPad installer again.
- Code completion shows no documentation for .NET methods
- The documentation comes with the .NET 10 SDK. Install the SDK and it appears. Everything else works without it.
- “The connection this query uses no longer exists”
- The connection the query was saved with doesn't exist on this machine. Choose Use in active tab on one of your own connections.
- The tables don't show up in code completion
- Check that the tab is connected to the database (the line below the editor). If the table is new, choose Refresh on the connection.
- A query hangs
- Press Shift+F5. If it doesn't stop by itself within two seconds, the process is ended.
- Extension methods don't work in C# Program
- In C# Program the classes are placed inside the query, and then they can't contain extension methods. Use C# Statements, or write a complete file with its own
static Main.