Quantcast
Channel: LINQPad Forum
Viewing all 2710 articles
Browse latest View live

Does LINQPad support "Function Imports" in OData Service

$
0
0
Hi,

I have OData service that has couple of "Function Imports" in its metadata, when using LINQPad I am not able to see or execute them? Does LINQPad supports reading the metadata from OData service that includes Function Imports?

Thanks

Ramesh..

Feature Idea: Import Connection from exisiting Connection String (and export)

$
0
0
It would be nice to be able to feed a connection string, or even provide a .config file, and pull in new connections to LINQPad. Maybe just pre-populate the exisiting LINQ-to-SQL config page so you can still adjust any options you need.

As a related feature, it would be nice to provide some sort of export as well - though I understand that may be a little different. Would it just be a string? modify an existing .config file? How would it work with the other drivers?

Just thought I would seed some ideas. Any thoughts?

Avoiding bloated and contested MyExtensions. Thoughts?

$
0
0
I posted the following suggestion:
http://linqpad.uservoice.com/forums/18302-linqpad-feature-suggestions/suggestions/7124601-myextensions-folder-multiple-queries-alternativ

Basically, it is considering the tendency of MyExtensions to bloat into the dreaded "Common.dll" we all know from countless software projects. This tendency is greater in LINQPad because there few other options for communal code. Add to this the fact that it your regular queries may span many different topics/domains/efforts and MyExtensions is serving all.

I outline two alternative ways of addressing this.
* MyExtensions should have multiple files. It could be a folder.
* Queries should be able to reference another query (in the normal "add reference").

Searching this forum and the uservoice forums, I was surprised how few people seems to run into this problem.
How do YOU deal with, or avoid, bloated dependency-heavy MyExtensions? (Or is there a feature that I'm unaware of?)

Dump to DataGrids - Hyperlinqs that resolve to null

$
0
0
When dumping results to Data Grids, rather than Rich Text, it renders "complex"* objects as Hyperlinqs (because Data Grids only show nesting one level deep), which resolve themselves into a new output panel when you click on them. This is all well and good.
*Not sure on the technical term, sorry

Interestingly, I have noticed that:
  1. If all the values in the column are of the same type, then each cell contains a Hyperlinq, rendered with the name of the column. However, quite often the value in the cell is null, and I find it annoying/tedious to click on the Hyperlinq just to see that this is the case.
  2. Otherwise (when not all of the values in the column are of the same type), null values appear as null, and non-null values are displayed as Hyperlinqs containing the name of the type of the value in the cell.
Basically, I was wondering, is there a way to get the data grid to always show nulls as null and only show Hyperlinqs for non-null objects, even when the column only contains one type? Personally I'm not too bothered about whether the Hyperlinq displays the name of the column of the type of the value in the cell, but basically I want it to be clearer from a glance which values are null and which aren't.

To explain what I mean in examples, the following (C# statements) code shows this behavior:

var rand = new Random();
// 1: shows a column full of "b"s that may or may not resolve to null when you click on each one - because they are all the same non-value type. Ideally, it would either show null or a Hyperlinq.
Enumerable.Range(1, 15).Select (e => new { a = "a", b = rand.Next(0, 2) == 0 ? null : new { d = 5 - e }, c = e }).Dump();
// shows null where applicable, because value type
//Enumerable.Range(1, 15).Select (e => new { a = "a", b = rand.Next(0, 2) == 0 ? null : (int?)e, c = e }).Dump();
// 2: the following is the behavior I would like to see when all values in the column are the same type:
Func ex = i => i == 0 ? null : i == 1 ? (object)new { d = "example" } : (object)EventArgs.Empty;
Enumerable.Range(1, 15).Select (e => new { a = "a", b = ex(rand.Next(0, 3)), c = e }).Dump();
Mostly I use output in rich text to get around this "problem", but there are times when I find data grids preferable. I wonder if anyone else feels the same? :)

Thanks for your time reading this ;)

RFE: right-click editor tab menu option 'open in new instance'

$
0
0
A fairly common need for me is trying to view 2 LINQPad scripts side-by-side to compare them, bring bits of one over to the other, etc.

My current workflow to do this is to right-click on one of the scripts in the existing LINQPad instance, copy full path, open a new LINQPad instance, open, paste path, enter.

Now, I realize that trying to support horizontal/vertical/whatever splits within the existing LINQPad UI would likely be a huge amount of work, but I'm hoping LINQPad could add the 'open in new instance' type of feature that Notepad++ has.

