LINQ to SQL is a component of .NET Framework version 3.5 that provides a run-time infrastructure for managing relational data as objects.
0
votes
1answer
13 views
Is there a way to decorate an entity with an attribute via partial class?
I have Linq-to-SQL entities and I need to decorate one of their constructors with the <Inject()> attribute for Ninject-based dependency injection. Is this possible using a Partial class or any ...
1
vote
3answers
48 views
Comparing DateTime fields with different 'times'
My program asks for the user to enter a date which is then converted to a datetime:
var fromDate = DateTime.Parse(txtFromDate.Text);
The reason I'm converting it to a DateTime field is because I ...
0
votes
3answers
54 views
“Cannot insert duplicate key in object” when deleting entries
I know this sounds ridiculous, but I keep getting an error telling me that I cannot insert a duplicate key when trying to delete records in my database. My code is is quite basic
using ...
0
votes
0answers
20 views
Linq to SQL stored procedure and inheritance
I have a stored procedure that is being called in Linq-to-Sql to return Multiple Results. Defined like this
[Function(Name = "dbo.FillProfileProductData")]
...
0
votes
0answers
17 views
Linq Left outer join replace null values returned
I am sure this has been discussed before but I read several LINQ left outer join posts and couldn't figure out whether it has been discussed or not. The closest thread that matched what I was looking ...
1
vote
3answers
55 views
Fastest possible retrieval from a large table with join
I have very large table (Will name it Table A : with probably 300 million records) and another table with around a 100,000 records(Will name it Table B). The task is to retrieve all the records from ...
0
votes
0answers
18 views
Edit row from button click (Datagrid in WPF)
I have a Datagrid populated from Linq-to-SQL class. I want to edit a row from an 'Edit' button then refresh the Datagrid. I have this button click event but it is displaying the catch statement. Any ...
0
votes
0answers
30 views
How can I make a DataContext type object in Linq to SQL
I have a stored procedure which returns the table og log files. I am taking rows from this table and adding it to a stack, how can i implement it properly?
Stack mystack=new Stack();
...
0
votes
3answers
51 views
Executing stored procedure using linq in c#
I made a stored procedure in sql server 2008 which gives me the changes made to a table. I am using Linq to SQL to use this table in C#.
my stored procedure is
CREATE PROCEDURE dbo.getlog
-- ...
0
votes
2answers
42 views
Linq anonymous type with list object property
I have an object lets say its classrooms that is returned from the repository but I use an anonymous type for my View so I convert it like so
return from P in db.ClassRooms
where ...
1
vote
4answers
18 views
How can I make LINQ Lambda expressions fail gracefully like XPath?
More a general question, but how can I write LINQ Lambda expressions such that they will return a default string or simply an empty string if the LINQ expression fails or returns nothing. In XSLT ...
0
votes
0answers
7 views
linq to sql How to Hydrate a two tables implementation of Many to Many
I have two tables Task and Dependency
public class Task
{
public long Id;
}
public class Dependency
{
public long TaskId;
public long DependOnTaskId;
}
I'd would like to hydrate a ...
1
vote
4answers
58 views
How to deal with Nulls in LINQ expressions?
I am wanting to know the best way for the following expression to return null if the "Orders" collection is null. Currently "First" raises an exception. I have tried "FirstOrDefault" without success.
...
0
votes
1answer
21 views
How to use Intersection between two list for multiple values in linq for unique records
Hello to all Professionals,
Currently I am stucked at one query and not getting a proper solution to my problem. Here is the issue.
Table 1 Table 2
Form_id ...
-3
votes
0answers
16 views
What is Storage and IsDiscriminator in LINQ toSQL
I am new to LINQ and LINQ to SQL.
Please let me know what is the meaning of storage and IsDiscriminator attributes when we are creating entities , above propeties of entity class.
When we need to use ...