Hello
I have a stored procedure that I am calling through Entity Framework.
The stored procedure has 2 date parameters. I supply different argument in the 2 times I call the stored procedure. I have verified using SQL Profiler that the stored procedure is being called correctly and returning the correct results.
When I call my method...
I have a weighted graph with its nodes and edges.
Each node contains a LinkedList called edges that stores the edges of this node. Each edge has an weight and a node (node at the other end).
I already did this:
static void removeEdge(Node n1, Node n2)
{
n1.edges.Remove(n1.edges.First(a => a.node == n2));
n2.edges.Remove(n2.e...
I have a list of string, which is most likely, but not guaranteed to contain a list of numerics, i.e.,
{"1", "6", "2", "21", "89"}
What is the way to sort the string list so that it will always appear in ascending order?
I can't parse the string to numeric first before doing the sorting simply because the string can contain non nume...
hi all,
I know how to write to xml files, but I'm having trouble doing what I need to do and can't find adequate info on this type of problem.
Here's one xml file below:
<?xml version="1.0" encoding="utf-8"?>
<controls>
<Label Content="Double-click to edit." Location="258, 178" Size="101, 13" ForeColor="-1" />
<LinkLabel Con...
Hello,
I have an Xml file. It's format is as follows:
ControlType > Content > LocationX > LocationY > ForeColor/LinkColor > Int > Int > Int > Int
File example:
<?xml version="1.0" encoding="utf-8"?>
<cs>
<Label Content="Double-click to edit." LocationX="583" LocationY="254" A="255" R="255" G="255" B="255" />
<LinkLabel Content="...
Hello
I have had a problem where it appeared as though the second execution of a stored procedure was being ignored.
The first time I call my stored procedure it found 20 records and extracted information for the date range August 2009. The first line was meter id 233 with a data value 200
I then called the stored procedure and 20 re...
im just starting to learn LINQ and at the same time im working on a research project for school on using link to entities with oracle and DB2 im trying to find a tool or addon that i can use to test my result sets so that i can run a linq query and see the resulting data i have seen LINQ pad but it seems to be set up for microsoft sql ...
how do I implement something like this in linq. In my linq code it gets the best answers where the answer userID does not equal the Question userid. This is suppose to filter users picking their own post as best answer. If the user picked their own answer as best answer then it must be upvoted at least 3 times.
var AwardedAnswers = from...
I have a table that has a blob column representing a file.
I'd like to run a LinqToSql query that returns a name and description of the file, along with the file size... but in the interests of not killing performance, I obviously don't want to download the whole blob!
var q = from f in MyFiles
select new {f.Name, f.Description,...
Hi,
Can someone help me out with the following Linq statement? I'm trying to get join 4 tables through Linq, group by the last table and sum a property of the first.
var payments = (
from payment in db.Payments
join payees in db.cmsMembers on payment.PayeeID equals payees.nodeId
join paye...
I have this query that is bothering me; it is encapsulated as a new query operator, I made two versions of it, trying to see which one performs better. Both perform horribly.
First attempt; declarative style
public static IEnumerable<IEnumerable<α>> Section<α>(this IEnumerable<α> source, int length)
{
return source.Any()
? ...
Is it possible to write the following 'foreach' as a LINQ statement, and I guess the more general question can any for loop be replaced by a LINQ statement.
I'm not interested in any potential performance cost just the potential of using declarative approaches in what is traditionally imperative code.
private static string SomeMeth...
Our system stores XML strings in a database. I've recently had to change the Properties on a Class, and now when an XML string gets deserialized it will throw an exception. What is the best way to handle this change? Look for the Node in the application code using XPATH or LINQ, or change the xml string in sql database (ie do a mass u...
Hello.
lets say that I've got this XML:
<items>
<item name="thumb">
<downloadStream>test1</downloadStream>
<downloadStream>test2</downloadStream>
<downloadStream>test3</downloadStream>
</item>
<item name="photo">
<downloadStream>test5</downloadStream>
<downloadStream>test6</downloadStream>
<downl...
I have a WCF service which sits in front of a data collection. I would like to have a service call where the client could pass in a LINQ query, or Expression Tree, to be executed against the data collection. Is there a reasonable way to pass a LINQ query to a WCF service call?
Thanks.
...
I'd like to create a LINQ query that returns the sum of all quantities for a given productnumber for a parent account and all it's child accounts.
I have a table of products by account number in which each row also contains a qty and the parent account number:
PartNumber AccountNumber ParentAccountNumber Qty
---------- ------...
I have the following table structure which has been imported into the Entity Framework. I need to write a LINQ query where I select the entities of Table1, where a field in Table2 is equal to true, and a field in Table 3 is equal to a specific GUID.
Could someone help with this?
Thanks you.
...
I was wondering if it was wise to cache the Entity Framework's ObjectContext object in the Cache; will this give me issues with multiple connections at the same time that the user will experience issues with that?
I've gotten errors like: 'connection is currently closed' and wondered if that was due to multiple users and caching the Obj...
I've the following query
var x = from t in v
group t by t.Time.Year + "-" t.Time.Month + "-" +
t.Time.Day + " " t.Time.Hour + ":" + t.Time.Minute into g
select new { Tag = g.Key, Frequency = g.Count() };
t.Time is a DateTime. The above smells a bit i.m.o. Are there any cl...
Which layer is the best layer to make linq-sql calls as SubmitChanges(), InsertOnSubmit() etc.
For example, let's say I have two tables Parent and Child. Child table has foreign key on parent (Child table has ParentId column). I want to insert parent object and child objects into the db.
Using linq-sql, I can do this.
Parent parent =...