LINQ to SQL is a component of .NET Framework version 3.5 that provides a run-time infrastructure for managing relational data as objects.

learn more… | top users | synonyms (3)

-1
votes
1answer
16 views

Update combobox after inserting / deleting record Linq to Sql [closed]

I inserted a new record using Linq to Sql SubmitChanges() method. How can I update the combobox so it will show the new record as one of the items? Same question regarding deleting a record.
1
vote
0answers
26 views

Could not find an implementation of the query pattern - linq error

Having trouble with my linq query in my model of MVC. I have an edmx which is composed of ObjectSet and EntityObject. this is where im getting the error "from c in CanaClie0012". when i go to ...
0
votes
2answers
22 views

convert select query to linq on sql server 2008

I have two tables: Album(AlbumId, AlbumName) and Photo(PhotoId, PhotoName, AlbumId) I have : select top 1 Photo.PhotoId from Photo where Album.AlbumId=Photo.AlbumId order by NEWID() This is ...
-1
votes
0answers
7 views

convert sql to linq using on MVC4

I have sql bellow: select Project.ProjectId,Project.ProjectName,Project.PM,Project.Introduction, Photo.PhotoName,Photo.[Path] from Project inner join Album on Project.AlbumId=Album.AlbumId inner join ...
0
votes
1answer
23 views

LINQ right outer join with multiple conditions in join

I'm trying to convert the following SQL to LINQ: select * from ClientCommands as cc join ClientCommandTypes as cct on cc.ClientCommandTypeID = cct.ClientCommandTypeID right outer join ...
0
votes
0answers
11 views

EntityFunctions.TruncateTime and unit tests 2?

I am running into the same issue as this previous poster, see : EntityFunctions.TruncateTime and unit tests The difference is that I have 2 objects (tables) that I link in my query on an Id. One of ...
1
vote
1answer
45 views

Linq to sql query: how to prevent duplication of code

My problem I'm very new to Linq and I have to difficulties using it. I have written functional queries but I was forced to duplicate some code in every single query. The first part for the queries ...
-1
votes
4answers
65 views

Upload File and Save to Database

I am trying to upload a file from disk and then insert the file into a varbinary db column. I can't seem to figure out how to insert the binary file. I am using C# and Linq to Sql in a WPF ...
0
votes
1answer
6 views

Is Linq to Sql DeleteOnSubmit threadsafe?

Assuming the decision to delete is independent and threadsafe, is it threadsafe to call DeleteOnSubmit in parallel? All entities will be added to the delete in parallel, then the change will be ...
0
votes
2answers
51 views

Can you query recently added objects without calling SubmitChanges?

Without getting into the details of my application I am curious if this is even possible in linq-to-sql or not. Can I write a LINQ statement to look at both the records in the database and records ...
0
votes
1answer
38 views

Is there something like .take for varchar?

I have a table that has addresses in it and I need to retrieve at least 13 of them in order after they are sorted by street name and street number. Both fields are stored as nvarchar so .take will ...
0
votes
2answers
26 views

linq to sql Object Reference not set to an object

I have this query in Linq to Sql decimal Rewards = db.User.FirstOrDefault(x => x.FFUserID == UserID).TotalCommission; This query didn't find a record matching the userID , so obviously that's ...
6
votes
2answers
55 views

Why is Convert.ToDecimal returning different values

I was hoping someone might help me understand why Convert.ToDecimal when used within linq is rounding a decimal and when used outside, it does not Given the following DB: CREATE TABLE ...
0
votes
2answers
46 views

LINQ To SQL Include existing object in insert

In this method, I am inserting a new item (Room) into the database. That process functions as expected. But, in addition to that, each time I add a room, I want to add a piece of furniture as the ...
0
votes
1answer
17 views

LINQ-SQL keep requiring money column to be of type Single, even though it already is

The error I get is this: The 'SalesValue' property on 'ItemSale' could not be set to a 'Decimal' value. You must set this property to a non-null value of type 'Single'. But I already did: ...

1 2 3 4 5 717
15 30 50 per page