By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

linq and asp.net

P: n/a
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
Jan 3 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Nedim" <Ne***@discussions.microsoft.comwrote in message
news:57**********************************@microsof t.com...
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/...Practices.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #2

P: n/a
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.

"Mark Rae [MVP]" wrote:
"Nedim" <Ne***@discussions.microsoft.comwrote in message
news:57**********************************@microsof t.com...
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/...Practices.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #3

P: n/a
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
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
"Nedim" <Ne***@discussions.microsoft.comwrote in message
news:57**********************************@microsof t.com...
>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/...Practices.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #4

P: n/a
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:%2****************@TK2MSFTNGP03.phx.gbl...

I couldn't agree more.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #5

P: n/a
Yup. LINQ is great, LINQ is cool. To write apps with LINQ, you gotta take
time for LINQ school. (boy, that was profound, huh...)
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Mark Rae [MVP]" wrote:
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:%2****************@TK2MSFTNGP03.phx.gbl...

I couldn't agree more.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #6

P: n/a
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:BB**********************************@microsof t.com...
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... ;-)
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 3 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.