linqpad

LinqPad Feature - Does VS do this?

Linqpad, when coding in C#, will draw a vertical line between opening and closing curly braces. Boy, oh boy, I sure do wish Visual Studio would do this. Does it? Is there anyway to make it do it? ...

Is there a LINQPad equivalent to a DataContext class?

I've just begun using LINQPad and so far I like it but most tutorials I have come across for LINQ TO SQL make use of a DataContext class which is generated by Visual Studio for persisting updates etc. I am also fairly new to LINQ TO SQL so my question is what is the equivalent of the following in LINQPad (if there is one)... MyDbDataCon...

How to select across a relationship using LINQPad?

I have a simple table structure Images(image_id, image_library_id,...) Links(link_id, image_id, link_component_code...) I am trying to perform a simple query using LINQ var q = from i in Images where i.Link.link_component_code = "x" select i; However the intellisense in LINQPad doesn't provide the "Link" object in where i.Link.li...

linqpad + linq2sql custom model

Hi, I'm trying to get LinqPad use my dbml model so I could analyze a query from my source code. I've set the DataContext to "Custom LINQ to SQL DataContext", and all the necessary settings, unfortunately even with the simplest query I get an error : QUERY: from m in Linia select m ERROR: Could not find an implementation of the query pa...

database inspection while debugging

I am trying out some cascade options with nhibernate mapping and have a unit test where I'd like to use a tool to inspect the state of the database. I was hoping I could use linqpad to do this, but the connection seems hung while in the debugger. I'd seen a demo not to long ago where SSMS was being used to inspect the db during a debug, ...

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

I have a linq query function like (simplified): public IList<Document> ListDocuments(int? parentID) { return ( from doc in dbContext.Documents where doc.ParentID == parentID select new Document { ID = doc.ID, ParentID = doc.ParentID, Name = doc.SomeOtherVar ...

How does LINQPad reference other classes, e.g. Books in the LINQ in Action samples

I'm using LINQPad to create LINQ queries in an application I'm bulding. I noticed that in the downloaded LINQ in Action samples, e.g. example 4.04, intellisense shows a class "Books" but I don't see any references or "using" statements in the LINQPad tool, here is the sample: List<Book> books = new List<Book>() { new Book { Title="LI...

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 asking the rest of my team to make this switch. Does anyone have any thoughts / ideas on ...

linqpad installation problem.

The install is going through just fine. I am unable to launch it post-install. I get an error saying 'Application failed to initialize properly. (0x0000135). Click OK to terminate." Please help. ...

Can I compare IL code to determine which technique is faster or better?

Background This question got me thinking about something. Lately, since I've been looking at linq pad's IL functionality, I've been comparing the IL code of two approaches to the same problem to "determine" which is best. Using the question linked to above, about converting an array, I generated the IL code for the two answers: var a...

LINQPad and Oracle

Does LINQPad work with Oracle? Has anyone tried? What do you suggest? ...

LinqPad, using multiple datacontexts

I am often comparing data in tables in different databases. These databases do NOT have the same schema. In TSQL, I can can reference them with the DB>user>table structure (DB1.dbo.Stores, DB2.dbo.OtherPlaces) to pull the data for comparison. I like the idea of LinqPad quite a bit, but I just can't seem to easily pull data from two d...

LINQPad for .NET 4.0

Using LINQPad, I am trying to test a few snippets with my own C# objects, which are written in .NET 4.0 (Beta 1) using VS2010 B1. When I try to use it, I get the following message in LINQPad: BadImageFormatException: Could not load file or assembly 'file:///C:...\XX.dll' or one of its dependencies. This assembly is built by a runtime ne...

How to declare variable in LINQPad

Hi all, Do you know how to declare variables in LINQPad in order to hold the query result and use it later in multiply queries? Thanks! ...

How do I view an expression tree with LINQPad?

Maybe I'm missing something obvious, but I how can I view the expression tree for this query: from word in "The quick brown fox jumps over the lazy dog".Split() orderby word.Length select word using LINQPad? ...

Why does .Equals not work in this LINQ example?

Why does this yield an empty set? Object[] types = {23, 234, "hello", "test", true, 23}; var newTypes = types.Select(x => x.GetType().Name) .Where(x => x.GetType().Name.Equals("Int32")) .OrderBy(x => x); newTypes.Dump(); ...

linqpad 4.0 and code only

how do i linqpad with code only in ef 4. i mean how to reference metadata when there is no edmx file? ...

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 and checked all the menu items. I'm not sure if I can change XML settings to include more ...

Please help me convert a Linq Query to a SQL Query... Desperate...

Hey all, Im pretty proficient in LINQ, but not in SQL. I understand cursors are horrible and shouldn't be used. I know SQL Syntax pretty well, but I am trying to figure out how to convert this query and update to SQL from Linq. I don't know how to go through the Foreach of SQL without using cursors and Im a bit lost on what to do ne...

LINQPad - Log Secondary DataContext to "SQL" Tab

Its easy enough to instantiate multiple DataContexts in LINQPad. Is there any way to set these instances to Log to the "SQL" Tab of the results pane? Setting myDataContext.Log = this.Log doesn't work. ...