This would likely just run the current .exe and pass the full path to the current script as the parameter (so no need to add any kind of automation interface just for this), but would be a nice addition to simplify this particular workflow.

image

Thanks!

C# Statement works for SQL Server Table...but not for SQL Server View

$
0
0
Hello,

I'm new to LinqPad even though I've owned it for a few years I'm just starting to work with it now. I've run into an issue that is confusing me and can't find an answer to this on stackoverflow or Google search. I'm using a simple C# Statement.

// this is a table in SQL Server and this statement works
ES_RTH_Compact.Take(1000).Dump();

// this is a view in SQL Server and it errors with: "Specified cast is not valid."
V_ES_RTH_Compact.Take(1000).Dump();

The view is valid. I can run a top 1000 query in SSMS and it works.

Thanks,
Mark

Shift-F1 (Reflector) option missing in LinqPad 5

$
0
0
Any reason for this and/or plans to re-emable it?

Code Contracts?

$
0
0
Is it possible to use code contracts in LINQPad scripts? I'm starting to play with these and as I use LINQPad as a scratchpad/snippet editor it would be nice if I could test contract code in LINQPad.

Customizable keyboard shortcuts?

$
0
0
Just upgraded to the Premium Edition of new v5.0.
Congratulations with a nice product!

Ever since I started to use LINQPad (years ago) I have missed a way to set up my own keyboard shortcuts. The default keyboard codes are mostly fine, but there are a few custom codes I hardly depend on from other IDEs. Especially for the various stepping commands in the debugger, but also for some of the text editor commands. Are there any plan to implement a simple keyboard shortcut editor so we can feel more like home with the LINQPad keyboard map?

Having trouble using a DbContext connection defined in a DLL

$
0
0
I have a working DbContext-derived class defined in a DLL, and I want to reference that in LINQPad. So I added a connection and chose Entity Framework (DbContext). I then selected the path to my DLL and LINQPad automatically discovered my class - IntegratorContext.

I selected the option "Via a constructor that accepts a string", and I typed the exact parameter that is passed into IntegratorContext's constructor in my code, which is:

Data Source=.\SQLExpress;Initial Catalog=Integrator;Integrated Security=True;Persist Security Info=False;User ID=SA;Password=;MultipleActiveResultSets=True;Packet Size=4096;Application Name=Integrator

When I click the "Test" button in LINQPad, I get the following error:

Error: The ConnectionString property has not been initialized.

I'm not sure what to do at this point. My application runs, and that's the constructor I'm using. What do I need to do in order to access this DbContext via LINQPad?

error message "handle is invalid" using program mode.

$
0
0
I have tried sample code that runs fine in visual studio and command line compilation but I get the above error when using linqpad. The samples in linqpad run fine, why can't I paste sample code from msdn?

here is an example:

// This example demonstrates the
// Console.CursorLeft and
// Console.CursorTop properties, and the
// Console.SetCursorPosition and
// Console.Clear methods.
using System;

class Sample
{
protected static int origRow;
protected static int origCol;

protected static void WriteAt(string s, int x, int y)
{
try
{
Console.SetCursorPosition(origCol+x, origRow+y);
Console.Write(s);
}
catch (ArgumentOutOfRangeException e)
{
Console.Clear();
Console.WriteLine(e.Message);
}
}

public static void Main()
{
// Clear the screen, then save the top and left coordinates.
Console.Clear();
origRow = Console.CursorTop;
origCol = Console.CursorLeft;

// Draw the left side of a 5x5 rectangle, from top to bottom.
WriteAt("+", 0, 0);
WriteAt("|", 0, 1);
WriteAt("|", 0, 2);
WriteAt("|", 0, 3);
WriteAt("+", 0, 4);

// Draw the bottom side, from left to right.
WriteAt("-", 1, 4); // shortcut: WriteAt("---", 1, 4)
WriteAt("-", 2, 4); // ...
WriteAt("-", 3, 4); // ...
WriteAt("+", 4, 4);

// Draw the right side, from bottom to top.
WriteAt("|", 4, 3);
WriteAt("|", 4, 2);
WriteAt("|", 4, 1);
WriteAt("+", 4, 0);

// Draw the top side, from right to left.
WriteAt("-", 3, 0); // shortcut: WriteAt("---", 1, 0)
WriteAt("-", 2, 0); // ...
WriteAt("-", 1, 0); // ...
//
WriteAt("All done!", 0, 6);
Console.WriteLine();
}
}
/*
This example produces the following results:

+---+
| |
| |
| |
+---+

All done!

*/

Fonts resize after confirming preferences

$
0
0
This happens every time you go to the Preferences menu (Edit -> Preferences) and press OK also if you don't change anything. So, if I have enlarged the font size, (well I am a bit old now and prefer a font with a larger size than 8) I need to resize it again (and sometimes the first Ctrl+MouseWheel actions are not accepted). This is annoying because I need to change very often the Option Strict On/Off for VB.NET snippets. Is it possible to avoid resizing the font after a confirmation on the preferences dialog? (Or add a full featured Font Dialog where I can set my font size once and for all? )

LinqPad 5 and .Net Framework 4.6

$
0
0
When installing LinqPad 5, it states the need for .Net 4.6. Clicking the install link takes you to Microsoft where the page states, "An app you tried to use needs .NET Framework 4.6 in order to run. The best version to use is .NET Framework 4.5.2, which will start downloading in x seconds.". Following the install of .Net 4.5.2, LinqPad 5 will not run. Has anyone else solved this?

how to tell how long it took a query to run?

$
0
0
in both LINQPad 4 and 5, I will often run a query (C# Expression) and see while it's running the timer going to show how long it's taking so far. Even when the query takes well over 30 seconds, once it completes the status bar says something like "Query successful (00:00.073)". I'm not sure which part of the process the 73 milliseconds is from, but outside of adding my own Stopwatch at the top and bottom, is there a way to tell how long the query took to run?

Is this a LINQPad bug and the time shown after 'Query successful' should have been the full runtime?

Thanks!

Util.CurrentQueryPath remains null after saving (v5)

$
0
0
Problem:
- Util.CurrentQueryPath returns null directly after saving

Steps to reproduce:
- Open new query window
- Enter expression: Util.CurrentQueryPath
- Run query (output = null, expected)
- Save query
- Run query (output = null, NOT expected)
- Switch tab (forth and back)
- Run query (output = null, NOT expected)
- Unload query process (SHIFT-F5)
- Run query (output = null, NOT expected)

Tested in:
- v4.55.03 => OK
- v4.57.02 => OK
- v5.02.03 => NOT OK

Tested on:
- Windows 10
- Windows 2012R2

Workaround:
- Close and reopen query

Choosing the Visual Studio debugger says "Find Source LinqPadQuery.cs"

$
0
0
I haven't been able to use the Visual Studio for debugging since it asks to locate the LinqPadQuery.cs file
http://snag.gy/QMu2W.jpg

I have the Premium edition with debugging. It used to work for me before when I had the Pro edition without the debugger.

Odata connection in LinqPad gives (403) Forbidden error

$
0
0
I have LinqPad 4 installed on my machine. I am trying to use LinqPad for generating a URL for Odata/Excel for MS Project server 2013. When I try to add a connection using the below URI in LinqPad using odata driver, it's giving me the below error. The error is the same with or without my login credentials. Any ideas?

URI -> https://companyname.sharepoint.com/sites/pwa/_api/ProjectData/

WebException: The remote server returned an error: (403) Forbidden

Zoom Quirk

$
0
0
Action: Ctrl+MouseWheelUp

Location: Editor window | Result: Zoom in
Location: Roslyn Syntax Tree window | Result: Zoom out

LINQPad fails to start due to update system violating group policy

$
0
0
Hi Joe, another Group Policy issue you should be aware of, similar to http://forum.linqpad.net/discussion/761.

LINQPad detected a new update (457), downloaded it, and prompted me to install it. I tried multiple times but it kept throwing a security exception (violates group policy). It also wouldn't let me close the application (I assume it's trying to update on close).

I managed to kill it with task manager, but then it wouldn't start again with the same issue (I assume it's trying to update).

After digging through with process monitor I found the cause; the update is downloaded to the C:\ProgramData\LINQPad\Updates40\457 folder. Trying to run it manually from here triggered the same exception; either this exe, or whatever it's doing, violates our group policy.

I fixed the problem manually by copying the new files over the top of the install in C:\Program Files (x86)\LINQPad4\ (presumably this is what the LINQPad update system does) and it's all good; I'm now running v4.57.02.

I'm not sure if there's anything you can think of to improve things in the future.

What is the best way to share Queries with SQL Authentification on an Network Drive

$
0
0
The Linq file include the User and the encrypted Password. It looks that he password is encrypted with DPAPI. That mean that i can call this Query with lprun.exe but no other user in my company, they can't connect to the SQL Database . What is the best strategy to share queries with other user without additional configuration(create named connections on each user computer) and external (Instand share) Cloud.
Thanks Wolfgang
Viewing all 2710 articles
Browse latest View live


Latest Images