This SPROC "returns" a table with two columns: Id, Score.
Is it possible to execute this SPROC and include the custom data-type as parameters from within Entity Framework?
ALTER PROCEDURE [presenta].[SearchLpi]
// The presenta.IdTableType is a table with just one column "Id"
@selectedLpis presenta.IdTableType READONLY
AS
BEGIN...
Embarrassing question really -- I have Subsonic collection, then I filter out some data using Where.
MyColl.Where(it => it.foo()==true)
now I would like to pass those data still as Subsonic collection. How to do it (the most properly way)? I checked constructor for Subsonic collection, ToX() methods, and googled.
edit: Subsonic 2.x...
Does the LINQ syntax match the T-SQL order of execution? I suspect it does and thus the reason for the change in query order between SQL and LINQ but wanted some proof.
...
Trying to read into an object the following XML file (can be changed) into a VAR using LINQ XML.
<?xml version='1.0'?>
<config>
<report>
<name>Adjustment Report</name>
<extension>pdf</extension>
<filetype>adobe_pdf</Filetype>
<field name="total" type="currency" />
<field name="adjust" type="cu...
hello,
i have the following linq query:
using (var db = new MyDataContext())
{
int[] onlineUsers = GetOnline();
var users = (from u in db.Users
orderby
(onlineUsers.Contains(u.u_username) && u.u_hasvisible_photo) descending,
u.u_lastlogin descending
select u.u_username).Skip(startRowIndex).Take(maximumRows).ToList();
}
...
How do I sort a DataTable on the client side using LINQ? (Server side sorting is not supported with my data store)
I was doing something like this which doesn't work
IEnumerable<DataRow> dr = GetDataTableData().AsEnumerable();
if (sortDirection == "Ascending")
{
dr = dr.Or...
Lets say I have a collection of Messages which has the properties "UserID" (int) and "Unread" (bool).
How can I use LINQ extension methods to set Unread = false, for any Message in the collection in whose UserID = 5?
So, I know I can do something like:
messages.Any(m => m.UserID == 5);
But, how do I set the Unread property of each o...
I have this code that returns a caseID from an Alleged Perpetrator table. This table also has a column "LastName". I want to search on caseID and return LastName but I don't know how to code it. I've been on the microsoft site looking for LINQ to SQL examples but still can't figure it out. Any help would be greatly appreciated!
Ken
pub...
Hi
I have this query
return plannerDb.IndividualCalendars.Where(u =>
u.UserId == userId &&
u.StartDate.Date >= startDate &&
u.EndDate.Date <= endDate)
so basically what this query does is that is looks for all calendar events that range from the start of that month to the end of that month.
However this does not accou...
I have this LINQ-query:
// types...
LinkedList<WeightedItem> itemScores = new LinkedList<WeightedItem>();
var result = from i in _ctx.Items
join s in itemScores on i.Id equals s._id
orderby s._score descending
select new ItemSearchResult(i, s._score);
// this fails:
...
I have a list of items that have a partial order relation, i. e, the list can be considered a partially ordered set. I want to sort this list in the same way as in this question. As correctly answered there, this is known as topological sorting.
There's a reasonably simple known algorithm to solve the problem. I want a LINQ-like impleme...
OK, first off, I'm brand new to LINQ2SQL so excuse my ignorance.
I've done some searches, but after 1 hour, I decided to come here.
Here goes:
I'm trying to do something that I think is very simple. It could just be that I don't understand. I'm using LINQ 2 SQL, via the VS designer. I have 2 tables: Clients and Categories. A client ca...
How do I write this query in linq VB.NET?
select top 15 count(1), A.Latitude, A.Longitude
from Bairro A
inner join Empresa B on B.BairroID = A.BairroID
where A.CidadeID = 4810
group by A.Latitude, A.Longitude
order by COUNT(1) desc
I reached this code:
Dim TopBairros = (From A In Bairros _
Join B In New BO.Empresa()...
Hi guys,
I need to extend a subsonic generated (using linq templates)
I have created the class with the same name and namespace in the same project
when I run a query like this
IMBDB db=new IMBDB();
var r = (from query in db.Articles
join cat in db.ArticleCategories on query.CategoryID equals cat.ID
where query.ID == art...
I got a weird problem here like I got a site that users can post comments on a friend profile page.Everytime a user post a comment my application sends e-mail to that page owner, you know to inform for a new posted comment on his/her profile page.The problem is I want to stop the application from sending email if that user has just recen...
Microsoft is pretty clear that .NET "identifiers" or "parameters" should not contain abbreviations. Straight from the horse's mouth:
To avoid confusion and guarantee cross-language interoperation, follow these rules regarding the use of abbreviations:
Do not use abbreviations or contractions as parts of identifier names. For ...
Class Customer has the following method, which returns an IQueryable with the linq query to get the active sales for a customer:
public IQueryable<SalesHeader> QueryCurrentSales()
{
// this.SalesHeaders is an association defined in the DBML between
// the Customer and SalesHeader tables (SalesHeader.CustomerId <-...
I need to determine if any of the Lists contained in the Dictionary contain the specified value. I'm new to LINQ, so is the following the correct way to achieve this?
Dictionary lotsOfStuff = new Dictionary<string, List<string>>();
string searchString;
// populate lotsOfStuff and searchString...
// detemine if any of the values of lot...
Hi
I have data like this
id = 1<pk>
SDate = 12/12/2009
EDate = 12/12/2009
binding = a_1
userid = 14
id = 2<pk>
SDate = 12/12/2009
EDate = 12/12/2009
binding = a_1
userid = 14
I want to group my data by binding. I am not sure how to do this though. Do I have to make a new select to do this?
so far I have this
Db.Table.Where(u => u...
I try to add a record to SQLServer db table using LINQ to SQL in my WPF app, but always get an error regarding missing directive. Usually intellisense gives a hint on such issue, but not this time. Here my code with all directives:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows...