I need to create a method that will take Linq-to-sql entity and return a list of all it's children(only 1st generation) entitysets, without any data that entitysets contain, just names. Is there any way I can do that? Thanks
...
I have an interesting problem and wanted so see if anyone else has seen this. I've created a MVC 2 site using Visual studio 2010 beta 2. I'm using linq to sql data model objects with data annotations.
In my data model objects I'm using [ScaffoldColumn(false)] attribute to exclude the foreign key ID's from rendering to the UI when I use...
So far after watching the tutorial videos on link, im fine accessing one data table and dealing with the results. On putting this into practice at the office I am faced with a lot of joins that I need to convert to LINQ...
SELECT Modules.TemplateFileName
FROM Modules INNER JOIN
Grouping ON Modules.ID = ...
I am tasked to build a web 2.0 style mashup application which consumes a lot of 3rd party webservices like youtube and twitter. There are also lots custom features which are going to be built using ASP.NET 3.5 and SQL Server 2008. Now I am looking for the right ORM for my needs. From a performance and ease of use standpoint can anyone su...
I've inherited a database that wasn't designed exactly optimally, and I need to manipulate some data. Let me give a more common analogy of the kind of thing I have to do:
Let's say we have a Student table, a StudentClass table keeping record of all the classes he attended, and a StudentTeacher table that stores all the teachers who tau...
There are lots of discussion about using MONEY or DECIMAL datatypes in SQL Server for holding financial data. It seems all it is about possible lost of precision when using MONEY datatype.
If I understand it right, this situation may take place when we do calculation with these values in stored procedures using T-SQL.
Do I assume righ...
I´m trying to update a db record using linq to sql
First i query for it
MyObject obj = (from o in objRepository.List where(o.ID == id) select i).SingleOrDefault();
then I try to update and modify the data
obj.Name = "some value"
dataContext.Attach(obj)
dataContext.Context.Refresh(RefreshMode.KeepCurrentValues, obj);
I'm getting a...
I asked a question similarly, but the outcome was pretty messy and I was having difficulties populating so I'm trying to go at from a different angle:
http://stackoverflow.com/questions/2060835/question-concerning-asplistview-and-multiple-dynamically-created-controls
I have a table which stores steps in a process. Some companies only h...
I've tried many different ways to pass the selected items to the multiselect list with no luck. Finally, I tried this, which I think should display all the items as selected and still nothing in the list is selected.
public MultiSelectList Companies { get; private set; }
Companies = MulitSelectList(subcontractRepository.SubcontractCom...
I'm extending some Linq to SQL classes. I've got 2 similar statements, the 1st one works, the 2nd does not ("has no supported translation to SQL" error).
var reg2 = rs.ProductRegistrations().SingleOrDefault(p => p.Product.product_name == "ACE")
var reg5 = rs.ProductRegistrations().SingleOrDefault(p => p.product_name == "ACE");
After...
I've received an error report from a client recently and am having no luck resolving it. I'm hoping someone can give me some insight to what may be wrong.
The error seems simple enough:
Csla.DataPortalException: DataPortal.Delete failed (System.InvalidOperationException: Sequence contains more than one element at System.Linq.Enumerab...
I am trying to write a LINQ statement which selects only the rows in a table with the most recent rundate. For example, if I had a table with columns RunDate(datetime) and Value(decimal) one way of accomplishing this through sql might look like:
SELECT Value
FROM Table
WHERE RunDate = (SELECT MAX(RunDate) FROM Table)
Is there a way t...
Hello,
I'm just looking to perform a LINQ query to return a group of course ID's and Course Titles which are running next year. As part of this I need to perform an OR query as I'm also looking to return data relating to next year as well which is held as a string in my databse and is the only issue I'm having, so any help would be appr...
Since LINQ to SQL basically is a layer on top of ADO.NET it requires some translation. Does this mean that using ADO.NET directly is faster than LINQ? Or is the difference so small that it is irrelevant?
...
I'm populating a dropdownlist in c# asp.net-MVC from a SQL table using Linq2Sql. I'd like for the user to be able to enter something that isn't in the list into the drop down and have it add to the table. Is this possible?
...
I have Silverlight 3 project with a treeview which i populate from a table with hierarchical data using linqtosql via RIA domain services.
The problem I face is that the treeview displays both data from the top level and sub-levels side by side.
I have seen various examples of how to control this, but have not been able to do it myself...
I am using Visual Web Developer and Microsoft SQL server. I have a tag table "Entry_Tag" which is as follows:
entry_id
tag_id
I want to make the entry_id and tag_id pairing unique. A particular tag can only be applied to an entry once in the table. I made the two columns a primary key. They are also both foreign keys referencing the id...
I came across a rather strange problem with linq-to-sql. In the following example,
var survey = (from s in dbContext.crmc_Surveys
where (s.crmc_Retail_Trade_Id == tradeId) && (s.State_.Equals(state))
select s).First();
If tradeId is null, it doesn't behave as if I h...
I have some linq that returns the correct data.
var numEmails = (from row in EmailBatchProposal
where row.EmailBatchId == emailBatchId
select row.EmailBatchProposalId).Count();
However, if I understand linq correctly, this does not perform optimally. It grabs all the data and then walks through the list and counts the rows. What I'...
How is something like this done in linq? It has filter criteria on the JOIN.
This is taken from this question: http://stackoverflow.com/questions/1401889/sql-filter-criteria-in-join-criteria-or-where-clause-which-is-more-efficient
select salesman.salesmanid, max(sales.quantity)
from salesman
inner join sales on salesman.salesmanid =sa...