I'm trying to use SQLCE in a Custom Assembly DbContext, but LINQPad insists on using the SQL provider instead. More info, including screenshots, can be found here:
https://stackoverflow.com/q/53137282/722393
The 'Keyword not supported' error occurs because the connection string builder is using SqlCeClient's .CaseSensitive keyword, which is not supported in SqlClient.
Any idea how I can get LINQPad to use the SQLCE reference that I've specified?
↧
LINQPad is ignoring an assembly reference
↧
Memory usage in 5.31
I'm extracting a lot (1000s) of varbinary records to the file system and memory usage starts out at a couple hundred MB, but slowly grows until the system crashes (if I'm not around to stop and start the script).
Here's the code using a Linq to SQL connection.
var folderBase = "\\\\myserver\\share$\\files\\";
var records = Forms.Where(r => r.PDF != null && r.ImageGuid == null).Select(r => r.ID).ToList();
foreach (var rec in records)
{
var image = Forms.Single(i => i.ID == rec);
var file = image.PDF.ToArray();
var docGuid = Guid.NewGuid();
if (!Directory.Exists(folderBase + docGuid)) Directory.CreateDirectory(folderBase + docGuid);
File.WriteAllBytes(folderBase + docGuid + "\\" + image.ID + ".pdf", file);
image.ImageGuid = docGuid;
SubmitChanges();
image = null; // try this to release memory
file = null; // try this to release memory
}
↧
↧
Multiple context in query
I was able to hold down Ctrl key and drag two different DB from the same server into the query, and the Connection indicates DB1 + DB2. Now the context of the query seems to be that of the second DB connection added. I have been unable to find out how to use a context for the first DB added. I am looking for a link to some instruction or example.
↧
System.Globalization
I am running this code:
let dateRange (first:System.DateTime) count =
seq {for i in 0..(count-1) -> first.AddDays(float i)}
and getting this message:
"The type referenced through 'System.Globalization.CultureInfo is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Globalization'. (using external F# compiler)
I added System.Globalization.dll to the Query Properties/Additional References tab and I am still getting this message. What is wrong?
↧
Util.Run - return an object from sub query?
Is there any way to return an object when using Util.Run?
I keep getting an error:
Object of type 'System.Object[]' cannot be converted to type 'System.String[]
I've tried returning a dynamic, an object, and a string, but all fail with the same error.
My subQuery that is being called from another query with Util.Run has signature:
string Main(string[] args)
↧
↧
Any way to disable or limit Linqpad "Fetching schema"
I have a query which uses 2 databases. One of the databases is quite large with many tables, sprocs, and views. When executing a saved query which uses the connection Linqpad goes into "Fetching schema..." mode and it takes a couple of minutes due to the large schema.
Is there any way to disable the schema update or whatever Linqpad is doing for select queries, or connections? Not sure if Linqpad can cache the schema, or something like that?
↧
NuGet not working - FatalProtocolException
Recently, whenever I go to the LINQPad NuGet Manager, I got a "NuGet.Protocol.Core.Types.FatalProtocolException", and I cannot install new packages. The details are "Unable to load the service index for source https //api.nuget.org/v3/index.json". This URL works fine from my browser, and NuGet works fine from VS. I am not using proxies. Tried restarting my computer.
Thank you.
↧
Linqpad crashing
Since updating to v5.36.03 linqpad has crashed and closed every time I try to run any query without showing any error messages.
The only information I've found is the following in the log file...
5.36.03 2018-11-19T11:34:57.8770891+00:00 SymbolManager -
COMException: Exception from HRESULT: 0x806D0005
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at System.Diagnostics.SymbolStore.SymBinder.GetReader(IntPtr importer, String filename, String searchPath)
at LINQPad.Reflection.Internal.LocalVariableNameReader.SymUtil.GetSymbolReaderForFile(SymBinder binder, String pathModule, String searchPath)
at LINQPad.Reflection.Internal.LocalVariableNameReader.SymUtil.GetSymbolReaderForFile(String pathModule, String searchPath)
at LINQPad.Reflection.Internal.LocalVariableNameReader..ctor(MethodBase m)
at LINQPad.Reflection.Disassembler..ctor(MethodBase method, ILStyler styler)
First chance data:
I've tried uninstalling and re-installing, have also installed the any cpu version which crashes in the same way.
Any ideas? I'm struggling to do any work without Linqpad haha
↧
Virtual (text) files
I often need to manipulate a improvised text file, i.e. XML.
Right now, I need to create a file on disk and do a File.Read.. from disk. And at the end I'd delete the file from disk.
I wonder whether the former step could be handled by Linqpad itself - I'd open a string editor where I'd past my content and Linqpad would provide me access to this content through a variable or a stream.
Just an idea.
↧
↧
support for CREDENTIALPROVIDERS for nuget in LinqPad
I am using VSTS package feed for my project and it requires custom credential provider for nuget feed authentication.
I tried putting VSTS Credential Provider at LinqPAd/nuget but it is not working. I doubt if LinqPad has support for it. can some one confirm if it is supported then how to configure it ?
FYI - for general info on credential provider http://docs.nuget.org/ndocs/api/credential-providers#using-a-credential-provider-from-an-environment-variable
↧
Hooking up System.Reactive 4.1.2 to new LINQPad.Controls events throws exception on Subscribe
Hi,
I'm attempting to hook up the TextBox.TextInput event using System.Reactive, but keep getting the Exception: ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type. Is it simply too late at night? What am I missing?
Namespace imports:
LINQPad.Controls
System.Reactive
System.Reactive.Linq
void Main() { var textBox = new TextBox(); var observable = Observable.FromEvent(h => textBox.TextInput += h, h => textBox.TextInput -= h); observable.Subscribe(o => o.Dump()); textBox.Dump(); }
↧
LinqPad 5 failed to connect to localhost sql Windows Authentication. LinqPad 4 does not fail.
I've used LinqPad 4 for a while, without any problems. I have a connection to my local SQL server using Windows Authentication.
Now I just installed LinqPad 5, and after starting, the connection list of LP4 is shown, but the connection to my local sql server has an error in LP5: Error: Login failed for user '[domain]\[username]'.
Which is strange, other connections to sql servers (not on my local machine) do not fail using Windows Authentication.
Note that it works in LP4, but not in LP5.
↧
Select values over multiple rows in one column in a SQL Result Set
I would like to be able to select multiple values in a column in the result set from a sql query. Today all cells "between" the first and the last value are also selected.
If there are 5 rows of data with multiple columns in the result set. Then from column Id I would like to select values from row 2 to row 4, then only those 3 values in that column should be selected.
↧
↧
Maybe add Shift+F8 to hide left pane to the "Query" menu.
I found out about it at: https://linqpad.uservoice.com/forums/18302-linqpad-feature-suggestions/suggestions/2686041-keyboard-shortcut-to-hide-left-pane-for-maximum-vi
I was looking for it on the "Query" menu but didn't find it. I expected it to be near "Show Results".
↧
Update IQ Driver to be able to connect to Oracle 12.2.0.1.0
When I try to connect to an Oracle 12.2.0.1.0 instance, I get the following error: ORA-28040: No matching authentication protocol.
I presume it's because the Devart library included in the IQ driver is outdated. See https://forums.devart.com/viewtopic.php?t=36439
Can you update the driver please?
Ps: you can reproduce this by trying to connect to a local Oracle database hosted in a Docker container (for free), see https://store.docker.com/images/oracle-database-enterprise-edition
Further information:
Linqpad 5 (developer edition) v5.31.00
IQ Driver v2.1.4.0
↧
BUG: "View in Grid" hover arrow not displayed on grids after first screen of Results
When a Dump list is wider than the screen, LINQPad conveniently adds a hover arrow for the "view in grid" option in the upper right of the results so the user does not have to scroll horizontally to invoke "view in grid".
However, if a later grid result from the same query is below the first screen scroll of Results, the hover arrow is not shown on the later grid, so the only way to invoke "view in grid" is to scroll all the way to the right and find the static arrow.
C# Program to reproduce:


void Main()
{
var l = new List();
for (int j = 0; j < 20; j++)
{
var o = new ExpandoObject();
var d = (IDictionary)o;
for (int i = 0; i < 30; i++)
d[$"Property{i}"] = $"Value{i}";
l.Add(o);
}
l.Dump("Dump 1");
l.Dump("Dump 2");
}
Set screen small enough or i and j max values large enough such that Dump grid is larger than the Result window, both vertically and horizontally. First grid will have the hover arrow, second grid will not.
↧
Support for cloud service provider: Aliyun(阿里云)
Currently, LINQPad believe Aliyun virtual machine as a regular machine. Looks like LINQPad does not support cloud service provider aliyun(阿里云) virtual machine.
Aliyun is the most popular cloud service provider in China, add support for Aliyun is a great benifit for me.
Should you need any additional details, I can provide any hardware information about the virtual machine I can get.
↧
↧
LINQPad is executed from ProgramData after upgrade
Hi,
I'm using LINQPad as portable and most often AnyCPU version.
And thanks to using queries/plugins folders located in the same place as executable I was able to have all my scripts/extensions available when I run LINQPad using whatever user.
But lately after upgrade I noticed that I don't have any scripts in the MyQueries window. I noticed that real place from where the LINQPad was started changed. It wasn't the portable folder I had but: C:\ProgramData\LINQPad\Updates40.AnyCPU\459.
Can this be somehow disabled so I don't have to manually copy/delete files after upgrades?
Best regards,
Beniamin.
↧
tips for editing large C# program .linq files?
Sometimes I need to edit to edit a file with is around 1k to 10k lines in size. The vast majority of the lines are from an array declaration (data to be imported) like this:
public ImportRow[] Data = new ImportRow[]
{
new ImportRow { [...row of values...] },
new ImportRow { [...row of values...] },
new ImportRow { [...row of values...] },
[repeat a few thousand times]
};
The editing experience in linqpad works great as usual if I remove most of those lines and just leave a few, but if all the lines are present, editing will often block the UI thread for 30 to 90 seconds at a time.
My current workaround is to cut most of the lines out and put them into another text editor while working on the script, then paste them back in when it's time to run, but it'd be ideal if I didn't need to do that. It's not a horrible workaround, but it's annoying enough that I thought I'd ask for some tricks and tips to help. :)
Thanks!
↧
Disable LazyLoading in EFCore driver
Is it possible to avoid using LazyLoading with the EFCore driver? The reason this is needed is that lazy-loading is not supported for detached entities, so, for example, if a query uses an extension method for an entity that accesses its "navigation" property, an exception is thrown.
↧