linq and asp.net

N

Nedim

I am starting a new web application and I was planning on using linq but i
have a bunch of problems.
most forms will display some data from the database, but there always has to
be a filtering support - you need to be able to filter the data based on one
or more columns (I make the filter in runtime). The data also has to be paged
(with user selected sort column).

First I wanted to use the LinqDataSource for this, but it does not have a
Refresh method and filtering via parameters from controls doesnt work. I
tried then making my own linq query and binding listview on it, but then
datapager doesnt work properly (that is, it doesnt work at all).

so please help, should i go back to the datasets which require a lot more
work, or is there a way to make use of the linq queries - i need to be able
to make pager work (or some other way to display page numbers and them to be
working links) and to be able to have more fields for filtering?
pls help

thanx in advance,
Nedim
 
M

Mark Rae [MVP]

so please help, should i go back to the datasets which require a lot more
work, or is there a way to make use of the linq queries - i need to be
able
to make pager work (or some other way to display page numbers and them to
be
working links) and to be able to have more fields for filtering?

I think the debate on Linq is likely to become almost as heated as the C# vs
VB.NET debate we started back in 2002 which, thankfully, has pretty much
gone away now...

My personal opinion (so far) is that Linq is superb at allowing .NET objects
to be queried using SQL syntax *as if* they were data tables, but I haven't
really found any need to use Linq to query an actual database... That's
almost certainly because I never go anywhere near the SqlDataSource /
AccessDataSource etc objects - instead, I have a standard DAL which I use
for all database work so, once the connection string is in place, any
individual query is usually just one line of C# code...

There's an interesting take on this here:
http://blogs.msdn.com/ploeh/archive...NQImpactDatabaseDevelopmentBestPractices.aspx
 
N

Nedim

well my biggest problem is paging (with filtering) and i've always had
trouble doing that. linq seemed like a good solution for that, but there is
just too many unfinished (or maybe things I havent found out yet) to make it
useful for everything - again, i think that filtering and refresh method on
linqdatasource are pretty basic things.
and now with so many new things in .net 3.5 and new project, i want to use
all the benefits of a new enviroment that i can, so I'm still not sure what
to do and how to do it - separate dal project, should the dal use datasets,
linq or both, and what is the best way to do paging - pager control seemed
godsend, but it doesnt work with anything other then linqdatasource.
 
E

Eliyahu Goldin

One of the major challenges in asp.net is to keep your lane straight without
making unnecessary turns.

I have an impression that many asp.net innovations target novice developers
or those who switch over from some other technologies. Developers who have
already made their way and style through the years of practical development,
who already know sql, javascript and all sorts of big and little things,
don't need to rush to switch the paradigm of managing everything in
server-side code modules.

In many cases it is better to use natural database queries without
introducing an extra complexity layer and having to pass through yet another
learning curve.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
M

Mark Rae [MVP]

Yup. LINQ is great, LINQ is cool. To write apps with LINQ, you gotta take
time for LINQ school. (boy, that was profound, huh...)

Nah - if you'd wanted to be really cool, you'd have rhymed Bromberg with
homburg... ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

LINQ DataSource, Where Parameters, ASP.NET 0
Linq\MSAccess 0
Linq May CTP 2006 1
Linq 5
LINQ DataSource, Where Parameters, ASP.NET 0
LINQ and Gridview 2
LINQ and ListView problem 1
linq to object query 1

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top