63
votes
5answers
42k views

efficient way to implement paging

Should I use LINQ's Skip() and Take() method for paging, or implement my own paging with a SQL query? Which is most efficient? Why would I choose one over the other? I'm using SQL Server 2008, ...
31
votes
8answers
6k views

Linq to SQL DateTime values are local (Kind=Unspecified) - How do I make it UTC?

Isn't there a (simple) way to tell Linq To SQL classes that a particular DateTime property should be considered as UTC (i.e. having the Kind property of the DateTime type to be Utc by default), or is ...
13
votes
3answers
3k views

SQL server profiler not showing LINQ To Sql queries

I am trying to view SQL generated by Linq to SQL in the SQL Server Profiler (2005). I can see the sql sent to the server from anything except for linq to sql. I'm betting that I need to change event ...
13
votes
5answers
2k views

Entity Framework 4 vs LINQ to SQL, for small or medium-size apps, working with SQL Server

I've seen some discussion about L2S vs EF4 on Stack Overflow back in April, when VS2010 was launched, namely: Dump Linq-To-Sql now that Entity Framework 4.0 has been released? Is Entity Framework ...
13
votes
3answers
1k views

Do we still need stored procedures when using compiled queries?

When using compiled queries in entity framework (or linq-to-sql) in combination with SQL Server, is there actually still any performance benefit in using stored procedures? Compiled queries will be ...
11
votes
3answers
9k views

What causes Timeout expired SqlExceptions in LINQ to SQL?

My application keeps running into Timeout Expired SqlExceptions. The thing is that this query is one that will simply have to run for a decent amount of time. I'm having trouble figuring out where ...
11
votes
2answers
2k views

ASP.NET MVC Caching vary by authentication

I'm using ASP.NET Preview 5 (will upgrade soon to Beta) with LINQ2SQL on my recently launched tiny webapp. I was so proud of my work until Silverlight.net featured it on the first page and it started ...
11
votes
4answers
683 views

Linq-to-sql failing on insert and update when this is a trigger attached

I am having some problems with linq-to-sql lately. The problem is that it “thinks” that it fails on inserts and updates when we have a trigger attached to the event. An example could be a row, where a ...
10
votes
4answers
9k views

Instead of trigger in SQL Server loses SCOPE_IDENTITY?

I have a table where I created an INSTEAD OF trigger to enforce some business rules. The issue is that when I insert data into this table, SCOPE_IDENTITY() returns a NULL value, rather than the ...
10
votes
2answers
3k views

Can't drag stored procedure onto dbml designer

I'm trying to do a simple call to a database stored procedure from a C# application. I'm following a guide like, e.g., this one or this one. Both of these have the same basic steps. Add a LINQ to ...
10
votes
4answers
9k views

Rollback a stored procedure call from inside a transaction using LINQ-to-SQL?

I have a C#.net winform program which runs with a SQL Server database. I am using LINQ-to-SQL. Is it possible to rollback the call to one or more stored procedures inside a transaction within my ...
10
votes
10answers
4k views

Best-practices for localizing a SQL Server (2005/2008) database

Question I'm sure many of you have been faced by the challenge of localizing a database backend to an application. If you've not then I'd be pretty confident in saying that the odds of you having to ...
9
votes
7answers
2k views

Which fieldtype is best for storing PRICE values?

Hi there I am wondering whats the best "price field" in SQL Server for a shoplike structure? Looking at this overview: http://www.teratrax.com/sql_guide/data_types/sql_server_data_types.html We have ...
9
votes
5answers
479 views

Using text SQL with LINQ

I'm currently having issues with using LINQ to SQL for my project. This is because most of the lengthy SQL queries (or views, rather) are hard-coded into C#, and what we've been doing all along is to ...
9
votes
7answers
5k views

Does LINQ To SQL provide faster response times than using ado.net and oledb?

LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL requires one to communicate with the database in a certain way that opens the database to injections. Inline ...

1 2 3 4 5 48
15 30 50 per page